From 59f9ff7d5f1e04307c52b7a732fe0a2a005d54a7 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Wed, 21 Jan 2026 23:13:46 +0000 Subject: [PATCH 01/12] feat: add native program examples for compressed tokens --- program-examples/native/Cargo.lock | 8809 +++++++++++++++++ program-examples/native/Cargo.toml | 18 + program-examples/native/README.md | 59 + program-examples/native/program/Cargo.toml | 38 + .../native/program/program-keypair.json | 1 + .../program/src/instructions/approve.rs | 53 + .../native/program/src/instructions/burn.rs | 49 + .../native/program/src/instructions/close.rs | 45 + .../program/src/instructions/create_ata.rs | 84 + .../program/src/instructions/create_mint.rs | 190 + .../src/instructions/create_token_account.rs | 73 + .../native/program/src/instructions/freeze.rs | 41 + .../program/src/instructions/mint_to.rs | 55 + .../native/program/src/instructions/mod.rs | 60 + .../native/program/src/instructions/revoke.rs | 41 + .../native/program/src/instructions/thaw.rs | 41 + .../src/instructions/transfer_interface.rs | 62 + program-examples/native/program/src/lib.rs | 16 + .../native/program/tests/approve.rs | 59 + program-examples/native/program/tests/burn.rs | 47 + .../native/program/tests/close.rs | 60 + .../native/program/tests/create_ata.rs | 74 + .../native/program/tests/create_mint.rs | 268 + .../program/tests/create_token_account.rs | 76 + .../native/program/tests/freeze.rs | 53 + .../native/program/tests/mint_to.rs | 197 + .../native/program/tests/revoke.rs | 55 + .../native/program/tests/shared.rs | 962 ++ program-examples/native/program/tests/thaw.rs | 59 + .../native/program/tests/transfer.rs | 78 + program-examples/native/rust-toolchain.toml | 4 + program-examples/native/rustfmt.toml | 1 + 32 files changed, 11728 insertions(+) create mode 100644 program-examples/native/Cargo.lock create mode 100644 program-examples/native/Cargo.toml create mode 100644 program-examples/native/README.md create mode 100644 program-examples/native/program/Cargo.toml create mode 100644 program-examples/native/program/program-keypair.json create mode 100644 program-examples/native/program/src/instructions/approve.rs create mode 100644 program-examples/native/program/src/instructions/burn.rs create mode 100644 program-examples/native/program/src/instructions/close.rs create mode 100644 program-examples/native/program/src/instructions/create_ata.rs create mode 100644 program-examples/native/program/src/instructions/create_mint.rs create mode 100644 program-examples/native/program/src/instructions/create_token_account.rs create mode 100644 program-examples/native/program/src/instructions/freeze.rs create mode 100644 program-examples/native/program/src/instructions/mint_to.rs create mode 100644 program-examples/native/program/src/instructions/mod.rs create mode 100644 program-examples/native/program/src/instructions/revoke.rs create mode 100644 program-examples/native/program/src/instructions/thaw.rs create mode 100644 program-examples/native/program/src/instructions/transfer_interface.rs create mode 100644 program-examples/native/program/src/lib.rs create mode 100644 program-examples/native/program/tests/approve.rs create mode 100644 program-examples/native/program/tests/burn.rs create mode 100644 program-examples/native/program/tests/close.rs create mode 100644 program-examples/native/program/tests/create_ata.rs create mode 100644 program-examples/native/program/tests/create_mint.rs create mode 100644 program-examples/native/program/tests/create_token_account.rs create mode 100644 program-examples/native/program/tests/freeze.rs create mode 100644 program-examples/native/program/tests/mint_to.rs create mode 100644 program-examples/native/program/tests/revoke.rs create mode 100644 program-examples/native/program/tests/shared.rs create mode 100644 program-examples/native/program/tests/thaw.rs create mode 100644 program-examples/native/program/tests/transfer.rs create mode 100644 program-examples/native/rust-toolchain.toml create mode 100644 program-examples/native/rustfmt.toml diff --git a/program-examples/native/Cargo.lock b/program-examples/native/Cargo.lock new file mode 100644 index 00000000..04682160 --- /dev/null +++ b/program-examples/native/Cargo.lock @@ -0,0 +1,8809 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[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 = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "agave-feature-set" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a2c365c0245cbb8959de725fc2b44c754b673fdf34c9a7f9d4a25c35a7bf1" +dependencies = [ + "ahash", + "solana-epoch-schedule", + "solana-hash", + "solana-pubkey", + "solana-sha256-hasher", + "solana-svm-feature-set", +] + +[[package]] +name = "agave-precompiles" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d60d73657792af7f2464e9181d13c3979e94bb09841d9ffa014eef4ef0492b77" +dependencies = [ + "agave-feature-set", + "bincode", + "digest 0.10.7", + "ed25519-dalek", + "libsecp256k1", + "openssl", + "sha3", + "solana-ed25519-program", + "solana-message", + "solana-precompile-error", + "solana-pubkey", + "solana-sdk-ids", + "solana-secp256k1-program", + "solana-secp256r1-program", +] + +[[package]] +name = "agave-reserved-account-keys" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8289c8a8a2ef5aa10ce49a070f360f4e035ee3410b8d8f3580fb39d8cf042581" +dependencies = [ + "agave-feature-set", + "solana-pubkey", + "solana-sdk-ids", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "aligned-sized" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48a526ec4434d531d488af59fe866f36b310fe8906691c75dffa664450a3800a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[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 = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anchor-attribute-access-control" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f70fd141a4d18adf11253026b32504f885447048c7494faf5fa83b01af9c0cf" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715a261c57c7679581e06f07a74fa2af874ac30f86bd8ea07cca4a7e5388a064" +dependencies = [ + "anchor-syn", + "bs58", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "730d6df8ae120321c5c25e0779e61789e4b70dc8297102248902022f286102e4" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27e6e449cc3a37b2880b74dcafb8e5a17b954c0e58e376432d7adc646fb333ef" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7710e4c54adf485affcd9be9adec5ef8846d9c71d7f31e16ba86ff9fc1dd49f" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ecfd49b2aeadeb32f35262230db402abed76ce87e27562b34f61318b2ec83c" +dependencies = [ + "anchor-lang-idl", + "anchor-syn", + "anyhow", + "bs58", + "heck 0.3.3", + "proc-macro2", + "quote", + "serde_json", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be89d160793a88495af462a7010b3978e48e30a630c91de47ce2c1d3cb7a6149" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abc6ee78acb7bfe0c2dd2abc677aaa4789c0281a0c0ef01dbf6fe85e0fd9e6e4" +dependencies = [ + "anchor-syn", + "borsh-derive-internal", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-space" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134a01c0703f6fd355a0e472c033f6f3e41fac1ef6e370b20c50f4c8d022cea7" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-lang" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6bab117055905e930f762c196e08f861f8dfe7241b92cee46677a3b15561a0a" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", + "base64 0.21.7", + "bincode", + "borsh 0.10.4", + "bytemuck", + "solana-program", + "thiserror 1.0.69", +] + +[[package]] +name = "anchor-lang-idl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e8599d21995f68e296265aa5ab0c3cef582fd58afec014d01bd0bce18a4418" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck 0.3.3", + "serde", + "serde_json", + "sha2 0.10.9", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + +[[package]] +name = "anchor-spl" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c08cb5d762c0694f74bd02c9a5b04ea53cefc496e2c27b3234acffca5cd076b" +dependencies = [ + "anchor-lang", + "spl-associated-token-account 6.0.0", + "spl-pod", + "spl-token 7.0.0", + "spl-token-2022 6.0.0", + "spl-token-group-interface 0.5.0", + "spl-token-metadata-interface 0.6.0", +] + +[[package]] +name = "anchor-syn" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dc7a6d90cc643df0ed2744862cdf180587d1e5d28936538c18fc8908489ed67" +dependencies = [ + "anyhow", + "bs58", + "heck 0.3.3", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.9", + "syn 1.0.109", + "thiserror 1.0.69", +] + +[[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 = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bn254" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe 0.6.0", + "fnv", + "hashbrown 0.15.2", + "itertools 0.13.0", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint 0.4.6", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe 0.6.0", + "itertools 0.13.0", + "num-bigint 0.4.6", + "num-traits", + "paste", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.114", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe 0.6.0", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint 0.4.6", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "num-bigint 0.4.6", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", + "rayon", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "async-compression" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d10e4f991a553474232bc0a31799f6d24b034a84c0971d80d2e2f78b2e576e40" +dependencies = [ + "compression-codecs", + "compression-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +dependencies = [ + "serde_core", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake3" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" +dependencies = [ + "borsh-derive 0.10.4", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" +dependencies = [ + "borsh-derive 1.6.0", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0686c856aa6aac0c4498f936d7d6a02df690f614c03e4d906d1018062b5c5e2c" +dependencies = [ + "once_cell", + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "brotli" +version = "8.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + +[[package]] +name = "bytemuck" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" + +[[package]] +name = "cc" +version = "1.2.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "cfg_eval" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "chrono" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "compression-codecs" +version = "0.4.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" +dependencies = [ + "brotli", + "compression-core", + "flate2", + "memchr", +] + +[[package]] +name = "compression-core" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width", + "windows-sys 0.59.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 = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +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.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rand_core 0.6.4", + "rustc_version", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "darling" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.114", +] + +[[package]] +name = "darling_macro" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "derivation-path" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek-bip32" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" +dependencies = [ + "derivation-path", + "ed25519-dalek", + "hmac 0.12.1", + "sha2 0.10.9", +] + +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize 3.1.15", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize 4.3.2", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +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.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[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.6", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1091a7bb1f8f2c4b28f1fe2cef4980ca2d410a3d727d67ecc3178c9b0800f0" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "find-msvc-tools" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41" + +[[package]] +name = "five8" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75b8549488b4715defcb0d8a8a1c1c76a80661b5fa106b4ca0e7fce59d7d875" +dependencies = [ + "five8_core", +] + +[[package]] +name = "five8_const" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26dec3da8bc3ef08f2c04f61eab298c3ab334523e55f076354d6d6f613799a7b" +dependencies = [ + "five8_core", +] + +[[package]] +name = "five8_core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2551bf44bc5f776c15044b9b94153a00198be06743e262afaaa61f11ac7523a5" + +[[package]] +name = "flate2" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +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 = [ + "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 = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "groth16-solana" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6d1ffb18dbf5cfc60b11bd7da88474c672870247c1e5b498619bcb6ba3d8f5" +dependencies = [ + "ark-bn254 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "num-bigint 0.4.6", + "solana-bn254", + "thiserror 1.0.69", +] + +[[package]] +name = "h2" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.13.0", + "slab", + "tokio", + "tokio-util 0.7.18", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.4.0", + "indexmap 2.13.0", + "slab", + "tokio", + "tokio-util 0.7.18", + "tracing", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "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" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.4.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http 1.4.0", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" + +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.27", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2 0.4.13", + "http 1.4.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "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 0.2.12", + "hyper 0.14.32", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http 1.4.0", + "hyper 1.8.1", + "hyper-util", + "rustls 0.23.36", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.4", + "tower-service", + "webpki-roots 1.0.5", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.32", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.8.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http 1.4.0", + "http-body 1.0.1", + "hyper 1.8.1", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2 0.6.1", + "system-configuration 0.6.1", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "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 = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[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", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width", + "web-time", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +dependencies = [ + "once_cell", + "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 = "kaigan" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba15de5aeb137f0f65aa3bf82187647f1285abfe5b20c80c2c37f7007ad519a" +dependencies = [ + "borsh 0.10.4", + "serde", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "light-account-checks" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0785da22cd4a7667583141ca56c790a5c8afa2b22ad2a08204d78881035524e8" +dependencies = [ + "solana-account-info", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sysvar", + "thiserror 2.0.17", +] + +[[package]] +name = "light-array-map" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859dc5b406a8bf0b114f686e6f2e36d0e939bad6f579492a520d309b52fde1f8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "light-batched-merkle-tree" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13cb8bc778065ee71d1990fdc94112e35dc63a5e387a323284a49f40d123d8e0" +dependencies = [ + "aligned-sized", + "borsh 0.10.4", + "light-account-checks", + "light-bloom-filter", + "light-compressed-account 0.8.0", + "light-hasher", + "light-macros", + "light-merkle-tree-metadata", + "light-verifier", + "light-zero-copy 0.6.0", + "solana-account-info", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sysvar", + "thiserror 2.0.17", + "zerocopy", +] + +[[package]] +name = "light-bloom-filter" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a609e3c9179f0ae8488cc70c5413c86dfd97dad7ad85fee2ad8da2d0a11e61" +dependencies = [ + "bitvec", + "num-bigint 0.4.6", + "solana-nostd-keccak", + "solana-program-error", + "thiserror 2.0.17", +] + +[[package]] +name = "light-bounded-vec" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cfa375d028164719e3ffef93d2e5c27855cc8a5bb5bf257b868d17c12a3e66" +dependencies = [ + "bytemuck", + "memoffset", + "solana-program-error", + "thiserror 1.0.69", +] + +[[package]] +name = "light-client" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1f3cd013364dbe5c45a9e9a8faee1af30dccb600cd56a41e296ed8d5684768" +dependencies = [ + "anchor-lang", + "async-trait", + "base64 0.13.1", + "borsh 0.10.4", + "bs58", + "futures", + "lazy_static", + "light-compressed-account 0.8.0", + "light-compressible", + "light-concurrent-merkle-tree", + "light-event", + "light-hasher", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-prover-client", + "light-sdk", + "light-token", + "light-token-interface", + "litesvm", + "num-bigint 0.4.6", + "photon-api", + "rand 0.8.5", + "smallvec", + "solana-account", + "solana-account-decoder-client-types", + "solana-address-lookup-table-interface", + "solana-banks-client", + "solana-clock", + "solana-commitment-config", + "solana-compute-budget-interface", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-program-error", + "solana-pubkey", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-signature", + "solana-transaction", + "solana-transaction-error", + "solana-transaction-status-client-types", + "spl-pod", + "spl-token-2022-interface", + "thiserror 2.0.17", + "tokio", + "tracing", +] + +[[package]] +name = "light-compressed-account" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058df2733fa6a3e4bda6f162a6c5d41f10fc8c6f6ddb992af1de76b60214e4a6" +dependencies = [ + "borsh 0.10.4", + "light-hasher", + "light-macros", + "light-program-profiler", + "light-zero-copy 0.5.0", + "thiserror 2.0.17", + "tinyvec", + "zerocopy", +] + +[[package]] +name = "light-compressed-account" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "768ae5a56d8c9cf315d132b3faa5b067f95b3d6a294c579e82f8f0e0bf29c7cc" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-hasher", + "light-macros", + "light-poseidon 0.3.0", + "light-program-profiler", + "light-zero-copy 0.6.0", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "thiserror 2.0.17", + "tinyvec", + "zerocopy", +] + +[[package]] +name = "light-compressible" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff0f0065beb8d16df587b3ea17082e11dea3f67c98813b4bcc061eecd94561f" +dependencies = [ + "aligned-sized", + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-account-checks", + "light-compressed-account 0.8.0", + "light-hasher", + "light-macros", + "light-program-profiler", + "light-sdk-types", + "light-zero-copy 0.6.0", + "pinocchio-pubkey", + "solana-pubkey", + "thiserror 2.0.17", + "zerocopy", +] + +[[package]] +name = "light-concurrent-merkle-tree" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db96f47253a0907aaa46dac15cecb27b5510130e48da0b36690dcd2e99a6d558" +dependencies = [ + "borsh 0.10.4", + "light-bounded-vec", + "light-hasher", + "memoffset", + "solana-program-error", + "thiserror 2.0.17", +] + +[[package]] +name = "light-event" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1674c9d85b32a9e8abb90cccdee18e35ae29daa1126fdb81a8a28c0a54802096" +dependencies = [ + "borsh 0.10.4", + "light-compressed-account 0.8.0", + "light-hasher", + "light-zero-copy 0.6.0", + "thiserror 2.0.17", +] + +[[package]] +name = "light-hasher" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c822662e6e109bac0e132a43fd52a4ef684811245a794e048cf9cda001e934c8" +dependencies = [ + "ark-bn254 0.5.0", + "ark-ff 0.5.0", + "borsh 0.10.4", + "light-poseidon 0.3.0", + "num-bigint 0.4.6", + "sha2 0.10.9", + "sha3", + "solana-program-error", + "thiserror 2.0.17", + "tinyvec", +] + +[[package]] +name = "light-indexed-array" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f14f984030d86b6f07bd8f5ae04e2c40fcd0c3bdfcc7a291fff1ed59c9e6554" +dependencies = [ + "light-hasher", + "num-bigint 0.4.6", + "num-traits", + "thiserror 2.0.17", +] + +[[package]] +name = "light-indexed-merkle-tree" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0824755289075f28de2820fc7d4ec4e6b9e99d404e033c07338b91cce8c71fb8" +dependencies = [ + "light-bounded-vec", + "light-concurrent-merkle-tree", + "light-hasher", + "light-merkle-tree-reference", + "num-bigint 0.4.6", + "num-traits", + "solana-program-error", + "thiserror 2.0.17", +] + +[[package]] +name = "light-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "179ac51cadc1d0ca047b4d6265a7cc245ca3affc16a20a2749585aa6464d39c2" +dependencies = [ + "bs58", + "proc-macro2", + "quote", + "solana-pubkey", + "syn 2.0.114", +] + +[[package]] +name = "light-merkle-tree-metadata" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17d08edcc194eef61b0f499934ce398122d54ac57505d44480e5f079a4220566" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-compressed-account 0.8.0", + "solana-msg", + "solana-program-error", + "solana-sysvar", + "thiserror 2.0.17", + "zerocopy", +] + +[[package]] +name = "light-merkle-tree-reference" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d480f62ca32b38a6231bbc5310d693f91d6b5bdcc18bb13c2d9aab7a1c90e8" +dependencies = [ + "light-hasher", + "light-indexed-array", + "num-bigint 0.4.6", + "num-traits", + "thiserror 2.0.17", +] + +[[package]] +name = "light-poseidon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ff 0.4.2", + "num-bigint 0.4.6", + "thiserror 1.0.69", +] + +[[package]] +name = "light-poseidon" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3d87542063daaccbfecd78b60f988079b6ec4e089249658b9455075c78d42" +dependencies = [ + "ark-bn254 0.5.0", + "ark-ff 0.5.0", + "num-bigint 0.4.6", + "thiserror 1.0.69", +] + +[[package]] +name = "light-profiler-macro" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8be18fe4de58a6f754caa74a3fbc6d8a758a26f1f3c24d5b0f5b55df5f5408" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "light-program-profiler" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1d345871581aebd8825868a3f08410290aa1cdddcb189ca7f7e588f61d79fcf" +dependencies = [ + "light-profiler-macro", +] + +[[package]] +name = "light-program-test" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a981dfbc19c529543ab1dd8d100319b89aac053b81415a681d1474c986218307" +dependencies = [ + "anchor-lang", + "async-trait", + "base64 0.13.1", + "borsh 0.10.4", + "bs58", + "bytemuck", + "chrono", + "light-client", + "light-compressed-account 0.8.0", + "light-compressible", + "light-event", + "light-hasher", + "light-indexed-array", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-merkle-tree-reference", + "light-prover-client", + "light-sdk", + "light-sdk-types", + "light-token", + "light-token-interface", + "light-zero-copy 0.6.0", + "litesvm", + "log", + "num-bigint 0.4.6", + "num-traits", + "photon-api", + "rand 0.8.5", + "reqwest 0.12.28", + "serde", + "serde_json", + "solana-account", + "solana-banks-client", + "solana-compute-budget", + "solana-instruction", + "solana-pubkey", + "solana-rpc-client-api", + "solana-sdk", + "solana-transaction", + "solana-transaction-status", + "solana-transaction-status-client-types", + "spl-token-2022 7.0.0", + "tabled", + "tokio", +] + +[[package]] +name = "light-prover-client" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75d8c9b8b6e9d445b9ef27467da592ee231e614282c3c0bd2f30f567eb904845" +dependencies = [ + "ark-bn254 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "light-compressed-account 0.7.0", + "light-hasher", + "light-indexed-array", + "light-sparse-merkle-tree", + "num-bigint 0.4.6", + "num-traits", + "reqwest 0.11.27", + "serde", + "serde_json", + "solana-bn254", + "thiserror 2.0.17", + "tokio", + "tracing", +] + +[[package]] +name = "light-sdk" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dece106ebd0897bd23a12bad040e0999d93b54447d0473739f91b1f83b1d331" +dependencies = [ + "anchor-lang", + "bincode", + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account 0.8.0", + "light-compressible", + "light-hasher", + "light-macros", + "light-sdk-macros", + "light-sdk-types", + "light-zero-copy 0.6.0", + "num-bigint 0.4.6", + "solana-account-info", + "solana-clock", + "solana-cpi", + "solana-instruction", + "solana-loader-v3-interface", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-system-interface", + "solana-sysvar", + "thiserror 2.0.17", +] + +[[package]] +name = "light-sdk-macros" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "315633f6d8bf736dd2f6cec318b662f1dc507f9d66e52ad35d91270870f6acb6" +dependencies = [ + "darling", + "light-hasher", + "light-sdk-types", + "proc-macro2", + "quote", + "solana-pubkey", + "syn 2.0.114", +] + +[[package]] +name = "light-sdk-types" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b765f0a39428a137b8d449fa60ba147194cdbff08aa0add598c6047fff2cb7d2" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account 0.8.0", + "light-hasher", + "light-macros", + "solana-msg", + "thiserror 2.0.17", +] + +[[package]] +name = "light-sparse-merkle-tree" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4251e79b6c63f4946572dcfd7623680ad0f9e0efe1a761a944733333c5645063" +dependencies = [ + "light-hasher", + "light-indexed-array", + "num-bigint 0.4.6", + "num-traits", + "thiserror 2.0.17", +] + +[[package]] +name = "light-token" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62907a12a9801200e5f4c03bb7f2dbdd9aa679223a959167c456a06005291d79" +dependencies = [ + "anchor-lang", + "arrayvec", + "borsh 0.10.4", + "light-account-checks", + "light-batched-merkle-tree", + "light-compressed-account 0.8.0", + "light-compressible", + "light-macros", + "light-program-profiler", + "light-sdk", + "light-sdk-macros", + "light-sdk-types", + "light-token-interface", + "light-token-types", + "light-zero-copy 0.6.0", + "solana-account-info", + "solana-cpi", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-pod", + "thiserror 2.0.17", +] + +[[package]] +name = "light-token-cpi" +version = "0.1.0" +dependencies = [ + "anchor-spl", + "blake3", + "borsh 0.10.4", + "light-client", + "light-program-test", + "light-token", + "light-token-interface", + "solana-program", + "solana-sdk", + "spl-pod", + "spl-token 7.0.0", + "spl-token-2022 7.0.0", + "tokio", +] + +[[package]] +name = "light-token-interface" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fb19b8e268a0154a8e13b3a8f6f43fa4928643e2de102d98a90b2af21f482ba" +dependencies = [ + "aligned-sized", + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-array-map", + "light-compressed-account 0.8.0", + "light-compressible", + "light-hasher", + "light-macros", + "light-program-profiler", + "light-zero-copy 0.6.0", + "pinocchio", + "pinocchio-pubkey", + "solana-account-info", + "solana-pubkey", + "spl-pod", + "spl-token-2022 7.0.0", + "thiserror 2.0.17", + "tinyvec", + "zerocopy", +] + +[[package]] +name = "light-token-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "278dddbf18d104f1225c480ca6d7b8710e1f9ff4104f24be70c522ecb6ed1dfc" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account 0.8.0", + "light-macros", + "light-sdk-types", + "solana-msg", + "thiserror 2.0.17", +] + +[[package]] +name = "light-verifier" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f35f47736be493b60d8b56ef0c8e94afd6a99efafebb257f62b0b545e9aacab" +dependencies = [ + "groth16-solana", + "light-compressed-account 0.8.0", + "thiserror 2.0.17", +] + +[[package]] +name = "light-zero-copy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8862f463792fd60ae8f5dc418150c16213e302e19d54fba0694cf8515be5ff" +dependencies = [ + "light-zero-copy-derive 0.5.0", + "zerocopy", +] + +[[package]] +name = "light-zero-copy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5621fb515e14af46148699c0b65334aabe230a1d2cbd06736ccc7a408c8a4af" +dependencies = [ + "light-zero-copy-derive 0.6.0", + "solana-program-error", + "zerocopy", +] + +[[package]] +name = "light-zero-copy-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af086d52100b3cab1f2993b146adc7a69fa6aaa878ae4c19514c77c50304379" +dependencies = [ + "lazy_static", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "light-zero-copy-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c46425e5c7ab5203ff5c86ae2615b169cca55f9283f5f60f5dd74143be6934" +dependencies = [ + "lazy_static", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "litesvm" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bca37ac374948b348e29c74b324dc36f18bbbd1ccf80e2046d967521cbd143" +dependencies = [ + "agave-feature-set", + "agave-precompiles", + "agave-reserved-account-keys", + "ansi_term", + "bincode", + "indexmap 2.13.0", + "itertools 0.14.0", + "log", + "solana-account", + "solana-address-lookup-table-interface", + "solana-bpf-loader-program", + "solana-builtins", + "solana-clock", + "solana-compute-budget", + "solana-compute-budget-instruction", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-fee", + "solana-fee-structure", + "solana-hash", + "solana-instruction", + "solana-instructions-sysvar", + "solana-keypair", + "solana-last-restart-slot", + "solana-loader-v3-interface", + "solana-loader-v4-interface", + "solana-log-collector", + "solana-message", + "solana-native-token 3.0.0", + "solana-nonce", + "solana-nonce-account", + "solana-precompile-error", + "solana-program-error", + "solana-program-runtime", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-sha256-hasher", + "solana-signature", + "solana-signer", + "solana-slot-hashes", + "solana-slot-history", + "solana-stake-interface", + "solana-svm-callback", + "solana-svm-transaction", + "solana-system-interface", + "solana-system-program", + "solana-sysvar", + "solana-sysvar-id", + "solana-timings", + "solana-transaction", + "solana-transaction-context", + "solana-transaction-error", + "solana-vote-program", + "thiserror 2.0.17", +] + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", + "serde", +] + +[[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.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +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.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +dependencies = [ + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-src" +version = "300.5.4+3.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507b3792995dae9b0df8a1c1e3771e8418b7c2d9f0baeba32e6fe8b06c7cb72" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + +[[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 1.0.69", +] + +[[package]] +name = "papergrid" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6978128c8b51d8f4080631ceb2302ab51e32cc6e8615f735ee2f83fd269ae3f1" +dependencies = [ + "bytecount", + "fnv", + "unicode-width", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "percentage" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +dependencies = [ + "num", +] + +[[package]] +name = "photon-api" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e572dba0c255f5b8176f15b9e849330d915a8927804f7f9702d5bbbc70e4a1ad" +dependencies = [ + "reqwest 0.12.28", + "serde", + "serde_derive", + "serde_json", + "serde_with", + "url", + "uuid", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pinocchio" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b971851087bc3699b001954ad02389d50c41405ece3548cbcafc88b3e20017a" + +[[package]] +name = "pinocchio-pubkey" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0225638cadcbebae8932cb7f49cb5da7c15c21beb19f048f05a5ca7d93f065" +dependencies = [ + "five8_const", + "pinocchio", + "sha2-const-stable", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[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.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "proc-macro2" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "qstring" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "qualifier_attr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.36", + "socket2 0.6.1", + "thiserror 2.0.17", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.2", + "ring", + "rustc-hash", + "rustls 0.23.36", + "rustls-pki-types", + "slab", + "thiserror 2.0.17", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.1", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[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" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "regex" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.27", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls 0.24.2", + "hyper-tls 0.5.0", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration 0.5.1", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg", +] + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.4.13", + "http 1.4.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.8.1", + "hyper-rustls 0.27.7", + "hyper-tls 0.6.0", + "hyper-util", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls 0.23.36", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.26.4", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 1.0.5", +] + +[[package]] +name = "reqwest-middleware" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57f17d28a6e6acfe1733fe24bcd30774d13bffa4b8a22535b4c8c98423088d4e" +dependencies = [ + "anyhow", + "async-trait", + "http 1.4.0", + "reqwest 0.12.28", + "serde", + "thiserror 1.0.69", + "tower-service", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + +[[package]] +name = "rustls" +version = "0.23.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.103.8", + "subtle", + "zeroize", +] + +[[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-pki-types" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" + +[[package]] +name = "schannel" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.10.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-big-array" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[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 = "3.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.13.0", + "schemars 0.9.0", + "schemars 1.2.0", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52a8e3ca0ca629121f70ab50f95249e5a6f925cc0f6ffe8256c45b728875706c" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2-const-stable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "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 = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "solana-account" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f949fe4edaeaea78c844023bfc1c898e0b1f5a100f8a8d2d0f85d0a7b090258" +dependencies = [ + "bincode", + "serde", + "serde_bytes", + "serde_derive", + "solana-account-info", + "solana-clock", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-sysvar", +] + +[[package]] +name = "solana-account-decoder" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba71c97fa4d85ce4a1e0e79044ad0406c419382be598c800202903a7688ce71a" +dependencies = [ + "Inflector", + "base64 0.22.1", + "bincode", + "bs58", + "bv", + "serde", + "serde_derive", + "serde_json", + "solana-account", + "solana-account-decoder-client-types", + "solana-address-lookup-table-interface", + "solana-clock", + "solana-config-program-client", + "solana-epoch-schedule", + "solana-fee-calculator", + "solana-instruction", + "solana-loader-v3-interface", + "solana-nonce", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-slot-hashes", + "solana-slot-history", + "solana-stake-interface", + "solana-sysvar", + "solana-vote-interface", + "spl-generic-token", + "spl-token 8.0.0", + "spl-token-2022 8.0.1", + "spl-token-group-interface 0.6.0", + "spl-token-metadata-interface 0.7.0", + "thiserror 2.0.17", + "zstd", +] + +[[package]] +name = "solana-account-decoder-client-types" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5519e8343325b707f17fbed54fcefb325131b692506d0af9e08a539d15e4f8cf" +dependencies = [ + "base64 0.22.1", + "bs58", + "serde", + "serde_derive", + "serde_json", + "solana-account", + "solana-pubkey", + "zstd", +] + +[[package]] +name = "solana-account-info" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8f5152a288ef1912300fc6efa6c2d1f9bb55d9398eb6c72326360b8063987da" +dependencies = [ + "bincode", + "serde", + "solana-program-error", + "solana-program-memory", + "solana-pubkey", +] + +[[package]] +name = "solana-address-lookup-table-interface" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1673f67efe870b64a65cb39e6194be5b26527691ce5922909939961a6e6b395" +dependencies = [ + "bincode", + "bytemuck", + "serde", + "serde_derive", + "solana-clock", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-slot-hashes", +] + +[[package]] +name = "solana-atomic-u64" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52e52720efe60465b052b9e7445a01c17550666beec855cce66f44766697bc2" +dependencies = [ + "parking_lot", +] + +[[package]] +name = "solana-banks-client" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68548570c38a021c724b5aa0112f45a54bdf7ff1b041a042848e034a95a96994" +dependencies = [ + "borsh 1.6.0", + "futures", + "solana-account", + "solana-banks-interface", + "solana-clock", + "solana-commitment-config", + "solana-hash", + "solana-message", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-signature", + "solana-sysvar", + "solana-transaction", + "solana-transaction-context", + "solana-transaction-error", + "tarpc", + "thiserror 2.0.17", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-banks-interface" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6d90edc435bf488ef7abed4dcb1f94fa1970102cbabb25688f58417fd948286" +dependencies = [ + "serde", + "serde_derive", + "solana-account", + "solana-clock", + "solana-commitment-config", + "solana-hash", + "solana-message", + "solana-pubkey", + "solana-signature", + "solana-transaction", + "solana-transaction-context", + "solana-transaction-error", + "tarpc", +] + +[[package]] +name = "solana-big-mod-exp" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75db7f2bbac3e62cfd139065d15bcda9e2428883ba61fc8d27ccb251081e7567" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "solana-define-syscall", +] + +[[package]] +name = "solana-bincode" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a3787b8cf9c9fe3dd360800e8b70982b9e5a8af9e11c354b6665dd4a003adc" +dependencies = [ + "bincode", + "serde", + "solana-instruction", +] + +[[package]] +name = "solana-blake3-hasher" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0801e25a1b31a14494fc80882a036be0ffd290efc4c2d640bfcca120a4672" +dependencies = [ + "blake3", + "solana-define-syscall", + "solana-hash", + "solana-sanitize", +] + +[[package]] +name = "solana-bn254" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4420f125118732833f36facf96a27e7b78314b2d642ba07fa9ffdacd8d79e243" +dependencies = [ + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "bytemuck", + "solana-define-syscall", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-borsh" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718333bcd0a1a7aed6655aa66bef8d7fb047944922b2d3a18f49cbc13e73d004" +dependencies = [ + "borsh 0.10.4", + "borsh 1.6.0", +] + +[[package]] +name = "solana-bpf-loader-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aec57dcd80d0f6879956cad28854a6eebaed6b346ce56908ea01a9f36ab259" +dependencies = [ + "bincode", + "libsecp256k1", + "num-traits", + "qualifier_attr", + "scopeguard", + "solana-account", + "solana-account-info", + "solana-big-mod-exp", + "solana-bincode", + "solana-blake3-hasher", + "solana-bn254", + "solana-clock", + "solana-cpi", + "solana-curve25519", + "solana-hash", + "solana-instruction", + "solana-keccak-hasher", + "solana-loader-v3-interface", + "solana-loader-v4-interface", + "solana-log-collector", + "solana-measure", + "solana-packet", + "solana-poseidon", + "solana-program-entrypoint", + "solana-program-runtime", + "solana-pubkey", + "solana-sbpf", + "solana-sdk-ids", + "solana-secp256k1-recover", + "solana-sha256-hasher", + "solana-stable-layout", + "solana-svm-feature-set", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", + "solana-timings", + "solana-transaction-context", + "solana-type-overrides", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-builtins" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d61a31b63b52b0d268cbcd56c76f50314867d7f8e07a0f2c62ee7c9886e07b2" +dependencies = [ + "agave-feature-set", + "solana-bpf-loader-program", + "solana-compute-budget-program", + "solana-hash", + "solana-loader-v4-program", + "solana-program-runtime", + "solana-pubkey", + "solana-sdk-ids", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", + "solana-zk-elgamal-proof-program", + "solana-zk-token-proof-program", +] + +[[package]] +name = "solana-builtins-default-costs" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca69a299a6c969b18ea381a02b40c9e4dda04b2af0d15a007c1184c82163bbb" +dependencies = [ + "agave-feature-set", + "ahash", + "log", + "solana-bpf-loader-program", + "solana-compute-budget-program", + "solana-loader-v4-program", + "solana-pubkey", + "solana-sdk-ids", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", +] + +[[package]] +name = "solana-client-traits" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83f0071874e629f29e0eb3dab8a863e98502ac7aba55b7e0df1803fc5cac72a7" +dependencies = [ + "solana-account", + "solana-commitment-config", + "solana-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-pubkey", + "solana-signature", + "solana-signer", + "solana-system-interface", + "solana-transaction", + "solana-transaction-error", +] + +[[package]] +name = "solana-clock" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb482ab70fced82ad3d7d3d87be33d466a3498eb8aa856434ff3c0dfc2e2e31" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-cluster-type" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ace9fea2daa28354d107ea879cff107181d85cd4e0f78a2bedb10e1a428c97e" +dependencies = [ + "serde", + "serde_derive", + "solana-hash", +] + +[[package]] +name = "solana-commitment-config" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac49c4dde3edfa832de1697e9bcdb7c3b3f7cb7a1981b7c62526c8bb6700fb73" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "solana-compute-budget" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f4fc63bc2276a1618ca0bfc609da7448534ecb43a1cb387cdf9eaa2dc7bc272" +dependencies = [ + "solana-fee-structure", + "solana-program-runtime", +] + +[[package]] +name = "solana-compute-budget-instruction" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "503d94430f6d3c5ac1e1fa6a342c1c714d5b03c800999e7b6cf235298f0b5341" +dependencies = [ + "agave-feature-set", + "log", + "solana-borsh", + "solana-builtins-default-costs", + "solana-compute-budget", + "solana-compute-budget-interface", + "solana-instruction", + "solana-packet", + "solana-pubkey", + "solana-sdk-ids", + "solana-svm-transaction", + "solana-transaction-error", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-compute-budget-interface" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8432d2c4c22d0499aa06d62e4f7e333f81777b3d7c96050ae9e5cb71a8c3aee4" +dependencies = [ + "borsh 1.6.0", + "serde", + "serde_derive", + "solana-instruction", + "solana-sdk-ids", +] + +[[package]] +name = "solana-compute-budget-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "072b02beed1862c6b7b7a8a699379594c4470a9371c711856a0a3c266dcf57e5" +dependencies = [ + "solana-program-runtime", +] + +[[package]] +name = "solana-config-program-client" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53aceac36f105fd4922e29b4f0c1f785b69d7b3e7e387e384b8985c8e0c3595e" +dependencies = [ + "bincode", + "borsh 0.10.4", + "kaigan", + "serde", + "solana-program", +] + +[[package]] +name = "solana-cpi" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc71126edddc2ba014622fc32d0f5e2e78ec6c5a1e0eb511b85618c09e9ea11" +dependencies = [ + "solana-account-info", + "solana-define-syscall", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-stable-layout", +] + +[[package]] +name = "solana-curve25519" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae4261b9a8613d10e77ac831a8fa60b6fa52b9b103df46d641deff9f9812a23" +dependencies = [ + "bytemuck", + "bytemuck_derive", + "curve25519-dalek 4.1.3", + "solana-define-syscall", + "subtle", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-decode-error" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c781686a18db2f942e70913f7ca15dc120ec38dcab42ff7557db2c70c625a35" +dependencies = [ + "num-traits", +] + +[[package]] +name = "solana-define-syscall" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ae3e2abcf541c8122eafe9a625d4d194b4023c20adde1e251f94e056bb1aee2" + +[[package]] +name = "solana-derivation-path" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939756d798b25c5ec3cca10e06212bdca3b1443cb9bb740a38124f58b258737b" +dependencies = [ + "derivation-path", + "qstring", + "uriparse", +] + +[[package]] +name = "solana-ed25519-program" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1feafa1691ea3ae588f99056f4bdd1293212c7ece28243d7da257c443e84753" +dependencies = [ + "bytemuck", + "bytemuck_derive", + "ed25519-dalek", + "solana-feature-set", + "solana-instruction", + "solana-precompile-error", + "solana-sdk-ids", +] + +[[package]] +name = "solana-epoch-info" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ef6f0b449290b0b9f32973eefd95af35b01c5c0c34c569f936c34c5b20d77b" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "solana-epoch-rewards" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b575d3dd323b9ea10bb6fe89bf6bf93e249b215ba8ed7f68f1a3633f384db7" +dependencies = [ + "serde", + "serde_derive", + "solana-hash", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-epoch-rewards-hasher" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c5fd2662ae7574810904585fd443545ed2b568dbd304b25a31e79ccc76e81b" +dependencies = [ + "siphasher", + "solana-hash", + "solana-pubkey", +] + +[[package]] +name = "solana-epoch-schedule" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fce071fbddecc55d727b1d7ed16a629afe4f6e4c217bc8d00af3b785f6f67ed" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-example-mocks" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84461d56cbb8bb8d539347151e0525b53910102e4bced875d49d5139708e39d3" +dependencies = [ + "serde", + "serde_derive", + "solana-address-lookup-table-interface", + "solana-clock", + "solana-hash", + "solana-instruction", + "solana-keccak-hasher", + "solana-message", + "solana-nonce", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-feature-gate-interface" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f5c5382b449e8e4e3016fb05e418c53d57782d8b5c30aa372fc265654b956d" +dependencies = [ + "bincode", + "serde", + "serde_derive", + "solana-account", + "solana-account-info", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-system-interface", +] + +[[package]] +name = "solana-feature-set" +version = "2.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93b93971e289d6425f88e6e3cb6668c4b05df78b3c518c249be55ced8efd6b6d" +dependencies = [ + "ahash", + "lazy_static", + "solana-epoch-schedule", + "solana-hash", + "solana-pubkey", + "solana-sha256-hasher", +] + +[[package]] +name = "solana-fee" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16beda37597046b1edd1cea6fa7caaed033c091f99ec783fe59c82828bc2adb8" +dependencies = [ + "agave-feature-set", + "solana-fee-structure", + "solana-svm-transaction", +] + +[[package]] +name = "solana-fee-calculator" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89bc408da0fb3812bc3008189d148b4d3e08252c79ad810b245482a3f70cd8d" +dependencies = [ + "log", + "serde", + "serde_derive", +] + +[[package]] +name = "solana-fee-structure" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33adf673581c38e810bf618f745bf31b683a0a4a4377682e6aaac5d9a058dd4e" +dependencies = [ + "serde", + "serde_derive", + "solana-message", + "solana-native-token 2.3.0", +] + +[[package]] +name = "solana-genesis-config" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3725085d47b96d37fef07a29d78d2787fc89a0b9004c66eed7753d1e554989f" +dependencies = [ + "bincode", + "chrono", + "memmap2", + "serde", + "serde_derive", + "solana-account", + "solana-clock", + "solana-cluster-type", + "solana-epoch-schedule", + "solana-fee-calculator", + "solana-hash", + "solana-inflation", + "solana-keypair", + "solana-logger", + "solana-poh-config", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-sha256-hasher", + "solana-shred-version", + "solana-signer", + "solana-time-utils", +] + +[[package]] +name = "solana-hard-forks" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c28371f878e2ead55611d8ba1b5fb879847156d04edea13693700ad1a28baf" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "solana-hash" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b96e9f0300fa287b545613f007dfe20043d7812bee255f418c1eb649c93b63" +dependencies = [ + "borsh 1.6.0", + "bytemuck", + "bytemuck_derive", + "five8", + "js-sys", + "serde", + "serde_derive", + "solana-atomic-u64", + "solana-sanitize", + "wasm-bindgen", +] + +[[package]] +name = "solana-inflation" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23eef6a09eb8e568ce6839573e4966850e85e9ce71e6ae1a6c930c1c43947de3" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "solana-instruction" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab5682934bd1f65f8d2c16f21cb532526fcc1a09f796e2cacdb091eee5774ad" +dependencies = [ + "bincode", + "borsh 1.6.0", + "getrandom 0.2.17", + "js-sys", + "num-traits", + "serde", + "serde_derive", + "serde_json", + "solana-define-syscall", + "solana-pubkey", + "wasm-bindgen", +] + +[[package]] +name = "solana-instructions-sysvar" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0e85a6fad5c2d0c4f5b91d34b8ca47118fc593af706e523cdbedf846a954f57" +dependencies = [ + "bitflags 2.10.0", + "solana-account-info", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", + "solana-serialize-utils", + "solana-sysvar-id", +] + +[[package]] +name = "solana-keccak-hasher" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7aeb957fbd42a451b99235df4942d96db7ef678e8d5061ef34c9b34cae12f79" +dependencies = [ + "sha3", + "solana-define-syscall", + "solana-hash", + "solana-sanitize", +] + +[[package]] +name = "solana-keypair" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd3f04aa1a05c535e93e121a95f66e7dcccf57e007282e8255535d24bf1e98bb" +dependencies = [ + "ed25519-dalek", + "ed25519-dalek-bip32", + "five8", + "rand 0.7.3", + "solana-derivation-path", + "solana-pubkey", + "solana-seed-derivable", + "solana-seed-phrase", + "solana-signature", + "solana-signer", + "wasm-bindgen", +] + +[[package]] +name = "solana-last-restart-slot" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6360ac2fdc72e7463565cd256eedcf10d7ef0c28a1249d261ec168c1b55cdd" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-loader-v2-interface" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ab08006dad78ae7cd30df8eea0539e207d08d91eaefb3e1d49a446e1c49654" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", +] + +[[package]] +name = "solana-loader-v3-interface" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f7162a05b8b0773156b443bccd674ea78bb9aa406325b467ea78c06c99a63a2" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", +] + +[[package]] +name = "solana-loader-v4-interface" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "706a777242f1f39a83e2a96a2a6cb034cb41169c6ecbee2cf09cb873d9659e7e" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", +] + +[[package]] +name = "solana-loader-v4-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ab01855d851fa2fb6034b0d48de33d77d5c5f5fb4b0353d8e4a934cc03d48a" +dependencies = [ + "log", + "qualifier_attr", + "solana-account", + "solana-bincode", + "solana-bpf-loader-program", + "solana-instruction", + "solana-loader-v3-interface", + "solana-loader-v4-interface", + "solana-log-collector", + "solana-measure", + "solana-packet", + "solana-program-runtime", + "solana-pubkey", + "solana-sbpf", + "solana-sdk-ids", + "solana-transaction-context", + "solana-type-overrides", +] + +[[package]] +name = "solana-log-collector" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d945b1cf5bf7cbd6f5b78795beda7376370c827640df43bb2a1c17b492dc106" +dependencies = [ + "log", +] + +[[package]] +name = "solana-logger" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8e777ec1afd733939b532a42492d888ec7c88d8b4127a5d867eb45c6eb5cd5" +dependencies = [ + "env_logger", + "lazy_static", + "libc", + "log", + "signal-hook", +] + +[[package]] +name = "solana-measure" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11dcd67cd2ae6065e494b64e861e0498d046d95a61cbbf1ae3d58be1ea0f42ed" + +[[package]] +name = "solana-message" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1796aabce376ff74bf89b78d268fa5e683d7d7a96a0a4e4813ec34de49d5314b" +dependencies = [ + "bincode", + "blake3", + "lazy_static", + "serde", + "serde_derive", + "solana-bincode", + "solana-hash", + "solana-instruction", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", + "solana-short-vec", + "solana-system-interface", + "solana-transaction-error", + "wasm-bindgen", +] + +[[package]] +name = "solana-metrics" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0375159d8460f423d39e5103dcff6e07796a5ec1850ee1fcfacfd2482a8f34b5" +dependencies = [ + "crossbeam-channel", + "gethostname", + "log", + "reqwest 0.12.28", + "solana-cluster-type", + "solana-sha256-hasher", + "solana-time-utils", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-msg" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36a1a14399afaabc2781a1db09cb14ee4cc4ee5c7a5a3cfcc601811379a8092" +dependencies = [ + "solana-define-syscall", +] + +[[package]] +name = "solana-native-token" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61515b880c36974053dd499c0510066783f0cc6ac17def0c7ef2a244874cf4a9" + +[[package]] +name = "solana-native-token" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8dd4c280dca9d046139eb5b7a5ac9ad10403fbd64964c7d7571214950d758f" + +[[package]] +name = "solana-nonce" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703e22eb185537e06204a5bd9d509b948f0066f2d1d814a6f475dafb3ddf1325" +dependencies = [ + "serde", + "serde_derive", + "solana-fee-calculator", + "solana-hash", + "solana-pubkey", + "solana-sha256-hasher", +] + +[[package]] +name = "solana-nonce-account" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde971a20b8dbf60144d6a84439dda86b5466e00e2843091fe731083cda614da" +dependencies = [ + "solana-account", + "solana-hash", + "solana-nonce", + "solana-sdk-ids", +] + +[[package]] +name = "solana-nostd-keccak" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ced70920435b1baa58f76e6f84bbc1110ddd1d6161ec76b6d731ae8431e9c4" +dependencies = [ + "sha3", +] + +[[package]] +name = "solana-offchain-message" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b526398ade5dea37f1f147ce55dae49aa017a5d7326606359b0445ca8d946581" +dependencies = [ + "num_enum", + "solana-hash", + "solana-packet", + "solana-pubkey", + "solana-sanitize", + "solana-sha256-hasher", + "solana-signature", + "solana-signer", +] + +[[package]] +name = "solana-packet" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "004f2d2daf407b3ec1a1ca5ec34b3ccdfd6866dd2d3c7d0715004a96e4b6d127" +dependencies = [ + "bincode", + "bitflags 2.10.0", + "cfg_eval", + "serde", + "serde_derive", + "serde_with", +] + +[[package]] +name = "solana-poh-config" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d650c3b4b9060082ac6b0efbbb66865089c58405bfb45de449f3f2b91eccee75" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "solana-poseidon" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbac4eb90016eeb1d37fa36e592d3a64421510c49666f81020736611c319faff" +dependencies = [ + "ark-bn254 0.4.0", + "light-poseidon 0.2.0", + "solana-define-syscall", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-precompile-error" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d87b2c1f5de77dfe2b175ee8dd318d196aaca4d0f66f02842f80c852811f9f8" +dependencies = [ + "num-traits", + "solana-decode-error", +] + +[[package]] +name = "solana-precompiles" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36e92768a57c652edb0f5d1b30a7d0bc64192139c517967c18600debe9ae3832" +dependencies = [ + "lazy_static", + "solana-ed25519-program", + "solana-feature-set", + "solana-message", + "solana-precompile-error", + "solana-pubkey", + "solana-sdk-ids", + "solana-secp256k1-program", + "solana-secp256r1-program", +] + +[[package]] +name = "solana-presigner" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81a57a24e6a4125fc69510b6774cd93402b943191b6cddad05de7281491c90fe" +dependencies = [ + "solana-pubkey", + "solana-signature", + "solana-signer", +] + +[[package]] +name = "solana-program" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98eca145bd3545e2fbb07166e895370576e47a00a7d824e325390d33bf467210" +dependencies = [ + "bincode", + "blake3", + "borsh 0.10.4", + "borsh 1.6.0", + "bs58", + "bytemuck", + "console_error_panic_hook", + "console_log", + "getrandom 0.2.17", + "lazy_static", + "log", + "memoffset", + "num-bigint 0.4.6", + "num-derive", + "num-traits", + "rand 0.8.5", + "serde", + "serde_bytes", + "serde_derive", + "solana-account-info", + "solana-address-lookup-table-interface", + "solana-atomic-u64", + "solana-big-mod-exp", + "solana-bincode", + "solana-blake3-hasher", + "solana-borsh", + "solana-clock", + "solana-cpi", + "solana-decode-error", + "solana-define-syscall", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-example-mocks", + "solana-feature-gate-interface", + "solana-fee-calculator", + "solana-hash", + "solana-instruction", + "solana-instructions-sysvar", + "solana-keccak-hasher", + "solana-last-restart-slot", + "solana-loader-v2-interface", + "solana-loader-v3-interface", + "solana-loader-v4-interface", + "solana-message", + "solana-msg", + "solana-native-token 2.3.0", + "solana-nonce", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-sanitize", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-secp256k1-recover", + "solana-serde-varint", + "solana-serialize-utils", + "solana-sha256-hasher", + "solana-short-vec", + "solana-slot-hashes", + "solana-slot-history", + "solana-stable-layout", + "solana-stake-interface", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", + "solana-vote-interface", + "thiserror 2.0.17", + "wasm-bindgen", +] + +[[package]] +name = "solana-program-entrypoint" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ce041b1a0ed275290a5008ee1a4a6c48f5054c8a3d78d313c08958a06aedbd" +dependencies = [ + "solana-account-info", + "solana-msg", + "solana-program-error", + "solana-pubkey", +] + +[[package]] +name = "solana-program-error" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee2e0217d642e2ea4bee237f37bd61bb02aec60da3647c48ff88f6556ade775" +dependencies = [ + "borsh 1.6.0", + "num-traits", + "serde", + "serde_derive", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-pubkey", +] + +[[package]] +name = "solana-program-memory" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a5426090c6f3fd6cfdc10685322fede9ca8e5af43cd6a59e98bfe4e91671712" +dependencies = [ + "solana-define-syscall", +] + +[[package]] +name = "solana-program-option" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc677a2e9bc616eda6dbdab834d463372b92848b2bfe4a1ed4e4b4adba3397d0" + +[[package]] +name = "solana-program-pack" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "319f0ef15e6e12dc37c597faccb7d62525a509fec5f6975ecb9419efddeb277b" +dependencies = [ + "solana-program-error", +] + +[[package]] +name = "solana-program-runtime" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5653001e07b657c9de6f0417cf9add1cf4325903732c480d415655e10cc86704" +dependencies = [ + "base64 0.22.1", + "bincode", + "enum-iterator", + "itertools 0.12.1", + "log", + "percentage", + "rand 0.8.5", + "serde", + "solana-account", + "solana-clock", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-fee-structure", + "solana-hash", + "solana-instruction", + "solana-last-restart-slot", + "solana-log-collector", + "solana-measure", + "solana-metrics", + "solana-program-entrypoint", + "solana-pubkey", + "solana-rent", + "solana-sbpf", + "solana-sdk-ids", + "solana-slot-hashes", + "solana-stable-layout", + "solana-svm-callback", + "solana-svm-feature-set", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", + "solana-timings", + "solana-transaction-context", + "solana-type-overrides", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-pubkey" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b62adb9c3261a052ca1f999398c388f1daf558a1b492f60a6d9e64857db4ff1" +dependencies = [ + "borsh 0.10.4", + "borsh 1.6.0", + "bytemuck", + "bytemuck_derive", + "curve25519-dalek 4.1.3", + "five8", + "five8_const", + "getrandom 0.2.17", + "js-sys", + "num-traits", + "rand 0.8.5", + "serde", + "serde_derive", + "solana-atomic-u64", + "solana-decode-error", + "solana-define-syscall", + "solana-sanitize", + "solana-sha256-hasher", + "wasm-bindgen", +] + +[[package]] +name = "solana-quic-definitions" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf0d4d5b049eb1d0c35f7b18f305a27c8986fc5c0c9b383e97adaa35334379e" +dependencies = [ + "solana-keypair", +] + +[[package]] +name = "solana-rent" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1aea8fdea9de98ca6e8c2da5827707fb3842833521b528a713810ca685d2480" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-rent-collector" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "127e6dfa51e8c8ae3aa646d8b2672bc4ac901972a338a9e1cd249e030564fb9d" +dependencies = [ + "serde", + "serde_derive", + "solana-account", + "solana-clock", + "solana-epoch-schedule", + "solana-genesis-config", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", +] + +[[package]] +name = "solana-rent-debits" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f6f9113c6003492e74438d1288e30cffa8ccfdc2ef7b49b9e816d8034da18cd" +dependencies = [ + "solana-pubkey", + "solana-reward-info", +] + +[[package]] +name = "solana-reserved-account-keys" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4b22ea19ca2a3f28af7cd047c914abf833486bf7a7c4a10fc652fff09b385b1" +dependencies = [ + "lazy_static", + "solana-feature-set", + "solana-pubkey", + "solana-sdk-ids", +] + +[[package]] +name = "solana-reward-info" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18205b69139b1ae0ab8f6e11cdcb627328c0814422ad2482000fa2ca54ae4a2f" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "solana-rpc-client" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8d3161ac0918178e674c1f7f1bfac40de3e7ed0383bd65747d63113c156eaeb" +dependencies = [ + "async-trait", + "base64 0.22.1", + "bincode", + "bs58", + "futures", + "indicatif", + "log", + "reqwest 0.12.28", + "reqwest-middleware", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account", + "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-epoch-info", + "solana-epoch-schedule", + "solana-feature-gate-interface", + "solana-hash", + "solana-instruction", + "solana-message", + "solana-pubkey", + "solana-rpc-client-api", + "solana-signature", + "solana-transaction", + "solana-transaction-error", + "solana-transaction-status-client-types", + "solana-version", + "solana-vote-interface", + "tokio", +] + +[[package]] +name = "solana-rpc-client-api" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dbc138685c79d88a766a8fd825057a74ea7a21e1dd7f8de275ada899540fff7" +dependencies = [ + "anyhow", + "jsonrpc-core", + "reqwest 0.12.28", + "reqwest-middleware", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder-client-types", + "solana-clock", + "solana-rpc-client-types", + "solana-signer", + "solana-transaction-error", + "solana-transaction-status-client-types", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-rpc-client-types" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea428a81729255d895ea47fba9b30fd4dacbfe571a080448121bd0592751676" +dependencies = [ + "base64 0.22.1", + "bs58", + "semver", + "serde", + "serde_derive", + "serde_json", + "solana-account", + "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-fee-calculator", + "solana-inflation", + "solana-pubkey", + "solana-transaction-error", + "solana-transaction-status-client-types", + "solana-version", + "spl-generic-token", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-sanitize" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61f1bc1357b8188d9c4a3af3fc55276e56987265eb7ad073ae6f8180ee54cecf" + +[[package]] +name = "solana-sbpf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "474a2d95dc819898ded08d24f29642d02189d3e1497bbb442a92a3997b7eb55f" +dependencies = [ + "byteorder", + "combine", + "hash32", + "libc", + "log", + "rand 0.8.5", + "rustc-demangle", + "thiserror 2.0.17", + "winapi", +] + +[[package]] +name = "solana-sdk" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc0e4a7635b902791c44b6581bfb82f3ada32c5bc0929a64f39fe4bb384c86a" +dependencies = [ + "bincode", + "bs58", + "getrandom 0.1.16", + "js-sys", + "serde", + "serde_json", + "solana-account", + "solana-bn254", + "solana-client-traits", + "solana-cluster-type", + "solana-commitment-config", + "solana-compute-budget-interface", + "solana-decode-error", + "solana-derivation-path", + "solana-ed25519-program", + "solana-epoch-info", + "solana-epoch-rewards-hasher", + "solana-feature-set", + "solana-fee-structure", + "solana-genesis-config", + "solana-hard-forks", + "solana-inflation", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-native-token 2.3.0", + "solana-nonce-account", + "solana-offchain-message", + "solana-packet", + "solana-poh-config", + "solana-precompile-error", + "solana-precompiles", + "solana-presigner", + "solana-program", + "solana-program-memory", + "solana-pubkey", + "solana-quic-definitions", + "solana-rent-collector", + "solana-rent-debits", + "solana-reserved-account-keys", + "solana-reward-info", + "solana-sanitize", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-secp256k1-program", + "solana-secp256k1-recover", + "solana-secp256r1-program", + "solana-seed-derivable", + "solana-seed-phrase", + "solana-serde", + "solana-serde-varint", + "solana-short-vec", + "solana-shred-version", + "solana-signature", + "solana-signer", + "solana-system-transaction", + "solana-time-utils", + "solana-transaction", + "solana-transaction-context", + "solana-transaction-error", + "solana-validator-exit", + "thiserror 2.0.17", + "wasm-bindgen", +] + +[[package]] +name = "solana-sdk-ids" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5d8b9cc68d5c88b062a33e23a6466722467dde0035152d8fb1afbcdf350a5f" +dependencies = [ + "solana-pubkey", +] + +[[package]] +name = "solana-sdk-macro" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86280da8b99d03560f6ab5aca9de2e38805681df34e0bb8f238e69b29433b9df" +dependencies = [ + "bs58", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "solana-secp256k1-program" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f19833e4bc21558fe9ec61f239553abe7d05224347b57d65c2218aeeb82d6149" +dependencies = [ + "bincode", + "digest 0.10.7", + "libsecp256k1", + "serde", + "serde_derive", + "sha3", + "solana-feature-set", + "solana-instruction", + "solana-precompile-error", + "solana-sdk-ids", + "solana-signature", +] + +[[package]] +name = "solana-secp256k1-recover" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa3120b6cdaa270f39444f5093a90a7b03d296d362878f7a6991d6de3bbe496" +dependencies = [ + "borsh 1.6.0", + "libsecp256k1", + "solana-define-syscall", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-secp256r1-program" +version = "2.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce0ae46da3071a900f02d367d99b2f3058fe2e90c5062ac50c4f20cfedad8f0f" +dependencies = [ + "bytemuck", + "openssl", + "solana-feature-set", + "solana-instruction", + "solana-precompile-error", + "solana-sdk-ids", +] + +[[package]] +name = "solana-security-txt" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "156bb61a96c605fa124e052d630dba2f6fb57e08c7d15b757e1e958b3ed7b3fe" +dependencies = [ + "hashbrown 0.15.2", +] + +[[package]] +name = "solana-seed-derivable" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beb82b5adb266c6ea90e5cf3967235644848eac476c5a1f2f9283a143b7c97f" +dependencies = [ + "solana-derivation-path", +] + +[[package]] +name = "solana-seed-phrase" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36187af2324f079f65a675ec22b31c24919cb4ac22c79472e85d819db9bbbc15" +dependencies = [ + "hmac 0.12.1", + "pbkdf2", + "sha2 0.10.9", +] + +[[package]] +name = "solana-serde" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1931484a408af466e14171556a47adaa215953c7f48b24e5f6b0282763818b04" +dependencies = [ + "serde", +] + +[[package]] +name = "solana-serde-varint" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a7e155eba458ecfb0107b98236088c3764a09ddf0201ec29e52a0be40857113" +dependencies = [ + "serde", +] + +[[package]] +name = "solana-serialize-utils" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "817a284b63197d2b27afdba829c5ab34231da4a9b4e763466a003c40ca4f535e" +dependencies = [ + "solana-instruction", + "solana-pubkey", + "solana-sanitize", +] + +[[package]] +name = "solana-sha256-hasher" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa3feb32c28765f6aa1ce8f3feac30936f16c5c3f7eb73d63a5b8f6f8ecdc44" +dependencies = [ + "sha2 0.10.9", + "solana-define-syscall", + "solana-hash", +] + +[[package]] +name = "solana-short-vec" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c54c66f19b9766a56fa0057d060de8378676cb64987533fa088861858fc5a69" +dependencies = [ + "serde", +] + +[[package]] +name = "solana-shred-version" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afd3db0461089d1ad1a78d9ba3f15b563899ca2386351d38428faa5350c60a98" +dependencies = [ + "solana-hard-forks", + "solana-hash", + "solana-sha256-hasher", +] + +[[package]] +name = "solana-signature" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c8ec8e657aecfc187522fc67495142c12f35e55ddeca8698edbb738b8dbd8c" +dependencies = [ + "ed25519-dalek", + "five8", + "rand 0.8.5", + "serde", + "serde-big-array", + "serde_derive", + "solana-sanitize", +] + +[[package]] +name = "solana-signer" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c41991508a4b02f021c1342ba00bcfa098630b213726ceadc7cb032e051975b" +dependencies = [ + "solana-pubkey", + "solana-signature", + "solana-transaction-error", +] + +[[package]] +name = "solana-slot-hashes" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8691982114513763e88d04094c9caa0376b867a29577939011331134c301ce" +dependencies = [ + "serde", + "serde_derive", + "solana-hash", + "solana-sdk-ids", + "solana-sysvar-id", +] + +[[package]] +name = "solana-slot-history" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ccc1b2067ca22754d5283afb2b0126d61eae734fc616d23871b0943b0d935e" +dependencies = [ + "bv", + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sysvar-id", +] + +[[package]] +name = "solana-stable-layout" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f14f7d02af8f2bc1b5efeeae71bc1c2b7f0f65cd75bcc7d8180f2c762a57f54" +dependencies = [ + "solana-instruction", + "solana-pubkey", +] + +[[package]] +name = "solana-stake-interface" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5269e89fde216b4d7e1d1739cf5303f8398a1ff372a81232abbee80e554a838c" +dependencies = [ + "borsh 0.10.4", + "borsh 1.6.0", + "num-traits", + "serde", + "serde_derive", + "solana-clock", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-system-interface", + "solana-sysvar-id", +] + +[[package]] +name = "solana-stake-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500e9b9d11573f12de91e94f9c4459882cd5ffc692776af49b610d6fcc0b167f" +dependencies = [ + "agave-feature-set", + "bincode", + "log", + "solana-account", + "solana-bincode", + "solana-clock", + "solana-config-program-client", + "solana-genesis-config", + "solana-instruction", + "solana-log-collector", + "solana-native-token 2.3.0", + "solana-packet", + "solana-program-runtime", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-stake-interface", + "solana-sysvar", + "solana-transaction-context", + "solana-type-overrides", + "solana-vote-interface", +] + +[[package]] +name = "solana-svm-callback" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cef9f7d5cfb5d375081a6c8ad712a6f0e055a15890081f845acf55d8254a7a2" +dependencies = [ + "solana-account", + "solana-precompile-error", + "solana-pubkey", +] + +[[package]] +name = "solana-svm-feature-set" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f24b836eb4d74ec255217bdbe0f24f64a07adeac31aca61f334f91cd4a3b1d5" + +[[package]] +name = "solana-svm-transaction" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab717b9539375ebb088872c6c87d1d8832d19f30f154ecc530154d23f60a6f0c" +dependencies = [ + "solana-hash", + "solana-message", + "solana-pubkey", + "solana-sdk-ids", + "solana-signature", + "solana-transaction", +] + +[[package]] +name = "solana-system-interface" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94d7c18cb1a91c6be5f5a8ac9276a1d7c737e39a21beba9ea710ab4b9c63bc90" +dependencies = [ + "js-sys", + "num-traits", + "serde", + "serde_derive", + "solana-decode-error", + "solana-instruction", + "solana-pubkey", + "wasm-bindgen", +] + +[[package]] +name = "solana-system-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ca36cef39aea7761be58d4108a56a2e27042fb1e913355fdb142a05fc7eab7" +dependencies = [ + "bincode", + "log", + "serde", + "serde_derive", + "solana-account", + "solana-bincode", + "solana-fee-calculator", + "solana-instruction", + "solana-log-collector", + "solana-nonce", + "solana-nonce-account", + "solana-packet", + "solana-program-runtime", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", + "solana-sysvar", + "solana-transaction-context", + "solana-type-overrides", +] + +[[package]] +name = "solana-system-transaction" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd98a25e5bcba8b6be8bcbb7b84b24c2a6a8178d7fb0e3077a916855ceba91a" +dependencies = [ + "solana-hash", + "solana-keypair", + "solana-message", + "solana-pubkey", + "solana-signer", + "solana-system-interface", + "solana-transaction", +] + +[[package]] +name = "solana-sysvar" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c3595f95069f3d90f275bb9bd235a1973c4d059028b0a7f81baca2703815db" +dependencies = [ + "base64 0.22.1", + "bincode", + "bytemuck", + "bytemuck_derive", + "lazy_static", + "serde", + "serde_derive", + "solana-account-info", + "solana-clock", + "solana-define-syscall", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-fee-calculator", + "solana-hash", + "solana-instruction", + "solana-instructions-sysvar", + "solana-last-restart-slot", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-pubkey", + "solana-rent", + "solana-sanitize", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-slot-hashes", + "solana-slot-history", + "solana-stake-interface", + "solana-sysvar-id", +] + +[[package]] +name = "solana-sysvar-id" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5762b273d3325b047cfda250787f8d796d781746860d5d0a746ee29f3e8812c1" +dependencies = [ + "solana-pubkey", + "solana-sdk-ids", +] + +[[package]] +name = "solana-time-utils" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af261afb0e8c39252a04d026e3ea9c405342b08c871a2ad8aa5448e068c784c" + +[[package]] +name = "solana-timings" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c49b842dfc53c1bf9007eaa6730296dea93b4fce73f457ce1080af43375c0d6" +dependencies = [ + "eager", + "enum-iterator", + "solana-pubkey", +] + +[[package]] +name = "solana-transaction" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80657d6088f721148f5d889c828ca60c7daeedac9a8679f9ec215e0c42bcbf41" +dependencies = [ + "bincode", + "serde", + "serde_derive", + "solana-bincode", + "solana-feature-set", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-precompiles", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", + "solana-short-vec", + "solana-signature", + "solana-signer", + "solana-system-interface", + "solana-transaction-error", + "wasm-bindgen", +] + +[[package]] +name = "solana-transaction-context" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a312304361987a85b2ef2293920558e6612876a639dd1309daf6d0d59ef2fe" +dependencies = [ + "bincode", + "serde", + "serde_derive", + "solana-account", + "solana-instruction", + "solana-instructions-sysvar", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", +] + +[[package]] +name = "solana-transaction-error" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a9dc8fdb61c6088baab34fc3a8b8473a03a7a5fd404ed8dd502fa79b67cb1" +dependencies = [ + "serde", + "serde_derive", + "solana-instruction", + "solana-sanitize", +] + +[[package]] +name = "solana-transaction-status" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135f92f4192cc68900c665becf97fc0a6500ae5a67ff347bf2cbc20ecfefa821" +dependencies = [ + "Inflector", + "agave-reserved-account-keys", + "base64 0.22.1", + "bincode", + "borsh 1.6.0", + "bs58", + "log", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder", + "solana-address-lookup-table-interface", + "solana-clock", + "solana-hash", + "solana-instruction", + "solana-loader-v2-interface", + "solana-loader-v3-interface", + "solana-message", + "solana-program-option", + "solana-pubkey", + "solana-reward-info", + "solana-sdk-ids", + "solana-signature", + "solana-stake-interface", + "solana-system-interface", + "solana-transaction", + "solana-transaction-error", + "solana-transaction-status-client-types", + "solana-vote-interface", + "spl-associated-token-account 7.0.0", + "spl-memo", + "spl-token 8.0.0", + "spl-token-2022 8.0.1", + "spl-token-group-interface 0.6.0", + "spl-token-metadata-interface 0.7.0", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-transaction-status-client-types" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f1d7c2387c35850848212244d2b225847666cb52d3bd59a5c409d2c300303d" +dependencies = [ + "base64 0.22.1", + "bincode", + "bs58", + "serde", + "serde_derive", + "serde_json", + "solana-account-decoder-client-types", + "solana-commitment-config", + "solana-message", + "solana-reward-info", + "solana-signature", + "solana-transaction", + "solana-transaction-context", + "solana-transaction-error", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-type-overrides" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d80c44761eb398a157d809a04840865c347e1831ae3859b6100c0ee457bc1a" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "solana-validator-exit" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bbf6d7a3c0b28dd5335c52c0e9eae49d0ae489a8f324917faf0ded65a812c1d" + +[[package]] +name = "solana-version" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3324d46c7f7b7f5d34bf7dc71a2883bdc072c7b28ca81d0b2167ecec4cf8da9f" +dependencies = [ + "agave-feature-set", + "rand 0.8.5", + "semver", + "serde", + "serde_derive", + "solana-sanitize", + "solana-serde-varint", +] + +[[package]] +name = "solana-vote-interface" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b80d57478d6599d30acc31cc5ae7f93ec2361a06aefe8ea79bc81739a08af4c3" +dependencies = [ + "bincode", + "num-derive", + "num-traits", + "serde", + "serde_derive", + "solana-clock", + "solana-decode-error", + "solana-hash", + "solana-instruction", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-serde-varint", + "solana-serialize-utils", + "solana-short-vec", + "solana-system-interface", +] + +[[package]] +name = "solana-vote-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "908d0e72c8b83e48762eb3e8c9114497cf4b1d66e506e360c46aba9308e71299" +dependencies = [ + "agave-feature-set", + "bincode", + "log", + "num-derive", + "num-traits", + "serde", + "serde_derive", + "solana-account", + "solana-bincode", + "solana-clock", + "solana-epoch-schedule", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-metrics", + "solana-packet", + "solana-program-runtime", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-signer", + "solana-slot-hashes", + "solana-transaction", + "solana-transaction-context", + "solana-vote-interface", + "thiserror 2.0.17", +] + +[[package]] +name = "solana-zk-elgamal-proof-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70cea14481d8efede6b115a2581f27bc7c6fdfba0752c20398456c3ac1245fc4" +dependencies = [ + "agave-feature-set", + "bytemuck", + "num-derive", + "num-traits", + "solana-instruction", + "solana-log-collector", + "solana-program-runtime", + "solana-sdk-ids", + "solana-zk-sdk", +] + +[[package]] +name = "solana-zk-sdk" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b9fc6ec37d16d0dccff708ed1dd6ea9ba61796700c3bb7c3b401973f10f63b" +dependencies = [ + "aes-gcm-siv", + "base64 0.22.1", + "bincode", + "bytemuck", + "bytemuck_derive", + "curve25519-dalek 4.1.3", + "itertools 0.12.1", + "js-sys", + "merlin", + "num-derive", + "num-traits", + "rand 0.8.5", + "serde", + "serde_derive", + "serde_json", + "sha3", + "solana-derivation-path", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-seed-derivable", + "solana-seed-phrase", + "solana-signature", + "solana-signer", + "subtle", + "thiserror 2.0.17", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "solana-zk-token-proof-program" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579752ad6ea2a671995f13c763bf28288c3c895cb857a518cc4ebab93c9a8dde" +dependencies = [ + "agave-feature-set", + "bytemuck", + "num-derive", + "num-traits", + "solana-instruction", + "solana-log-collector", + "solana-program-runtime", + "solana-sdk-ids", + "solana-zk-token-sdk", +] + +[[package]] +name = "solana-zk-token-sdk" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5055e5df94abd5badf4f947681c893375bdb6f8f543c05d2a7ab9647a6a9d205" +dependencies = [ + "aes-gcm-siv", + "base64 0.22.1", + "bincode", + "bytemuck", + "bytemuck_derive", + "curve25519-dalek 4.1.3", + "itertools 0.12.1", + "merlin", + "num-derive", + "num-traits", + "rand 0.8.5", + "serde", + "serde_derive", + "serde_json", + "sha3", + "solana-curve25519", + "solana-derivation-path", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-seed-derivable", + "solana-seed-phrase", + "solana-signature", + "solana-signer", + "subtle", + "thiserror 2.0.17", + "zeroize", +] + +[[package]] +name = "spl-associated-token-account" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76fee7d65013667032d499adc3c895e286197a35a0d3a4643c80e7fd3e9969e3" +dependencies = [ + "borsh 1.6.0", + "num-derive", + "num-traits", + "solana-program", + "spl-associated-token-account-client", + "spl-token 7.0.0", + "spl-token-2022 6.0.0", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-associated-token-account" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae179d4a26b3c7a20c839898e6aed84cb4477adf108a366c95532f058aea041b" +dependencies = [ + "borsh 1.6.0", + "num-derive", + "num-traits", + "solana-program", + "spl-associated-token-account-client", + "spl-token 8.0.0", + "spl-token-2022 8.0.1", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-associated-token-account-client" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f8349dbcbe575f354f9a533a21f272f3eb3808a49e2fdc1c34393b88ba76cb" +dependencies = [ + "solana-instruction", + "solana-pubkey", +] + +[[package]] +name = "spl-discriminator" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7398da23554a31660f17718164e31d31900956054f54f52d5ec1be51cb4f4b3" +dependencies = [ + "bytemuck", + "solana-program-error", + "solana-sha256-hasher", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" +dependencies = [ + "quote", + "spl-discriminator-syn", + "syn 2.0.114", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d1dbc82ab91422345b6df40a79e2b78c7bce1ebb366da323572dd60b7076b67" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.9", + "syn 2.0.114", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-elgamal-registry" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce0f668975d2b0536e8a8fd60e56a05c467f06021dae037f1d0cfed0de2e231d" +dependencies = [ + "bytemuck", + "solana-program", + "solana-zk-sdk", + "spl-pod", + "spl-token-confidential-transfer-proof-extraction 0.2.1", +] + +[[package]] +name = "spl-elgamal-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65edfeed09cd4231e595616aa96022214f9c9d2be02dea62c2b30d5695a6833a" +dependencies = [ + "bytemuck", + "solana-account-info", + "solana-cpi", + "solana-instruction", + "solana-msg", + "solana-program-entrypoint", + "solana-program-error", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-system-interface", + "solana-sysvar", + "solana-zk-sdk", + "spl-pod", + "spl-token-confidential-transfer-proof-extraction 0.3.0", +] + +[[package]] +name = "spl-generic-token" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "741a62a566d97c58d33f9ed32337ceedd4e35109a686e31b1866c5dfa56abddc" +dependencies = [ + "bytemuck", + "solana-pubkey", +] + +[[package]] +name = "spl-memo" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f09647c0974e33366efeb83b8e2daebb329f0420149e74d3a4bd2c08cf9f7cb" +dependencies = [ + "solana-account-info", + "solana-instruction", + "solana-msg", + "solana-program-entrypoint", + "solana-program-error", + "solana-pubkey", +] + +[[package]] +name = "spl-pod" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d994afaf86b779104b4a95ba9ca75b8ced3fdb17ee934e38cb69e72afbe17799" +dependencies = [ + "borsh 1.6.0", + "bytemuck", + "bytemuck_derive", + "num-derive", + "num-traits", + "solana-decode-error", + "solana-msg", + "solana-program-error", + "solana-program-option", + "solana-pubkey", + "solana-zk-sdk", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-program-error" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d39b5186f42b2b50168029d81e58e800b690877ef0b30580d107659250da1d1" +dependencies = [ + "num-derive", + "num-traits", + "solana-program", + "spl-program-error-derive 0.4.1", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-program-error" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdebc8b42553070b75aa5106f071fef2eb798c64a7ec63375da4b1f058688c6" +dependencies = [ + "num-derive", + "num-traits", + "solana-decode-error", + "solana-msg", + "solana-program-error", + "spl-program-error-derive 0.5.0", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d375dd76c517836353e093c2dbb490938ff72821ab568b545fd30ab3256b3e" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.9", + "syn 2.0.114", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2539e259c66910d78593475540e8072f0b10f0f61d7607bbf7593899ed52d0" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.9", + "syn 2.0.114", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd99ff1e9ed2ab86e3fd582850d47a739fec1be9f4661cba1782d3a0f26805f3" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-program-error 0.6.0", + "spl-type-length-value 0.7.0", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1408e961215688715d5a1063cbdcf982de225c45f99c82b4f7d7e1dd22b998d7" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-program-error 0.7.0", + "spl-type-length-value 0.8.0", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed320a6c934128d4f7e54fe00e16b8aeaecf215799d060ae14f93378da6dc834" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-token" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053067c6a82c705004f91dae058b11b4780407e9ccd6799dc9e7d0fab5f242da" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-account-info", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-sysvar", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-2022" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b27f7405010ef816587c944536b0eafbcc35206ab6ba0f2ca79f1d28e488f4f" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "solana-security-txt", + "solana-zk-sdk", + "spl-elgamal-registry 0.1.1", + "spl-memo", + "spl-pod", + "spl-token 7.0.0", + "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1", + "spl-token-confidential-transfer-proof-extraction 0.2.1", + "spl-token-confidential-transfer-proof-generation 0.2.0", + "spl-token-group-interface 0.5.0", + "spl-token-metadata-interface 0.6.0", + "spl-transfer-hook-interface 0.9.0", + "spl-type-length-value 0.7.0", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-token-2022" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9048b26b0df0290f929ff91317c83db28b3ef99af2b3493dd35baa146774924c" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "solana-security-txt", + "solana-zk-sdk", + "spl-elgamal-registry 0.1.1", + "spl-memo", + "spl-pod", + "spl-token 7.0.0", + "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1", + "spl-token-confidential-transfer-proof-extraction 0.2.1", + "spl-token-confidential-transfer-proof-generation 0.3.0", + "spl-token-group-interface 0.5.0", + "spl-token-metadata-interface 0.6.0", + "spl-transfer-hook-interface 0.9.0", + "spl-type-length-value 0.7.0", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-2022" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f0dfbb079eebaee55e793e92ca5f433744f4b71ee04880bfd6beefba5973e5" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-account-info", + "solana-clock", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-native-token 2.3.0", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-security-txt", + "solana-system-interface", + "solana-sysvar", + "solana-zk-sdk", + "spl-elgamal-registry 0.2.0", + "spl-memo", + "spl-pod", + "spl-token 8.0.0", + "spl-token-confidential-transfer-ciphertext-arithmetic 0.3.1", + "spl-token-confidential-transfer-proof-extraction 0.3.0", + "spl-token-confidential-transfer-proof-generation 0.4.1", + "spl-token-group-interface 0.6.0", + "spl-token-metadata-interface 0.7.0", + "spl-transfer-hook-interface 0.10.0", + "spl-type-length-value 0.8.0", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-2022-interface" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d7ae2ee6b856f8ddcbdc3b3a9f4d2141582bbe150f93e5298ee97e0251fa04" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-account-info", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-sdk-ids", + "solana-zk-sdk", + "spl-pod", + "spl-token-confidential-transfer-proof-extraction 0.4.1", + "spl-token-confidential-transfer-proof-generation 0.4.1", + "spl-token-group-interface 0.6.0", + "spl-token-metadata-interface 0.7.0", + "spl-type-length-value 0.8.0", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-confidential-transfer-ciphertext-arithmetic" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170378693c5516090f6d37ae9bad2b9b6125069be68d9acd4865bbe9fc8499fd" +dependencies = [ + "base64 0.22.1", + "bytemuck", + "solana-curve25519", + "solana-zk-sdk", +] + +[[package]] +name = "spl-token-confidential-transfer-ciphertext-arithmetic" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cddd52bfc0f1c677b41493dafa3f2dbbb4b47cf0990f08905429e19dc8289b35" +dependencies = [ + "base64 0.22.1", + "bytemuck", + "solana-curve25519", + "solana-zk-sdk", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-extraction" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff2d6a445a147c9d6dd77b8301b1e116c8299601794b558eafa409b342faf96" +dependencies = [ + "bytemuck", + "solana-curve25519", + "solana-program", + "solana-zk-sdk", + "spl-pod", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-extraction" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe2629860ff04c17bafa9ba4bed8850a404ecac81074113e1f840dbd0ebb7bd6" +dependencies = [ + "bytemuck", + "solana-account-info", + "solana-curve25519", + "solana-instruction", + "solana-instructions-sysvar", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sdk-ids", + "solana-zk-sdk", + "spl-pod", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-extraction" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512c85bdbbb4cbcc2038849a9e164c958b16541f252b53ea1a3933191c0a4a1a" +dependencies = [ + "bytemuck", + "solana-account-info", + "solana-curve25519", + "solana-instruction", + "solana-instructions-sysvar", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sdk-ids", + "solana-zk-sdk", + "spl-pod", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-generation" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8627184782eec1894de8ea26129c61303f1f0adeed65c20e0b10bc584f09356d" +dependencies = [ + "curve25519-dalek 4.1.3", + "solana-zk-sdk", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-generation" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e3597628b0d2fe94e7900fd17cdb4cfbb31ee35c66f82809d27d86e44b2848b" +dependencies = [ + "curve25519-dalek 4.1.3", + "solana-zk-sdk", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-generation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa27b9174bea869a7ebf31e0be6890bce90b1a4288bc2bbf24bd413f80ae3fde" +dependencies = [ + "curve25519-dalek 4.1.3", + "solana-zk-sdk", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-group-interface" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d595667ed72dbfed8c251708f406d7c2814a3fa6879893b323d56a10bedfc799" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-token-group-interface" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5597b4cd76f85ce7cd206045b7dc22da8c25516573d42d267c8d1fd128db5129" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-token-metadata-interface" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb9c89dbc877abd735f05547dcf9e6e12c00c11d6d74d8817506cab4c99fdbb" +dependencies = [ + "borsh 1.6.0", + "num-derive", + "num-traits", + "solana-borsh", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-type-length-value 0.7.0", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-token-metadata-interface" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304d6e06f0de0c13a621464b1fd5d4b1bebf60d15ca71a44d3839958e0da16ee" +dependencies = [ + "borsh 1.6.0", + "num-derive", + "num-traits", + "solana-borsh", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-type-length-value 0.8.0", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa7503d52107c33c88e845e1351565050362c2314036ddf19a36cd25137c043" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-program-error 0.6.0", + "spl-tlv-account-resolution 0.9.0", + "spl-type-length-value 0.7.0", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e905b849b6aba63bde8c4badac944ebb6c8e6e14817029cbe1bc16829133bd" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-program-error 0.7.0", + "spl-tlv-account-resolution 0.10.0", + "spl-type-length-value 0.8.0", + "thiserror 2.0.17", +] + +[[package]] +name = "spl-type-length-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba70ef09b13af616a4c987797870122863cba03acc4284f226a4473b043923f9" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-decode-error", + "solana-msg", + "solana-program-error", + "spl-discriminator", + "spl-pod", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-type-length-value" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d417eb548214fa822d93f84444024b4e57c13ed6719d4dcc68eec24fb481e9f5" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-decode-error", + "solana-msg", + "solana-program-error", + "spl-discriminator", + "spl-pod", + "thiserror 2.0.17", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[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.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[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 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.10.0", + "core-foundation", + "system-configuration-sys 0.6.0", +] + +[[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 = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tabled" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e39a2ee1fbcd360805a771e1b300f78cc88fec7b8d3e2f71cd37bbf23e725c7d" +dependencies = [ + "papergrid", + "tabled_derive", + "testing_table", +] + +[[package]] +name = "tabled_derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea5d1b13ca6cff1f9231ffd62f15eefd72543dab5e468735f1a456728a02846" +dependencies = [ + "heck 0.5.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tarpc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" +dependencies = [ + "anyhow", + "fnv", + "futures", + "humantime", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "serde", + "static_assertions", + "tarpc-plugins", + "thiserror 1.0.69", + "tokio", + "tokio-serde", + "tokio-util 0.6.10", + "tracing", + "tracing-opentelemetry", +] + +[[package]] +name = "tarpc-plugins" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tempfile" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "testing_table" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f8daae29995a24f65619e19d8d31dea5b389f3d853d8bf297bbf607cd0014cc" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl 2.0.17", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" + +[[package]] +name = "time-macros" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.6.1", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls 0.23.36", + "tokio", +] + +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe 0.4.23", + "futures-core", + "futures-sink", + "pin-project", + "serde", + "serde_json", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "slab", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap 2.13.0", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "async-compression", + "bitflags 2.10.0", + "bytes", + "futures-core", + "futures-util", + "http 1.4.0", + "http-body 1.0.1", + "http-body-util", + "iri-string", + "pin-project-lite", + "tokio", + "tokio-util 0.7.18", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" +dependencies = [ + "getrandom 0.3.4", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +dependencies = [ + "cfg-if", + "futures-util", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.114", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "webpki-roots" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +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 = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "zmij" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea" + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.16+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/program-examples/native/Cargo.toml b/program-examples/native/Cargo.toml new file mode 100644 index 00000000..f977cad3 --- /dev/null +++ b/program-examples/native/Cargo.toml @@ -0,0 +1,18 @@ +[workspace] +members = ["program"] +resolver = "2" + +[workspace.dependencies] +# Pin to match light-protocol Cargo.lock +constant_time_eq = "=0.3.1" +blake3 = "=1.5.5" + +[profile.release] +overflow-checks = true +lto = "fat" +codegen-units = 1 + +[profile.release.build-override] +opt-level = 3 +incremental = false +codegen-units = 1 diff --git a/program-examples/native/README.md b/program-examples/native/README.md new file mode 100644 index 00000000..96e7f9a5 --- /dev/null +++ b/program-examples/native/README.md @@ -0,0 +1,59 @@ +# Light Token Native Programs + +Native Solana program examples that CPI the Light Token Program. + +## Programs + +- **create-mint** - Create a light-token mint via CPI + - [Instruction](program/src/instructions/create_mint.rs) | [Test](program/tests/create_mint.rs) +- **create-ata** - Create an associated light-token account via CPI + - [Instruction](program/src/instructions/create_ata.rs) | [Test](program/tests/create_ata.rs) +- **create-token-account** - Create a light-token account via CPI + - [Instruction](program/src/instructions/create_token_account.rs) | [Test](program/tests/create_token_account.rs) +- **mint-to** - Mint tokens via CPI + - [Instruction](program/src/instructions/mint_to.rs) | [Test](program/tests/mint_to.rs) +- **transfer-interface** - Transfer between light-token, T22, and SPL accounts via CPI + - [Instruction](program/src/instructions/transfer_interface.rs) | [Test](program/tests/transfer.rs) +- **approve** - Approve delegate via CPI + - [Instruction](program/src/instructions/approve.rs) | [Test](program/tests/approve.rs) +- **revoke** - Revoke delegate via CPI + - [Instruction](program/src/instructions/revoke.rs) | [Test](program/tests/revoke.rs) +- **burn** - Burn tokens via CPI + - [Instruction](program/src/instructions/burn.rs) | [Test](program/tests/burn.rs) +- **freeze** - Freeze token account via CPI + - [Instruction](program/src/instructions/freeze.rs) | [Test](program/tests/freeze.rs) +- **thaw** - Thaw token account via CPI + - [Instruction](program/src/instructions/thaw.rs) | [Test](program/tests/thaw.rs) +- **close** - Close token account via CPI + - [Instruction](program/src/instructions/close.rs) | [Test](program/tests/close.rs) + +## Build + +```bash +cargo build-sbf +``` + +## Test + +### Requirements + +- light cli version 0.27.0+ (install via `npm i -g @lightprotocol/zk-compression-cli`) +- solana cli version 2.1.16+ + +### Running tests + +```bash +cargo test-sbf +``` + +## Disclaimer + +This reference implementation is not audited. + +The Light Protocol programs are audited and deployed on Solana devnet and mainnet. + +## Documentation + +Learn more [about Light-Token here](https://www.zkcompression.com/light-token/welcome). + +For your AI to index this repo: [AI Index](CLAUDE.md), [Flow Diagram](flow.mermaid), [State Machine Diagram](states.mermaid) \ No newline at end of file diff --git a/program-examples/native/program/Cargo.toml b/program-examples/native/program/Cargo.toml new file mode 100644 index 00000000..a1655954 --- /dev/null +++ b/program-examples/native/program/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "light-token-cpi" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] + +[features] +no-entrypoint = [] +test-sbf = [] +default = [] + +[dependencies] +light-token = "0.3.0" +light-token-interface = "0.2.0" +solana-program = "2.2" +borsh = "0.10.4" + +[dev-dependencies] +light-program-test = { version = "0.18.0", features = ["v2"] } +light-client = { version = "0.18.0", features = ["v2"] } +light-token-interface = "0.2.0" +tokio = { version = "1", features = ["full"] } +solana-sdk = "2" +anchor-spl = "0.31" +spl-token = "7" +spl-token-2022 = "7" +spl-pod = "0.5" +blake3 = "=1.5.5" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("frozen-abi", "no-entrypoint"))', +] + diff --git a/program-examples/native/program/program-keypair.json b/program-examples/native/program/program-keypair.json new file mode 100644 index 00000000..01413b4a --- /dev/null +++ b/program-examples/native/program/program-keypair.json @@ -0,0 +1 @@ +[98,137,217,164,40,12,54,163,211,144,69,31,15,146,79,109,147,77,230,19,249,138,135,164,193,208,220,17,170,10,68,254,2,235,20,231,113,51,9,96,121,178,130,245,175,252,67,126,190,112,168,40,128,240,73,137,143,106,113,169,66,240,201,209] \ No newline at end of file diff --git a/program-examples/native/program/src/instructions/approve.rs b/program-examples/native/program/src/instructions/approve.rs new file mode 100644 index 00000000..c58e55ff --- /dev/null +++ b/program-examples/native/program/src/instructions/approve.rs @@ -0,0 +1,53 @@ +use super::authority_seeds; +use light_token::instruction::ApproveCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn approve_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [token_account, delegate, owner, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + let amount = u64::from_le_bytes( + data.try_into() + .map_err(|_| ProgramError::InvalidInstructionData)?, + ); + + ApproveCpi { + token_account: token_account.clone(), + delegate: delegate.clone(), + owner: owner.clone(), + system_program: system_program.clone(), + amount, + } + .invoke() +} + +pub fn approve_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [token_account, delegate, owner, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 9 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let bump = data[8]; + let signer_seeds = authority_seeds!(bump); + + ApproveCpi { + token_account: token_account.clone(), + delegate: delegate.clone(), + owner: owner.clone(), + system_program: system_program.clone(), + amount, + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/burn.rs b/program-examples/native/program/src/instructions/burn.rs new file mode 100644 index 00000000..764c1fd8 --- /dev/null +++ b/program-examples/native/program/src/instructions/burn.rs @@ -0,0 +1,49 @@ +use super::authority_seeds; +use light_token::instruction::BurnCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn burn_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [source, mint, authority, _token_program] = accounts else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + let amount = u64::from_le_bytes( + data.try_into() + .map_err(|_| ProgramError::InvalidInstructionData)?, + ); + + BurnCpi { + source: source.clone(), + mint: mint.clone(), + amount, + authority: authority.clone(), + max_top_up: None, + } + .invoke() +} + +pub fn burn_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [source, mint, authority, _token_program] = accounts else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 9 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let bump = data[8]; + let signer_seeds = authority_seeds!(bump); + + BurnCpi { + source: source.clone(), + mint: mint.clone(), + amount, + authority: authority.clone(), + max_top_up: None, + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/close.rs b/program-examples/native/program/src/instructions/close.rs new file mode 100644 index 00000000..2d1770ea --- /dev/null +++ b/program-examples/native/program/src/instructions/close.rs @@ -0,0 +1,45 @@ +use super::authority_seeds; +use light_token::instruction::CloseAccountCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn close_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { + let [token_program, account, destination, owner, rent_sponsor] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + CloseAccountCpi { + token_program: token_program.clone(), + account: account.clone(), + destination: destination.clone(), + owner: owner.clone(), + rent_sponsor: rent_sponsor.clone(), + } + .invoke() +} + +pub fn close_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [token_program, account, destination, owner, rent_sponsor] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.is_empty() { + return Err(ProgramError::InvalidInstructionData); + } + + let bump = data[0]; + let signer_seeds = authority_seeds!(bump); + + CloseAccountCpi { + token_program: token_program.clone(), + account: account.clone(), + destination: destination.clone(), + owner: owner.clone(), + rent_sponsor: rent_sponsor.clone(), + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/create_ata.rs b/program-examples/native/program/src/instructions/create_ata.rs new file mode 100644 index 00000000..c6df8efc --- /dev/null +++ b/program-examples/native/program/src/instructions/create_ata.rs @@ -0,0 +1,84 @@ +use super::authority_seeds; +use light_token::instruction::CreateAssociatedAccountCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn create_ata_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [owner, mint, payer, associated_token_account, system_program, compressible_config, rent_sponsor, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.is_empty() { + return Err(ProgramError::InvalidInstructionData); + } + + let bump = data[0]; + let idempotent = data.get(1).copied().unwrap_or(0) != 0; + + let cpi = CreateAssociatedAccountCpi { + payer: payer.clone(), + owner: owner.clone(), + mint: mint.clone(), + ata: associated_token_account.clone(), + bump, + }; + + if idempotent { + cpi.idempotent().rent_free( + compressible_config.clone(), + rent_sponsor.clone(), + system_program.clone(), + ) + } else { + cpi.rent_free( + compressible_config.clone(), + rent_sponsor.clone(), + system_program.clone(), + ) + } + .invoke() +} + +pub fn create_ata_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [owner, mint, payer, associated_token_account, system_program, compressible_config, rent_sponsor, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 3 { + return Err(ProgramError::InvalidInstructionData); + } + + let bump = data[0]; + let idempotent = data[1] != 0; + let authority_bump = data[2]; + let signer_seeds = authority_seeds!(authority_bump); + + let cpi = CreateAssociatedAccountCpi { + payer: payer.clone(), + owner: owner.clone(), + mint: mint.clone(), + ata: associated_token_account.clone(), + bump, + }; + + if idempotent { + cpi.idempotent().rent_free( + compressible_config.clone(), + rent_sponsor.clone(), + system_program.clone(), + ) + } else { + cpi.rent_free( + compressible_config.clone(), + rent_sponsor.clone(), + system_program.clone(), + ) + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/create_mint.rs b/program-examples/native/program/src/instructions/create_mint.rs new file mode 100644 index 00000000..f9ebdd2a --- /dev/null +++ b/program-examples/native/program/src/instructions/create_mint.rs @@ -0,0 +1,190 @@ +use borsh::BorshDeserialize; +use light_token_interface::instructions::extensions::{ + token_metadata::TokenMetadataInstructionData, ExtensionInstructionData, +}; +use light_token::instruction::{CreateMintCpi, CreateMintParams, SystemAccountInfos}; +use light_token::CompressedProof; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, pubkey::Pubkey, +}; + +#[derive(BorshDeserialize)] +struct CreateMintData { + decimals: u8, + address_merkle_tree_root_index: u16, + mint_authority: Pubkey, + proof_a: [u8; 32], + proof_b: [u8; 64], + proof_c: [u8; 32], + compression_address: [u8; 32], + mint: Pubkey, + bump: u8, + freeze_authority: Option, + rent_payment: u8, + write_top_up: u32, + metadata_name: Option>, + metadata_symbol: Option>, + metadata_uri: Option>, +} + +pub fn create_mint_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + let ix_data = CreateMintData::deserialize(&mut &data[..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + + // Build token metadata extension if metadata fields are provided + let extensions = match ( + &ix_data.metadata_name, + &ix_data.metadata_symbol, + &ix_data.metadata_uri, + ) { + (Some(name), Some(symbol), Some(uri)) => Some(vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some(ix_data.mint_authority.to_bytes().into()), + name: name.clone(), + symbol: symbol.clone(), + uri: uri.clone(), + additional_metadata: None, + }, + )]), + _ => None, + }; + + let params = CreateMintParams { + decimals: ix_data.decimals, + address_merkle_tree_root_index: ix_data.address_merkle_tree_root_index, + mint_authority: ix_data.mint_authority, + proof: CompressedProof { + a: ix_data.proof_a, + b: ix_data.proof_b, + c: ix_data.proof_c, + }, + compression_address: ix_data.compression_address, + mint: ix_data.mint, + bump: ix_data.bump, + freeze_authority: ix_data.freeze_authority, + extensions, + rent_payment: ix_data.rent_payment, + write_top_up: ix_data.write_top_up, + }; + + let system_accounts = SystemAccountInfos { + light_system_program: light_system_program.clone(), + cpi_authority_pda: cpi_authority_pda.clone(), + registered_program_pda: registered_program_pda.clone(), + account_compression_authority: account_compression_authority.clone(), + account_compression_program: account_compression_program.clone(), + system_program: system_program.clone(), + }; + + CreateMintCpi::new( + mint_seed.clone(), + authority.clone(), + payer.clone(), + address_tree.clone(), + output_queue.clone(), + compressible_config.clone(), + mint.clone(), + rent_sponsor.clone(), + system_accounts, + params, + ) + .invoke() +} + +#[derive(BorshDeserialize)] +struct CreateMintSignedData { + decimals: u8, + address_merkle_tree_root_index: u16, + proof_a: [u8; 32], + proof_b: [u8; 64], + proof_c: [u8; 32], + compression_address: [u8; 32], + mint: Pubkey, + bump: u8, + freeze_authority: Option, + rent_payment: u8, + write_top_up: u32, + authority_bump: u8, + metadata_name: Option>, + metadata_symbol: Option>, + metadata_uri: Option>, +} + +pub fn create_mint_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + let ix_data = CreateMintSignedData::deserialize(&mut &data[..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + + let signer_seeds: &[&[u8]] = &[b"authority", &[ix_data.authority_bump]]; + + // Build token metadata extension if metadata fields are provided + let extensions = match ( + &ix_data.metadata_name, + &ix_data.metadata_symbol, + &ix_data.metadata_uri, + ) { + (Some(name), Some(symbol), Some(uri)) => Some(vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some(authority.key.to_bytes().into()), + name: name.clone(), + symbol: symbol.clone(), + uri: uri.clone(), + additional_metadata: None, + }, + )]), + _ => None, + }; + + let params = CreateMintParams { + decimals: ix_data.decimals, + address_merkle_tree_root_index: ix_data.address_merkle_tree_root_index, + mint_authority: *authority.key, + proof: CompressedProof { + a: ix_data.proof_a, + b: ix_data.proof_b, + c: ix_data.proof_c, + }, + compression_address: ix_data.compression_address, + mint: ix_data.mint, + bump: ix_data.bump, + freeze_authority: ix_data.freeze_authority, + extensions, + rent_payment: ix_data.rent_payment, + write_top_up: ix_data.write_top_up, + }; + + let system_accounts = SystemAccountInfos { + light_system_program: light_system_program.clone(), + cpi_authority_pda: cpi_authority_pda.clone(), + registered_program_pda: registered_program_pda.clone(), + account_compression_authority: account_compression_authority.clone(), + account_compression_program: account_compression_program.clone(), + system_program: system_program.clone(), + }; + + CreateMintCpi::new( + mint_seed.clone(), + authority.clone(), + payer.clone(), + address_tree.clone(), + output_queue.clone(), + compressible_config.clone(), + mint.clone(), + rent_sponsor.clone(), + system_accounts, + params, + ) + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/create_token_account.rs b/program-examples/native/program/src/instructions/create_token_account.rs new file mode 100644 index 00000000..9f0659d4 --- /dev/null +++ b/program-examples/native/program/src/instructions/create_token_account.rs @@ -0,0 +1,73 @@ +use light_token::instruction::CreateTokenAccountCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, pubkey::Pubkey, +}; + +/// Account order: +/// - accounts[0]: payer (signer, mut) +/// - accounts[1]: account (signer for invoke, PDA for invoke_signed, mut) +/// - accounts[2]: mint (readonly) +/// - accounts[3]: compressible_config (readonly) +/// - accounts[4]: system_program (readonly) +/// - accounts[5]: rent_sponsor (mut) +/// - accounts[6]: light_token_program (readonly) +pub fn create_token_account_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [payer, account, mint, compressible_config, system_program, rent_sponsor, token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 32 { + return Err(ProgramError::InvalidInstructionData); + } + + let owner = Pubkey::try_from(&data[0..32]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + + CreateTokenAccountCpi { + payer: payer.clone(), + account: account.clone(), + mint: mint.clone(), + owner, + } + .rent_free( + compressible_config.clone(), + rent_sponsor.clone(), + system_program.clone(), + token_program.key, + ) + .invoke() +} + +pub fn create_token_account_invoke_signed(program_id: &Pubkey, accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [payer, account, mint, compressible_config, system_program, rent_sponsor, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 33 { + return Err(ProgramError::InvalidInstructionData); + } + + let owner = Pubkey::try_from(&data[0..32]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + let authority_bump = data[32]; + let signer_seeds: &[&[u8]] = &[b"authority", &[authority_bump]]; + + CreateTokenAccountCpi { + payer: payer.clone(), + account: account.clone(), + mint: mint.clone(), + owner, + } + .rent_free( + compressible_config.clone(), + rent_sponsor.clone(), + system_program.clone(), + program_id, + ) + .invoke_signed(signer_seeds) +} diff --git a/program-examples/native/program/src/instructions/freeze.rs b/program-examples/native/program/src/instructions/freeze.rs new file mode 100644 index 00000000..cba0e134 --- /dev/null +++ b/program-examples/native/program/src/instructions/freeze.rs @@ -0,0 +1,41 @@ +use super::authority_seeds; +use light_token::instruction::FreezeCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn freeze_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { + let [token_account, mint, freeze_authority, _token_program] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + FreezeCpi { + token_account: token_account.clone(), + mint: mint.clone(), + freeze_authority: freeze_authority.clone(), + } + .invoke() +} + +pub fn freeze_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [token_account, mint, freeze_authority, _token_program] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.is_empty() { + return Err(ProgramError::InvalidInstructionData); + } + + let bump = data[0]; + let signer_seeds = authority_seeds!(bump); + + FreezeCpi { + token_account: token_account.clone(), + mint: mint.clone(), + freeze_authority: freeze_authority.clone(), + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/mint_to.rs b/program-examples/native/program/src/instructions/mint_to.rs new file mode 100644 index 00000000..62799312 --- /dev/null +++ b/program-examples/native/program/src/instructions/mint_to.rs @@ -0,0 +1,55 @@ +use super::authority_seeds; +use light_token::instruction::MintToCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn mint_to_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [mint, destination, authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + let amount = u64::from_le_bytes( + data.try_into() + .map_err(|_| ProgramError::InvalidInstructionData)?, + ); + + MintToCpi { + mint: mint.clone(), + destination: destination.clone(), + amount, + authority: authority.clone(), + system_program: system_program.clone(), + max_top_up: None, + } + .invoke() +} + +pub fn mint_to_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [mint, destination, authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 9 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let bump = data[8]; + let signer_seeds = authority_seeds!(bump); + + MintToCpi { + mint: mint.clone(), + destination: destination.clone(), + amount, + authority: authority.clone(), + system_program: system_program.clone(), + max_top_up: None, + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/mod.rs b/program-examples/native/program/src/instructions/mod.rs new file mode 100644 index 00000000..749c924a --- /dev/null +++ b/program-examples/native/program/src/instructions/mod.rs @@ -0,0 +1,60 @@ +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey, +}; + +macro_rules! authority_seeds { + ($bump:expr) => { + &[b"authority" as &[u8], &[$bump]] + }; +} +pub(crate) use authority_seeds; + +mod approve; +mod burn; +mod close; +mod create_ata; +mod create_mint; +mod create_token_account; +mod freeze; +mod mint_to; +mod revoke; +mod thaw; +mod transfer_interface; + +pub fn process( + program_id: &Pubkey, + accounts: &[AccountInfo], + instruction_data: &[u8], +) -> ProgramResult { + let (discriminator, data) = instruction_data.split_first().ok_or( + solana_program::program_error::ProgramError::InvalidInstructionData, + )?; + + match discriminator { + 0 => create_mint::create_mint_invoke(accounts, data), + 1 => create_ata::create_ata_invoke(accounts, data), + 2 => approve::approve_invoke(accounts, data), + 3 => burn::burn_invoke(accounts, data), + 4 => close::close_invoke(accounts, data), + 5 => freeze::freeze_invoke(accounts, data), + 6 => mint_to::mint_to_invoke(accounts, data), + 7 => revoke::revoke_invoke(accounts, data), + 8 => thaw::thaw_invoke(accounts, data), + 9 => transfer_interface::transfer_invoke(accounts, data), + 10 => mint_to::mint_to_invoke_signed(accounts, data), + 11 => transfer_interface::transfer_invoke_signed(accounts, data), + 12 => approve::approve_invoke_signed(accounts, data), + 13 => burn::burn_invoke_signed(accounts, data), + 14 => close::close_invoke_signed(accounts, data), + 15 => freeze::freeze_invoke_signed(accounts, data), + 16 => revoke::revoke_invoke_signed(accounts, data), + 17 => thaw::thaw_invoke_signed(accounts, data), + 18 => create_ata::create_ata_invoke_signed(accounts, data), + 19 => create_mint::create_mint_invoke_signed(accounts, data), + 20 => create_token_account::create_token_account_invoke(accounts, data), + 21 => create_token_account::create_token_account_invoke_signed(program_id, accounts, data), + _ => Err( + solana_program::program_error::ProgramError::InvalidInstructionData, + ), + } +} diff --git a/program-examples/native/program/src/instructions/revoke.rs b/program-examples/native/program/src/instructions/revoke.rs new file mode 100644 index 00000000..c68dc0d7 --- /dev/null +++ b/program-examples/native/program/src/instructions/revoke.rs @@ -0,0 +1,41 @@ +use super::authority_seeds; +use light_token::instruction::RevokeCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn revoke_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { + let [token_account, owner, system_program, _token_program] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + RevokeCpi { + token_account: token_account.clone(), + owner: owner.clone(), + system_program: system_program.clone(), + } + .invoke() +} + +pub fn revoke_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [token_account, owner, system_program, _token_program] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.is_empty() { + return Err(ProgramError::InvalidInstructionData); + } + + let bump = data[0]; + let signer_seeds = authority_seeds!(bump); + + RevokeCpi { + token_account: token_account.clone(), + owner: owner.clone(), + system_program: system_program.clone(), + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/thaw.rs b/program-examples/native/program/src/instructions/thaw.rs new file mode 100644 index 00000000..f7eb0dc5 --- /dev/null +++ b/program-examples/native/program/src/instructions/thaw.rs @@ -0,0 +1,41 @@ +use super::authority_seeds; +use light_token::instruction::ThawCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn thaw_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { + let [token_account, mint, freeze_authority, _token_program] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + ThawCpi { + token_account: token_account.clone(), + mint: mint.clone(), + freeze_authority: freeze_authority.clone(), + } + .invoke() +} + +pub fn thaw_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [token_account, mint, freeze_authority, _token_program] = accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.is_empty() { + return Err(ProgramError::InvalidInstructionData); + } + + let bump = data[0]; + let signer_seeds = authority_seeds!(bump); + + ThawCpi { + token_account: token_account.clone(), + mint: mint.clone(), + freeze_authority: freeze_authority.clone(), + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/transfer_interface.rs b/program-examples/native/program/src/instructions/transfer_interface.rs new file mode 100644 index 00000000..6e7c87f3 --- /dev/null +++ b/program-examples/native/program/src/instructions/transfer_interface.rs @@ -0,0 +1,62 @@ +use super::authority_seeds; +use light_token::instruction::TransferInterfaceCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 9 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let decimals = data[8]; + + TransferInterfaceCpi::new( + amount, + decimals, + source.clone(), + destination.clone(), + authority.clone(), + payer.clone(), + ctoken_authority.clone(), + system_program.clone(), + ) + .invoke() +} + +pub fn transfer_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 10 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let decimals = data[8]; + let bump = data[9]; + let signer_seeds = authority_seeds!(bump); + + TransferInterfaceCpi::new( + amount, + decimals, + source.clone(), + destination.clone(), + authority.clone(), + payer.clone(), + ctoken_authority.clone(), + system_program.clone(), + ) + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/lib.rs b/program-examples/native/program/src/lib.rs new file mode 100644 index 00000000..16a1fa5f --- /dev/null +++ b/program-examples/native/program/src/lib.rs @@ -0,0 +1,16 @@ +use solana_program::{ + account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, + pubkey::Pubkey, +}; + +mod instructions; + +entrypoint!(process_instruction); + +pub fn process_instruction( + program_id: &Pubkey, + accounts: &[AccountInfo], + instruction_data: &[u8], +) -> ProgramResult { + instructions::process(program_id, accounts, instruction_data) +} diff --git a/program-examples/native/program/tests/approve.rs b/program-examples/native/program/tests/approve.rs new file mode 100644 index 00000000..5f3e9c5b --- /dev/null +++ b/program-examples/native/program/tests/approve.rs @@ -0,0 +1,59 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_approve_cpi_ix, build_approve_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup, setup_pda_owned_ata, SetupContext, +}; +use solana_sdk::{signature::Keypair, signer::Signer}; + +#[tokio::test(flavor = "multi_thread")] +async fn approve_cpi() { + // Setup: create mint and ATA with tokens + let SetupContext { + mut rpc, + payer, + ata, + .. + } = setup().await; + + let delegate = Keypair::new(); + let delegate_amount = 500_000u64; + + let ix = build_approve_cpi_ix( + ata, + delegate.pubkey(), + payer.pubkey(), + delegate_amount, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn approve_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_owner, bump) = get_authority_pda(); + + let (_mint, ata) = + setup_pda_owned_ata(&mut rpc, &payer, pda_owner, 1_000_000).await; + + let delegate = Keypair::new(); + let delegate_amount = 500_000u64; + + let ix = build_approve_signed_cpi_ix( + ata, + delegate.pubkey(), + pda_owner, + delegate_amount, + bump, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/program/tests/burn.rs b/program-examples/native/program/tests/burn.rs new file mode 100644 index 00000000..a9ee9ef5 --- /dev/null +++ b/program-examples/native/program/tests/burn.rs @@ -0,0 +1,47 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_burn_cpi_ix, build_burn_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup, setup_pda_owned_ata, SetupContext, +}; +use solana_sdk::signer::Signer; + +#[tokio::test(flavor = "multi_thread")] +async fn burn_cpi() { + // Setup: create mint and ATA with tokens + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup().await; + + let burn_amount = 300_000u64; + + let ix = build_burn_cpi_ix(ata, mint, payer.pubkey(), burn_amount); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn burn_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_owner, bump) = get_authority_pda(); + let initial_amount = 1_000_000u64; + let burn_amount = 300_000u64; + + let (mint, ata) = + setup_pda_owned_ata(&mut rpc, &payer, pda_owner, initial_amount).await; + + let ix = build_burn_signed_cpi_ix(ata, mint, pda_owner, burn_amount, bump); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/program/tests/close.rs b/program-examples/native/program/tests/close.rs new file mode 100644 index 00000000..e0fa92c2 --- /dev/null +++ b/program-examples/native/program/tests/close.rs @@ -0,0 +1,60 @@ +mod shared; + +use light_client::rpc::Rpc; +use light_token::instruction::rent_sponsor_pda; +use shared::{ + build_close_cpi_ix, build_close_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup_empty_ata, setup_pda_owned_ata, SetupContext, +}; +use solana_sdk::signer::Signer; + +#[tokio::test(flavor = "multi_thread")] +async fn close_cpi() { + // Setup: create mint and empty ATA (must be empty to close) + let SetupContext { + mut rpc, + payer, + ata, + .. + } = setup_empty_ata().await; + + let ix = build_close_cpi_ix( + ata, + payer.pubkey(), + payer.pubkey(), + rent_sponsor_pda(), + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let account = rpc.get_account(ata).await.unwrap(); + assert!(account.is_none()); +} + +#[tokio::test(flavor = "multi_thread")] +async fn close_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_owner, bump) = get_authority_pda(); + + let (_mint, ata) = + setup_pda_owned_ata(&mut rpc, &payer, pda_owner, 0).await; + + let ix = build_close_signed_cpi_ix( + ata, + payer.pubkey(), + pda_owner, + rent_sponsor_pda(), + bump, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let account = rpc.get_account(ata).await.unwrap(); + assert!(account.is_none()); +} diff --git a/program-examples/native/program/tests/create_ata.rs b/program-examples/native/program/tests/create_ata.rs new file mode 100644 index 00000000..f7ba2964 --- /dev/null +++ b/program-examples/native/program/tests/create_ata.rs @@ -0,0 +1,74 @@ +mod shared; + +use light_client::rpc::Rpc; +use light_token::instruction::derive_token_ata; +use shared::{ + build_create_ata_cpi_ix, build_create_ata_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup_mint_with_tokens, +}; +use solana_sdk::signer::Signer; + +#[tokio::test(flavor = "multi_thread")] +async fn create_ata_cpi() { + // Works with light, spl, or t22 mints + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (mint, _) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + None, + 9, + vec![], + ) + .await; + + let owner = payer.pubkey(); + let (ata, bump) = derive_token_ata(&owner, &mint); + + let ix = build_create_ata_cpi_ix(owner, mint, payer.pubkey(), ata, bump); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let account = rpc.get_account(ata).await.unwrap(); + assert!(account.is_some()); +} + +#[tokio::test(flavor = "multi_thread")] +async fn create_ata_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_owner, authority_bump) = get_authority_pda(); + + let (mint, _) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + None, + 9, + vec![], + ) + .await; + + let (ata, ata_bump) = derive_token_ata(&pda_owner, &mint); + + let ix = build_create_ata_signed_cpi_ix( + pda_owner, + mint, + payer.pubkey(), + ata, + ata_bump, + authority_bump, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let account = rpc.get_account(ata).await.unwrap(); + assert!(account.is_some()); +} diff --git a/program-examples/native/program/tests/create_mint.rs b/program-examples/native/program/tests/create_mint.rs new file mode 100644 index 00000000..3d8fcced --- /dev/null +++ b/program-examples/native/program/tests/create_mint.rs @@ -0,0 +1,268 @@ +mod shared; + +use borsh::BorshSerialize; +use light_client::{ + indexer::{AddressWithTree, Indexer}, + rpc::Rpc, +}; +use light_token::instruction::{ + config_pda, derive_mint_compressed_address, find_mint_address, + rent_sponsor_pda, SystemAccounts, LIGHT_TOKEN_PROGRAM_ID, +}; +use shared::{create_test_rpc, get_authority_pda, PROGRAM_ID}; +use solana_sdk::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + signature::Keypair, + signer::Signer, +}; + +#[tokio::test(flavor = "multi_thread")] +async fn create_mint_cpi() { + let mut rpc = create_test_rpc().await; + + let payer = rpc.get_payer().insecure_clone(); + let mint_seed = Keypair::new(); + let decimals = 9u8; + + // Get address tree to store compressed address for when mint turns inactive + // We must create a compressed address at creation to ensure the mint does not exist yet + let address_tree = rpc.get_address_tree_v2(); + // Get state tree to store mint when inactive + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Derive mint addresses + let compression_address = + derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); + let (mint, bump) = find_mint_address(&mint_seed.pubkey()); + + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + let proof = rpc_result.proof.0.unwrap(); + + // Build instruction data + #[derive(BorshSerialize)] + struct CreateMintDataTest { + decimals: u8, + address_merkle_tree_root_index: u16, + mint_authority: Pubkey, + proof_a: [u8; 32], + proof_b: [u8; 64], + proof_c: [u8; 32], + compression_address: [u8; 32], + mint: Pubkey, + bump: u8, + freeze_authority: Option, + rent_payment: u8, + write_top_up: u32, + metadata_name: Option>, + metadata_symbol: Option>, + metadata_uri: Option>, + } + + let test_data = CreateMintDataTest { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof_a: proof.a, + proof_b: proof.b, + proof_c: proof.c, + compression_address, + mint, + bump, + freeze_authority: None, + rent_payment: 16, + write_top_up: 766, + metadata_name: Some(b"Example Token".to_vec()), + metadata_symbol: Some(b"EXT".to_vec()), + metadata_uri: Some(b"https://example.com/metadata.json".to_vec()), + }; + + let mut data = vec![0u8]; + data.extend(test_data.try_to_vec().unwrap()); + + let system_accounts = SystemAccounts::default(); + + // Build and send instruction (mint_seed must sign) + let ix = Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint_seed.pubkey(), true), + AccountMeta::new_readonly(payer.pubkey(), true), + AccountMeta::new(payer.pubkey(), true), + AccountMeta::new(address_tree.tree, false), + AccountMeta::new(output_queue, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new(mint, false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly( + system_accounts.light_system_program, + false, + ), + AccountMeta::new_readonly(system_accounts.cpi_authority_pda, false), + AccountMeta::new_readonly( + system_accounts.registered_program_pda, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_authority, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_program, + false, + ), + AccountMeta::new_readonly(system_accounts.system_program, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + }; + + rpc.create_and_send_transaction( + &[ix], + &payer.pubkey(), + &[&payer, &mint_seed], + ) + .await + .unwrap(); + + let mint_account = rpc.get_account(mint).await.unwrap(); + assert!(mint_account.is_some()); +} + +#[tokio::test(flavor = "multi_thread")] +async fn create_mint_signed_cpi() { + let mut rpc = create_test_rpc().await; + + let payer = rpc.get_payer().insecure_clone(); + let mint_seed = Keypair::new(); + let decimals = 9u8; + + let (pda_authority, authority_bump) = get_authority_pda(); + + // Get address tree to store compressed address for when mint turns inactive + // We must create a compressed address at creation to ensure the mint does not exist yet + let address_tree = rpc.get_address_tree_v2(); + // Get state tree to store mint when inactive + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Derive mint addresses + let compression_address = + derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); + let (mint, bump) = find_mint_address(&mint_seed.pubkey()); + + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + let proof = rpc_result.proof.0.unwrap(); + + // Build instruction data + #[derive(BorshSerialize)] + struct CreateMintSignedDataTest { + decimals: u8, + address_merkle_tree_root_index: u16, + proof_a: [u8; 32], + proof_b: [u8; 64], + proof_c: [u8; 32], + compression_address: [u8; 32], + mint: Pubkey, + bump: u8, + freeze_authority: Option, + rent_payment: u8, + write_top_up: u32, + authority_bump: u8, + metadata_name: Option>, + metadata_symbol: Option>, + metadata_uri: Option>, + } + + let test_data = CreateMintSignedDataTest { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + proof_a: proof.a, + proof_b: proof.b, + proof_c: proof.c, + compression_address, + mint, + bump, + freeze_authority: None, + rent_payment: 16, + write_top_up: 766, + authority_bump, + metadata_name: Some(b"Example Token".to_vec()), + metadata_symbol: Some(b"EXT".to_vec()), + metadata_uri: Some(b"https://example.com/metadata.json".to_vec()), + }; + + let mut data = vec![19u8]; + data.extend(test_data.try_to_vec().unwrap()); + + let system_accounts = SystemAccounts::default(); + + // Build and send instruction (mint_seed must sign) + let ix = Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint_seed.pubkey(), true), + AccountMeta::new(pda_authority, false), + AccountMeta::new(payer.pubkey(), true), + AccountMeta::new(address_tree.tree, false), + AccountMeta::new(output_queue, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new(mint, false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly( + system_accounts.light_system_program, + false, + ), + AccountMeta::new_readonly(system_accounts.cpi_authority_pda, false), + AccountMeta::new_readonly( + system_accounts.registered_program_pda, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_authority, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_program, + false, + ), + AccountMeta::new_readonly(system_accounts.system_program, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + }; + + rpc.create_and_send_transaction( + &[ix], + &payer.pubkey(), + &[&payer, &mint_seed], + ) + .await + .unwrap(); + + let mint_account = rpc.get_account(mint).await.unwrap(); + assert!(mint_account.is_some()); +} diff --git a/program-examples/native/program/tests/create_token_account.rs b/program-examples/native/program/tests/create_token_account.rs new file mode 100644 index 00000000..0925e1fa --- /dev/null +++ b/program-examples/native/program/tests/create_token_account.rs @@ -0,0 +1,76 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_create_token_account_cpi_ix, build_create_token_account_signed_cpi_ix, + create_test_rpc, get_authority_pda, setup_mint_with_tokens, +}; +use solana_sdk::{signature::Keypair, signer::Signer}; + +#[tokio::test(flavor = "multi_thread")] +async fn create_token_account_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (mint, _) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + None, + 9, + vec![], + ) + .await; + + let token_account = Keypair::new(); + let owner = payer.pubkey(); + + let ix = build_create_token_account_cpi_ix( + payer.pubkey(), + token_account.pubkey(), + mint, + owner, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer, &token_account]) + .await + .unwrap(); + + let account = rpc.get_account(token_account.pubkey()).await.unwrap(); + assert!(account.is_some()); +} + +#[tokio::test(flavor = "multi_thread")] +async fn create_token_account_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_account, authority_bump) = get_authority_pda(); + + let (mint, _) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + None, + 9, + vec![], + ) + .await; + + let owner = payer.pubkey(); + + let ix = build_create_token_account_signed_cpi_ix( + payer.pubkey(), + pda_account, + mint, + owner, + authority_bump, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let account = rpc.get_account(pda_account).await.unwrap(); + assert!(account.is_some()); +} diff --git a/program-examples/native/program/tests/freeze.rs b/program-examples/native/program/tests/freeze.rs new file mode 100644 index 00000000..cbfb1e5a --- /dev/null +++ b/program-examples/native/program/tests/freeze.rs @@ -0,0 +1,53 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_freeze_cpi_ix, build_freeze_signed_cpi_ix, create_ata, + create_test_rpc, get_authority_pda, setup, setup_mint_with_tokens, + SetupContext, +}; +use solana_sdk::signer::Signer; + +#[tokio::test(flavor = "multi_thread")] +async fn freeze_cpi() { + // Setup: create mint and ATA with freeze authority + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup().await; + + let ix = build_freeze_cpi_ix(ata, mint, payer.pubkey()); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn freeze_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_authority, bump) = get_authority_pda(); + + let (mint, _) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + Some(pda_authority), + 9, + vec![], + ) + .await; + + let ata = create_ata(&mut rpc, &payer, payer.pubkey(), mint).await; + + let ix = build_freeze_signed_cpi_ix(ata, mint, pda_authority, bump); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/program/tests/mint_to.rs b/program-examples/native/program/tests/mint_to.rs new file mode 100644 index 00000000..ffcd3683 --- /dev/null +++ b/program-examples/native/program/tests/mint_to.rs @@ -0,0 +1,197 @@ +mod shared; + +use borsh::BorshSerialize; +use light_client::{ + indexer::{AddressWithTree, Indexer}, + rpc::Rpc, +}; +use light_token::instruction::{ + config_pda, derive_mint_compressed_address, derive_token_ata, + find_mint_address, rent_sponsor_pda, SystemAccounts, + LIGHT_TOKEN_PROGRAM_ID, +}; +use shared::{ + build_mint_to_cpi_ix, build_mint_to_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup_empty_ata, SetupContext, PROGRAM_ID, +}; +use solana_sdk::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + signature::Keypair, + signer::Signer, +}; + +#[tokio::test(flavor = "multi_thread")] +async fn mint_to_cpi() { + // Setup: create mint and empty ATA + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup_empty_ata().await; + + let amount = 1_000_000u64; + + let ix = build_mint_to_cpi_ix(mint, ata, payer.pubkey(), amount); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn mint_to_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_authority, authority_bump) = get_authority_pda(); + let mint_seed = Keypair::new(); + let decimals = 9u8; + + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + let compression_address = + derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); + let (mint, bump) = find_mint_address(&mint_seed.pubkey()); + + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + let proof = rpc_result.proof.0.unwrap(); + + #[derive(BorshSerialize)] + struct CreateMintSignedDataTest { + decimals: u8, + address_merkle_tree_root_index: u16, + proof_a: [u8; 32], + proof_b: [u8; 64], + proof_c: [u8; 32], + compression_address: [u8; 32], + mint: Pubkey, + bump: u8, + freeze_authority: Option, + rent_payment: u8, + write_top_up: u32, + authority_bump: u8, + metadata_name: Option>, + metadata_symbol: Option>, + metadata_uri: Option>, + } + + let create_mint_data = CreateMintSignedDataTest { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + proof_a: proof.a, + proof_b: proof.b, + proof_c: proof.c, + compression_address, + mint, + bump, + freeze_authority: None, + rent_payment: 16, + write_top_up: 766, + authority_bump, + metadata_name: None, + metadata_symbol: None, + metadata_uri: None, + }; + + let mut data = vec![19u8]; + data.extend(create_mint_data.try_to_vec().unwrap()); + + let system_accounts = SystemAccounts::default(); + + let create_mint_ix = Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint_seed.pubkey(), true), + AccountMeta::new(pda_authority, false), + AccountMeta::new(payer.pubkey(), true), + AccountMeta::new(address_tree.tree, false), + AccountMeta::new(output_queue, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new(mint, false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly( + system_accounts.light_system_program, + false, + ), + AccountMeta::new_readonly(system_accounts.cpi_authority_pda, false), + AccountMeta::new_readonly( + system_accounts.registered_program_pda, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_authority, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_program, + false, + ), + AccountMeta::new_readonly(system_accounts.system_program, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + }; + + rpc.create_and_send_transaction( + &[create_mint_ix], + &payer.pubkey(), + &[&payer, &mint_seed], + ) + .await + .unwrap(); + + let (ata, ata_bump) = derive_token_ata(&payer.pubkey(), &mint); + + let create_ata_data = vec![1u8, ata_bump, 0u8]; + let create_ata_ix = Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new_readonly(payer.pubkey(), false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new(payer.pubkey(), true), + AccountMeta::new(ata, false), + AccountMeta::new_readonly(solana_sdk::system_program::ID, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data: create_ata_data, + }; + + rpc.create_and_send_transaction( + &[create_ata_ix], + &payer.pubkey(), + &[&payer], + ) + .await + .unwrap(); + + let amount = 1_000_000u64; + let mint_to_ix = build_mint_to_signed_cpi_ix( + mint, + ata, + pda_authority, + amount, + authority_bump, + ); + + rpc.create_and_send_transaction(&[mint_to_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/program/tests/revoke.rs b/program-examples/native/program/tests/revoke.rs new file mode 100644 index 00000000..ae187fe8 --- /dev/null +++ b/program-examples/native/program/tests/revoke.rs @@ -0,0 +1,55 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_revoke_cpi_ix, build_revoke_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup, setup_pda_owned_ata, SetupContext, +}; +use solana_sdk::{signature::Keypair, signer::Signer}; + +#[tokio::test(flavor = "multi_thread")] +async fn revoke_cpi() { + // Setup: create mint, ATA with tokens, and approve delegate + let SetupContext { + mut rpc, + payer, + ata, + .. + } = setup().await; + + let ix = build_revoke_cpi_ix(ata, payer.pubkey()); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn revoke_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_owner, bump) = get_authority_pda(); + + let (_mint, ata) = + setup_pda_owned_ata(&mut rpc, &payer, pda_owner, 1_000_000).await; + + let delegate = Keypair::new(); + let approve_ix = shared::build_approve_signed_cpi_ix( + ata, + delegate.pubkey(), + pda_owner, + 500_000, + bump, + ); + + rpc.create_and_send_transaction(&[approve_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let ix = build_revoke_signed_cpi_ix(ata, pda_owner, bump); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/program/tests/shared.rs b/program-examples/native/program/tests/shared.rs new file mode 100644 index 00000000..2ce34251 --- /dev/null +++ b/program-examples/native/program/tests/shared.rs @@ -0,0 +1,962 @@ +use anchor_spl::{ + associated_token::spl_associated_token_account, + token::{spl_token, Mint as SPLMint}, +}; +use light_client::{ + indexer::{AddressWithTree, Indexer}, + rpc::Rpc, +}; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_token::{ + spl_interface::CreateSplInterfacePda, + instruction::{ + config_pda, derive_mint_compressed_address, derive_token_ata, + find_mint_address, rent_sponsor_pda, Approve, + CreateAssociatedTokenAccount, CreateMint, CreateMintParams, Freeze, + MintTo, LIGHT_TOKEN_PROGRAM_ID, + }, +}; +#[allow(deprecated)] +use solana_sdk::{ + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + signature::Keypair, + signer::Signer, + system_instruction, system_program, +}; + +pub const PROGRAM_ID: Pubkey = + solana_sdk::pubkey!("TokenCpi11111111111111111111111111111111111"); + +#[allow(unused)] +pub async fn create_test_rpc() -> LightProgramTest { + LightProgramTest::new(ProgramTestConfig::new_v2( + false, + Some(vec![("light_token_cpi", PROGRAM_ID)]), + )) + .await + .unwrap() +} + +#[allow(dead_code)] +pub struct SetupContext { + pub rpc: LightProgramTest, + pub payer: Keypair, + pub mint: Pubkey, + pub ata: Pubkey, + pub delegate: Keypair, +} + +#[allow(unused)] +pub async fn setup() -> SetupContext { + let mut rpc = create_test_rpc().await; + + let payer = rpc.get_payer().insecure_clone(); + let initial_amount = 1_000_000u64; + + let (mint, atas) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + Some(payer.pubkey()), + 9, + vec![(initial_amount, payer.pubkey())], + ) + .await; + + let ata = atas[0]; + let delegate = Keypair::new(); + + let approve_ix = Approve { + token_account: ata, + delegate: delegate.pubkey(), + owner: payer.pubkey(), + amount: initial_amount, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[approve_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + SetupContext { + rpc, + payer, + mint, + ata, + delegate, + } +} + +#[allow(unused)] +pub async fn setup_empty_ata() -> SetupContext { + let mut rpc = create_test_rpc().await; + + let payer = rpc.get_payer().insecure_clone(); + + let (mint, atas) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + Some(payer.pubkey()), + 9, + vec![(0, payer.pubkey())], + ) + .await; + + let delegate = Keypair::new(); + + SetupContext { + rpc, + payer, + mint, + ata: atas[0], + delegate, + } +} + +#[allow(unused)] +pub async fn setup_frozen() -> SetupContext { + let mut rpc = create_test_rpc().await; + + let payer = rpc.get_payer().insecure_clone(); + let initial_amount = 1_000_000u64; + + let (mint, atas) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + Some(payer.pubkey()), + 9, + vec![(initial_amount, payer.pubkey())], + ) + .await; + + let ata = atas[0]; + let delegate = Keypair::new(); + + let approve_ix = Approve { + token_account: ata, + delegate: delegate.pubkey(), + owner: payer.pubkey(), + amount: initial_amount, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[approve_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let freeze_ix = Freeze { + token_account: ata, + mint, + freeze_authority: payer.pubkey(), + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[freeze_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + SetupContext { + rpc, + payer, + mint, + ata, + delegate, + } +} + +#[allow(unused)] +pub async fn setup_mint_with_tokens( + rpc: &mut (impl Rpc + Indexer), + payer: &Keypair, + mint_authority: Pubkey, + freeze_authority: Option, + decimals: u8, + recipients: Vec<(u64, Pubkey)>, +) -> (Pubkey, Vec) { + let mint_seed = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + let compression_address = + derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); + let mint = find_mint_address(&mint_seed.pubkey()).0; + + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + let params = CreateMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority, + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint, + bump: find_mint_address(&mint_seed.pubkey()).1, + freeze_authority, + extensions: None, + rent_payment: 16, + write_top_up: 766, + }; + + let create_mint_ix = CreateMint::new( + params, + mint_seed.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[create_mint_ix], + &payer.pubkey(), + &[payer, &mint_seed], + ) + .await + .unwrap(); + + if recipients.is_empty() { + return (mint, vec![]); + } + + let mut ata_pubkeys = Vec::with_capacity(recipients.len()); + + for (amount, owner) in &recipients { + let (ata_address, _) = derive_token_ata(owner, &mint); + ata_pubkeys.push(ata_address); + + let create_ata_ix = + CreateAssociatedTokenAccount::new(payer.pubkey(), *owner, mint) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[create_ata_ix], + &payer.pubkey(), + &[payer], + ) + .await + .unwrap(); + + if *amount > 0 { + let mint_to_ix = MintTo { + mint, + destination: ata_address, + amount: *amount, + authority: mint_authority, + max_top_up: None, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[mint_to_ix], + &payer.pubkey(), + &[payer], + ) + .await + .unwrap(); + } + } + + (mint, ata_pubkeys) +} + +#[allow(unused)] +pub async fn create_ata( + rpc: &mut (impl Rpc + Indexer), + payer: &Keypair, + owner: Pubkey, + mint: Pubkey, +) -> Pubkey { + let (ata, _) = derive_token_ata(&owner, &mint); + + let ix = CreateAssociatedTokenAccount::new(payer.pubkey(), owner, mint) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[payer]) + .await + .unwrap(); + + ata +} + +#[allow(unused)] +pub async fn setup_spl_mint( + rpc: &mut (impl Rpc + Indexer), + payer: &Keypair, + decimals: u8, +) -> Pubkey { + let mint_keypair = Keypair::new(); + let mint = mint_keypair.pubkey(); + + let mint_rent = rpc + .get_minimum_balance_for_rent_exemption(SPLMint::LEN) + .await + .unwrap(); + + let create_mint_ix = system_instruction::create_account( + &payer.pubkey(), + &mint, + mint_rent, + SPLMint::LEN as u64, + &spl_token::ID, + ); + + let init_mint_ix = spl_token::instruction::initialize_mint( + &spl_token::ID, + &mint, + &payer.pubkey(), + None, + decimals, + ) + .unwrap(); + + rpc.create_and_send_transaction( + &[create_mint_ix, init_mint_ix], + &payer.pubkey(), + &[payer, &mint_keypair], + ) + .await + .unwrap(); + + let create_interface_ix = + CreateSplInterfacePda::new(payer.pubkey(), mint, spl_token::ID, false) + .instruction(); + + rpc.create_and_send_transaction( + &[create_interface_ix], + &payer.pubkey(), + &[payer], + ) + .await + .unwrap(); + + mint +} + +#[allow(unused)] +pub async fn setup_spl_ata( + rpc: &mut (impl Rpc + Indexer), + payer: &Keypair, + mint: &Pubkey, + owner: &Pubkey, + amount: u64, +) -> Pubkey { + let ata = + spl_associated_token_account::get_associated_token_address(owner, mint); + + let create_ata_ix = + spl_associated_token_account::instruction::create_associated_token_account_idempotent( + &payer.pubkey(), + owner, + mint, + &spl_token::ID, + ); + + let mut ixs = vec![create_ata_ix]; + + if amount > 0 { + let mint_ix = spl_token::instruction::mint_to( + &spl_token::ID, + mint, + &ata, + &payer.pubkey(), + &[], + amount, + ) + .unwrap(); + ixs.push(mint_ix); + } + + rpc.create_and_send_transaction(&ixs, &payer.pubkey(), &[payer]) + .await + .unwrap(); + + ata +} + +#[allow(unused)] +pub fn build_create_ata_cpi_ix( + owner: Pubkey, + mint: Pubkey, + payer: Pubkey, + associated_token_account: Pubkey, + bump: u8, +) -> Instruction { + let data = vec![1u8, bump, 0u8]; + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new_readonly(owner, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new(payer, true), + AccountMeta::new(associated_token_account, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_create_ata_signed_cpi_ix( + owner: Pubkey, + mint: Pubkey, + payer: Pubkey, + associated_token_account: Pubkey, + ata_bump: u8, + authority_bump: u8, +) -> Instruction { + let data = vec![18u8, ata_bump, 0u8, authority_bump]; + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new_readonly(owner, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new(payer, true), + AccountMeta::new(associated_token_account, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_approve_cpi_ix( + token_account: Pubkey, + delegate: Pubkey, + owner: Pubkey, + amount: u64, +) -> Instruction { + let mut data = vec![2u8]; + data.extend_from_slice(&amount.to_le_bytes()); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new_readonly(delegate, false), + AccountMeta::new(owner, true), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_burn_cpi_ix( + source: Pubkey, + mint: Pubkey, + authority: Pubkey, + amount: u64, +) -> Instruction { + let mut data = vec![3u8]; + data.extend_from_slice(&amount.to_le_bytes()); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(source, false), + AccountMeta::new(mint, false), + AccountMeta::new_readonly(authority, true), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_close_cpi_ix( + account: Pubkey, + destination: Pubkey, + owner: Pubkey, + rent_sponsor: Pubkey, +) -> Instruction { + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + AccountMeta::new(account, false), + AccountMeta::new(destination, false), + AccountMeta::new(owner, true), + AccountMeta::new(rent_sponsor, false), + ], + data: vec![4u8], + } +} + +#[allow(unused)] +pub fn build_freeze_cpi_ix( + token_account: Pubkey, + mint: Pubkey, + freeze_authority: Pubkey, +) -> Instruction { + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new_readonly(freeze_authority, true), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data: vec![5u8], + } +} + +#[allow(unused)] +pub fn build_freeze_signed_cpi_ix( + token_account: Pubkey, + mint: Pubkey, + freeze_authority: Pubkey, + bump: u8, +) -> Instruction { + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new_readonly(freeze_authority, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data: vec![15u8, bump], + } +} + +#[allow(unused)] +pub fn build_mint_to_cpi_ix( + mint: Pubkey, + destination: Pubkey, + authority: Pubkey, + amount: u64, +) -> Instruction { + let mut data = vec![6u8]; + data.extend_from_slice(&amount.to_le_bytes()); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint, false), + AccountMeta::new(destination, false), + AccountMeta::new(authority, true), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_revoke_cpi_ix( + token_account: Pubkey, + owner: Pubkey, +) -> Instruction { + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new(owner, true), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data: vec![7u8], + } +} + +#[allow(unused)] +pub fn build_thaw_cpi_ix( + token_account: Pubkey, + mint: Pubkey, + freeze_authority: Pubkey, +) -> Instruction { + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new_readonly(freeze_authority, true), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data: vec![8u8], + } +} + +#[allow(unused)] +pub fn build_thaw_signed_cpi_ix( + token_account: Pubkey, + mint: Pubkey, + freeze_authority: Pubkey, + bump: u8, +) -> Instruction { + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new_readonly(freeze_authority, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data: vec![17u8, bump], + } +} + +#[allow(unused)] +pub fn build_transfer_interface_cpi_ix( + source: Pubkey, + destination: Pubkey, + authority: Pubkey, + payer: Pubkey, + ctoken_authority: Pubkey, + amount: u64, + decimals: u8, +) -> Instruction { + let mut data = vec![9u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(decimals); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(source, false), + AccountMeta::new(destination, false), + AccountMeta::new_readonly(authority, true), + AccountMeta::new(payer, true), + AccountMeta::new_readonly(ctoken_authority, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn get_authority_pda() -> (Pubkey, u8) { + Pubkey::find_program_address(&[b"authority"], &PROGRAM_ID) +} + +#[allow(unused)] +pub fn build_mint_to_signed_cpi_ix( + mint: Pubkey, + destination: Pubkey, + authority: Pubkey, + amount: u64, + bump: u8, +) -> Instruction { + let mut data = vec![10u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint, false), + AccountMeta::new(destination, false), + AccountMeta::new(authority, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_transfer_interface_signed_cpi_ix( + source: Pubkey, + destination: Pubkey, + authority: Pubkey, + payer: Pubkey, + ctoken_authority: Pubkey, + amount: u64, + decimals: u8, + bump: u8, +) -> Instruction { + let mut data = vec![11u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(decimals); + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(source, false), + AccountMeta::new(destination, false), + AccountMeta::new_readonly(authority, false), + AccountMeta::new(payer, true), + AccountMeta::new_readonly(ctoken_authority, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub async fn setup_mint_with_pda_authority( + rpc: &mut (impl Rpc + Indexer), + payer: &Keypair, + pda_authority: Pubkey, + decimals: u8, +) -> Pubkey { + let mint_seed = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + let compression_address = + derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); + let mint = find_mint_address(&mint_seed.pubkey()).0; + + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + let params = CreateMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: pda_authority, + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint, + bump: find_mint_address(&mint_seed.pubkey()).1, + freeze_authority: None, + extensions: None, + rent_payment: 16, + write_top_up: 766, + }; + + let create_mint_ix = CreateMint::new( + params, + mint_seed.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[create_mint_ix], + &payer.pubkey(), + &[payer, &mint_seed], + ) + .await + .unwrap(); + + mint +} + +#[allow(unused)] +pub async fn setup_pda_owned_ata( + rpc: &mut (impl Rpc + Indexer), + payer: &Keypair, + pda_owner: Pubkey, + amount: u64, +) -> (Pubkey, Pubkey) { + let (mint, _) = + setup_mint_with_tokens(rpc, payer, payer.pubkey(), None, 9, vec![]) + .await; + + let ata = create_ata(rpc, payer, pda_owner, mint).await; + + if amount > 0 { + let mint_to_ix = MintTo { + mint, + destination: ata, + amount, + authority: payer.pubkey(), + max_top_up: None, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[mint_to_ix], + &payer.pubkey(), + &[payer], + ) + .await + .unwrap(); + } + + (mint, ata) +} + +#[allow(unused)] +pub fn build_approve_signed_cpi_ix( + token_account: Pubkey, + delegate: Pubkey, + owner: Pubkey, + amount: u64, + bump: u8, +) -> Instruction { + let mut data = vec![12u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new_readonly(delegate, false), + AccountMeta::new(owner, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_burn_signed_cpi_ix( + source: Pubkey, + mint: Pubkey, + authority: Pubkey, + amount: u64, + bump: u8, +) -> Instruction { + let mut data = vec![13u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(source, false), + AccountMeta::new(mint, false), + AccountMeta::new_readonly(authority, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_close_signed_cpi_ix( + account: Pubkey, + destination: Pubkey, + owner: Pubkey, + rent_sponsor: Pubkey, + bump: u8, +) -> Instruction { + let mut data = vec![14u8]; + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + AccountMeta::new(account, false), + AccountMeta::new(destination, false), + AccountMeta::new(owner, false), + AccountMeta::new(rent_sponsor, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_revoke_signed_cpi_ix( + token_account: Pubkey, + owner: Pubkey, + bump: u8, +) -> Instruction { + let mut data = vec![16u8]; + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(token_account, false), + AccountMeta::new(owner, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_create_token_account_cpi_ix( + payer: Pubkey, + account: Pubkey, + mint: Pubkey, + owner: Pubkey, +) -> Instruction { + let mut data = vec![20u8]; + data.extend_from_slice(&owner.to_bytes()); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(payer, true), + AccountMeta::new(account, true), + AccountMeta::new_readonly(mint, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_create_token_account_signed_cpi_ix( + payer: Pubkey, + account: Pubkey, + mint: Pubkey, + owner: Pubkey, + authority_bump: u8, +) -> Instruction { + let mut data = vec![21u8]; + data.extend_from_slice(&owner.to_bytes()); + data.push(authority_bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(payer, true), + AccountMeta::new(account, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} diff --git a/program-examples/native/program/tests/thaw.rs b/program-examples/native/program/tests/thaw.rs new file mode 100644 index 00000000..6389c3c9 --- /dev/null +++ b/program-examples/native/program/tests/thaw.rs @@ -0,0 +1,59 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_freeze_signed_cpi_ix, build_thaw_cpi_ix, build_thaw_signed_cpi_ix, + create_ata, create_test_rpc, get_authority_pda, setup_frozen, + setup_mint_with_tokens, SetupContext, +}; +use solana_sdk::signer::Signer; + +#[tokio::test(flavor = "multi_thread")] +async fn thaw_cpi() { + // Setup: create mint, ATA, and freeze account + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup_frozen().await; + + let ix = build_thaw_cpi_ix(ata, mint, payer.pubkey()); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn thaw_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_authority, bump) = get_authority_pda(); + + let (mint, _) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + Some(pda_authority), + 9, + vec![], + ) + .await; + + let ata = create_ata(&mut rpc, &payer, payer.pubkey(), mint).await; + + // Freeze first using PDA authority + let freeze_ix = build_freeze_signed_cpi_ix(ata, mint, pda_authority, bump); + rpc.create_and_send_transaction(&[freeze_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Then thaw using PDA authority + let thaw_ix = build_thaw_signed_cpi_ix(ata, mint, pda_authority, bump); + rpc.create_and_send_transaction(&[thaw_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/program/tests/transfer.rs b/program-examples/native/program/tests/transfer.rs new file mode 100644 index 00000000..bc37ccdd --- /dev/null +++ b/program-examples/native/program/tests/transfer.rs @@ -0,0 +1,78 @@ +mod shared; + +use light_client::rpc::Rpc; +use light_token::instruction::cpi_authority; +use shared::{ + build_transfer_interface_cpi_ix, build_transfer_interface_signed_cpi_ix, + create_ata, create_test_rpc, get_authority_pda, setup, setup_pda_owned_ata, + SetupContext, +}; +use solana_sdk::{signature::Keypair, signer::Signer}; + +#[tokio::test(flavor = "multi_thread")] +async fn transfer_interface_cpi() { + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup().await; + + let transfer_amount = 500_000u64; + + // Setup: create mint and token accounts + let recipient = Keypair::new(); + let recipient_ata = + create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + + // 1. Transfer from source to destination + let ix = build_transfer_interface_cpi_ix( + ata, + recipient_ata, + payer.pubkey(), + payer.pubkey(), + cpi_authority(), + transfer_amount, + 9, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn transfer_interface_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_authority, bump) = get_authority_pda(); + let initial_amount = 1_000_000u64; + + // Setup: create mint and token accounts + let (mint, pda_ata) = + setup_pda_owned_ata(&mut rpc, &payer, pda_authority, initial_amount) + .await; + + let recipient = Keypair::new(); + let recipient_ata = + create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + + let transfer_amount = 500_000u64; + // 1. Transfer from source to destination + let ix = build_transfer_interface_signed_cpi_ix( + pda_ata, + recipient_ata, + pda_authority, + payer.pubkey(), + cpi_authority(), + transfer_amount, + 9, + bump, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/rust-toolchain.toml b/program-examples/native/rust-toolchain.toml new file mode 100644 index 00000000..41c4d3b5 --- /dev/null +++ b/program-examples/native/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.90.0" +components = ["rustfmt", "clippy"] + diff --git a/program-examples/native/rustfmt.toml b/program-examples/native/rustfmt.toml new file mode 100644 index 00000000..df99c691 --- /dev/null +++ b/program-examples/native/rustfmt.toml @@ -0,0 +1 @@ +max_width = 80 From e773b956e8cc14ba6a180e64c18914ab5d18f7a2 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 23 Jan 2026 10:26:55 +0000 Subject: [PATCH 02/12] refactor: address PR review comments - Format account destructuring across multiple lines for readability - Remove program-keypair.json (should not be committed) - Remove AI index line from README - Use authority_seeds! macro consistently in create_token_account.rs and create_mint.rs --- program-examples/native/README.md | 2 - .../native/program/program-keypair.json | 1 - .../program/src/instructions/create_ata.rs | 24 +++++++++-- .../program/src/instructions/create_mint.rs | 41 ++++++++++++++++--- .../src/instructions/create_token_account.rs | 31 +++++++++++--- .../src/instructions/transfer_interface.rs | 22 ++++++++-- 6 files changed, 99 insertions(+), 22 deletions(-) delete mode 100644 program-examples/native/program/program-keypair.json diff --git a/program-examples/native/README.md b/program-examples/native/README.md index 96e7f9a5..1237968a 100644 --- a/program-examples/native/README.md +++ b/program-examples/native/README.md @@ -55,5 +55,3 @@ The Light Protocol programs are audited and deployed on Solana devnet and mainne ## Documentation Learn more [about Light-Token here](https://www.zkcompression.com/light-token/welcome). - -For your AI to index this repo: [AI Index](CLAUDE.md), [Flow Diagram](flow.mermaid), [State Machine Diagram](states.mermaid) \ No newline at end of file diff --git a/program-examples/native/program/program-keypair.json b/program-examples/native/program/program-keypair.json deleted file mode 100644 index 01413b4a..00000000 --- a/program-examples/native/program/program-keypair.json +++ /dev/null @@ -1 +0,0 @@ -[98,137,217,164,40,12,54,163,211,144,69,31,15,146,79,109,147,77,230,19,249,138,135,164,193,208,220,17,170,10,68,254,2,235,20,231,113,51,9,96,121,178,130,245,175,252,67,126,190,112,168,40,128,240,73,137,143,106,113,169,66,240,201,209] \ No newline at end of file diff --git a/program-examples/native/program/src/instructions/create_ata.rs b/program-examples/native/program/src/instructions/create_ata.rs index c6df8efc..16e88ede 100644 --- a/program-examples/native/program/src/instructions/create_ata.rs +++ b/program-examples/native/program/src/instructions/create_ata.rs @@ -6,8 +6,16 @@ use solana_program::{ }; pub fn create_ata_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [owner, mint, payer, associated_token_account, system_program, compressible_config, rent_sponsor, _token_program] = - accounts + let [ + owner, + mint, + payer, + associated_token_account, + system_program, + compressible_config, + rent_sponsor, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -44,8 +52,16 @@ pub fn create_ata_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult } pub fn create_ata_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [owner, mint, payer, associated_token_account, system_program, compressible_config, rent_sponsor, _token_program] = - accounts + let [ + owner, + mint, + payer, + associated_token_account, + system_program, + compressible_config, + rent_sponsor, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; diff --git a/program-examples/native/program/src/instructions/create_mint.rs b/program-examples/native/program/src/instructions/create_mint.rs index f9ebdd2a..09db12af 100644 --- a/program-examples/native/program/src/instructions/create_mint.rs +++ b/program-examples/native/program/src/instructions/create_mint.rs @@ -1,3 +1,4 @@ +use super::authority_seeds; use borsh::BorshDeserialize; use light_token_interface::instructions::extensions::{ token_metadata::TokenMetadataInstructionData, ExtensionInstructionData, @@ -29,8 +30,23 @@ struct CreateMintData { } pub fn create_mint_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = - accounts + let [ + mint_seed, + authority, + payer, + address_tree, + output_queue, + compressible_config, + mint, + rent_sponsor, + light_system_program, + cpi_authority_pda, + registered_program_pda, + account_compression_authority, + account_compression_program, + system_program, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -118,8 +134,23 @@ struct CreateMintSignedData { } pub fn create_mint_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = - accounts + let [ + mint_seed, + authority, + payer, + address_tree, + output_queue, + compressible_config, + mint, + rent_sponsor, + light_system_program, + cpi_authority_pda, + registered_program_pda, + account_compression_authority, + account_compression_program, + system_program, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -127,7 +158,7 @@ pub fn create_mint_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> Progr let ix_data = CreateMintSignedData::deserialize(&mut &data[..]) .map_err(|_| ProgramError::InvalidInstructionData)?; - let signer_seeds: &[&[u8]] = &[b"authority", &[ix_data.authority_bump]]; + let signer_seeds = authority_seeds!(ix_data.authority_bump); // Build token metadata extension if metadata fields are provided let extensions = match ( diff --git a/program-examples/native/program/src/instructions/create_token_account.rs b/program-examples/native/program/src/instructions/create_token_account.rs index 9f0659d4..2df2f6a9 100644 --- a/program-examples/native/program/src/instructions/create_token_account.rs +++ b/program-examples/native/program/src/instructions/create_token_account.rs @@ -1,3 +1,4 @@ +use super::authority_seeds; use light_token::instruction::CreateTokenAccountCpi; use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, @@ -13,8 +14,15 @@ use solana_program::{ /// - accounts[5]: rent_sponsor (mut) /// - accounts[6]: light_token_program (readonly) pub fn create_token_account_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [payer, account, mint, compressible_config, system_program, rent_sponsor, token_program] = - accounts + let [ + payer, + account, + mint, + compressible_config, + system_program, + rent_sponsor, + token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -41,9 +49,20 @@ pub fn create_token_account_invoke(accounts: &[AccountInfo], data: &[u8]) -> Pro .invoke() } -pub fn create_token_account_invoke_signed(program_id: &Pubkey, accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [payer, account, mint, compressible_config, system_program, rent_sponsor, _token_program] = - accounts +pub fn create_token_account_invoke_signed( + program_id: &Pubkey, + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [ + payer, + account, + mint, + compressible_config, + system_program, + rent_sponsor, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -55,7 +74,7 @@ pub fn create_token_account_invoke_signed(program_id: &Pubkey, accounts: &[Accou let owner = Pubkey::try_from(&data[0..32]) .map_err(|_| ProgramError::InvalidInstructionData)?; let authority_bump = data[32]; - let signer_seeds: &[&[u8]] = &[b"authority", &[authority_bump]]; + let signer_seeds = authority_seeds!(authority_bump); CreateTokenAccountCpi { payer: payer.clone(), diff --git a/program-examples/native/program/src/instructions/transfer_interface.rs b/program-examples/native/program/src/instructions/transfer_interface.rs index 6e7c87f3..54431353 100644 --- a/program-examples/native/program/src/instructions/transfer_interface.rs +++ b/program-examples/native/program/src/instructions/transfer_interface.rs @@ -6,8 +6,15 @@ use solana_program::{ }; pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = - accounts + let [ + source, + destination, + authority, + payer, + ctoken_authority, + system_program, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -33,8 +40,15 @@ pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { } pub fn transfer_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = - accounts + let [ + source, + destination, + authority, + payer, + ctoken_authority, + system_program, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; From 74ed3eb47e47a79ed9f57782643ef9cada48d94b Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 23 Jan 2026 12:42:37 +0000 Subject: [PATCH 03/12] refactor: use CreateAccountsProof in create_mint.rs Replace manual proof fields (proof_a, proof_b, proof_c, address_merkle_tree_root_index) with CreateAccountsProof struct from light-compressible crate for cleaner serialization. --- program-examples/native/Cargo.lock | 4 +++ program-examples/native/program/Cargo.toml | 1 + .../program/src/instructions/create_mint.rs | 28 +++++-------------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/program-examples/native/Cargo.lock b/program-examples/native/Cargo.lock index 04682160..3802b227 100644 --- a/program-examples/native/Cargo.lock +++ b/program-examples/native/Cargo.lock @@ -2603,7 +2603,10 @@ dependencies = [ "light-sdk-types", "light-zero-copy 0.6.0", "pinocchio-pubkey", + "solana-msg", + "solana-program-error", "solana-pubkey", + "solana-sysvar", "thiserror 2.0.17", "zerocopy", ] @@ -2958,6 +2961,7 @@ dependencies = [ "blake3", "borsh 0.10.4", "light-client", + "light-compressible", "light-program-test", "light-token", "light-token-interface", diff --git a/program-examples/native/program/Cargo.toml b/program-examples/native/program/Cargo.toml index a1655954..6023575c 100644 --- a/program-examples/native/program/Cargo.toml +++ b/program-examples/native/program/Cargo.toml @@ -14,6 +14,7 @@ default = [] [dependencies] light-token = "0.3.0" light-token-interface = "0.2.0" +light-compressible = "0.3" solana-program = "2.2" borsh = "0.10.4" diff --git a/program-examples/native/program/src/instructions/create_mint.rs b/program-examples/native/program/src/instructions/create_mint.rs index 09db12af..8d12ad9e 100644 --- a/program-examples/native/program/src/instructions/create_mint.rs +++ b/program-examples/native/program/src/instructions/create_mint.rs @@ -1,10 +1,10 @@ use super::authority_seeds; use borsh::BorshDeserialize; +use light_compressible::CreateAccountsProof; use light_token_interface::instructions::extensions::{ token_metadata::TokenMetadataInstructionData, ExtensionInstructionData, }; use light_token::instruction::{CreateMintCpi, CreateMintParams, SystemAccountInfos}; -use light_token::CompressedProof; use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, @@ -13,11 +13,8 @@ use solana_program::{ #[derive(BorshDeserialize)] struct CreateMintData { decimals: u8, - address_merkle_tree_root_index: u16, mint_authority: Pubkey, - proof_a: [u8; 32], - proof_b: [u8; 64], - proof_c: [u8; 32], + create_accounts_proof: CreateAccountsProof, compression_address: [u8; 32], mint: Pubkey, bump: u8, @@ -74,13 +71,9 @@ pub fn create_mint_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResul let params = CreateMintParams { decimals: ix_data.decimals, - address_merkle_tree_root_index: ix_data.address_merkle_tree_root_index, + address_merkle_tree_root_index: ix_data.create_accounts_proof.address_tree_info.root_index, mint_authority: ix_data.mint_authority, - proof: CompressedProof { - a: ix_data.proof_a, - b: ix_data.proof_b, - c: ix_data.proof_c, - }, + proof: ix_data.create_accounts_proof.proof.0.unwrap_or_default(), compression_address: ix_data.compression_address, mint: ix_data.mint, bump: ix_data.bump, @@ -117,10 +110,7 @@ pub fn create_mint_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResul #[derive(BorshDeserialize)] struct CreateMintSignedData { decimals: u8, - address_merkle_tree_root_index: u16, - proof_a: [u8; 32], - proof_b: [u8; 64], - proof_c: [u8; 32], + create_accounts_proof: CreateAccountsProof, compression_address: [u8; 32], mint: Pubkey, bump: u8, @@ -180,13 +170,9 @@ pub fn create_mint_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> Progr let params = CreateMintParams { decimals: ix_data.decimals, - address_merkle_tree_root_index: ix_data.address_merkle_tree_root_index, + address_merkle_tree_root_index: ix_data.create_accounts_proof.address_tree_info.root_index, mint_authority: *authority.key, - proof: CompressedProof { - a: ix_data.proof_a, - b: ix_data.proof_b, - c: ix_data.proof_c, - }, + proof: ix_data.create_accounts_proof.proof.0.unwrap_or_default(), compression_address: ix_data.compression_address, mint: ix_data.mint, bump: ix_data.bump, From 16918a9eac8d17d2a3f09be3d2fe3f53c2d34942 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 23 Jan 2026 17:08:05 +0000 Subject: [PATCH 04/12] first test passes --- program-examples/native/Cargo.lock | 378 ++++++++++++------ program-examples/native/program/Cargo.toml | 14 +- .../program/src/instructions/approve.rs | 5 +- .../native/program/src/instructions/burn.rs | 13 +- .../native/program/src/instructions/close.rs | 9 +- .../program/src/instructions/create_ata.rs | 34 +- .../program/src/instructions/create_mint.rs | 104 +++-- .../src/instructions/create_token_account.rs | 30 +- .../native/program/src/instructions/freeze.rs | 5 +- .../program/src/instructions/mint_to.rs | 7 +- .../native/program/src/instructions/mod.rs | 4 +- .../native/program/src/instructions/revoke.rs | 5 +- .../native/program/src/instructions/thaw.rs | 5 +- .../src/instructions/transfer_interface.rs | 27 +- .../native/program/tests/approve.rs | 70 +++- program-examples/native/program/tests/burn.rs | 62 +++ .../program/tests/create_token_account.rs | 15 +- .../native/program/tests/freeze.rs | 34 ++ .../native/program/tests/mint_to.rs | 198 +++------ .../native/program/tests/shared.rs | 150 ++----- .../native/program/tests/transfer.rs | 37 ++ 21 files changed, 695 insertions(+), 511 deletions(-) diff --git a/program-examples/native/Cargo.lock b/program-examples/native/Cargo.lock index 3802b227..5b907481 100644 --- a/program-examples/native/Cargo.lock +++ b/program-examples/native/Cargo.lock @@ -12,6 +12,29 @@ dependencies = [ "regex", ] +[[package]] +name = "account-compression" +version = "2.0.0" +dependencies = [ + "aligned-sized", + "anchor-lang", + "bytemuck", + "light-account-checks", + "light-batched-merkle-tree", + "light-bounded-vec", + "light-compressed-account", + "light-concurrent-merkle-tree", + "light-hash-set", + "light-hasher", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-zero-copy", + "num-bigint 0.4.6", + "solana-sdk", + "solana-security-txt", + "zerocopy", +] + [[package]] name = "adler2" version = "2.0.1" @@ -126,8 +149,6 @@ dependencies = [ [[package]] name = "aligned-sized" version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48a526ec4434d531d488af59fe866f36b310fe8906691c75dffa664450a3800a" dependencies = [ "proc-macro2", "quote", @@ -231,6 +252,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "anchor-compressed-token" +version = "2.0.0" +dependencies = [ + "account-compression", + "anchor-lang", + "anchor-spl", + "light-compressed-account", + "light-hasher", + "light-heap", + "light-system-program-anchor", + "light-token-interface", + "light-zero-copy", + "pinocchio-pubkey", + "solana-sdk", + "solana-security-txt", + "spl-token 7.0.0", + "spl-token-2022 7.0.0", + "zerocopy", +] + [[package]] name = "anchor-derive-accounts" version = "0.31.1" @@ -281,6 +323,7 @@ dependencies = [ "anchor-derive-accounts", "anchor-derive-serde", "anchor-derive-space", + "anchor-lang-idl", "base64 0.21.7", "bincode", "borsh 0.10.4", @@ -298,6 +341,7 @@ dependencies = [ "anchor-lang-idl-spec", "anyhow", "heck 0.3.3", + "regex", "serde", "serde_json", "sha2 0.10.9", @@ -336,6 +380,7 @@ checksum = "5dc7a6d90cc643df0ed2744862cdf180587d1e5d28936538c18fc8908489ed67" dependencies = [ "anyhow", "bs58", + "cargo_toml", "heck 0.3.3", "proc-macro2", "quote", @@ -920,6 +965,16 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +[[package]] +name = "cargo_toml" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" +dependencies = [ + "serde", + "toml 0.8.23", +] + [[package]] name = "cc" version = "1.2.52" @@ -2422,9 +2477,8 @@ dependencies = [ [[package]] name = "light-account-checks" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0785da22cd4a7667583141ca56c790a5c8afa2b22ad2a08204d78881035524e8" dependencies = [ + "pinocchio", "solana-account-info", "solana-msg", "solana-program-error", @@ -2436,8 +2490,6 @@ dependencies = [ [[package]] name = "light-array-map" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859dc5b406a8bf0b114f686e6f2e36d0e939bad6f579492a520d309b52fde1f8" dependencies = [ "tinyvec", ] @@ -2445,19 +2497,17 @@ dependencies = [ [[package]] name = "light-batched-merkle-tree" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13cb8bc778065ee71d1990fdc94112e35dc63a5e387a323284a49f40d123d8e0" dependencies = [ "aligned-sized", "borsh 0.10.4", "light-account-checks", "light-bloom-filter", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-hasher", "light-macros", "light-merkle-tree-metadata", "light-verifier", - "light-zero-copy 0.6.0", + "light-zero-copy", "solana-account-info", "solana-msg", "solana-program-error", @@ -2470,8 +2520,6 @@ dependencies = [ [[package]] name = "light-bloom-filter" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a609e3c9179f0ae8488cc70c5413c86dfd97dad7ad85fee2ad8da2d0a11e61" dependencies = [ "bitvec", "num-bigint 0.4.6", @@ -2495,8 +2543,6 @@ dependencies = [ [[package]] name = "light-client" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1f3cd013364dbe5c45a9e9a8faee1af30dccb600cd56a41e296ed8d5684768" dependencies = [ "anchor-lang", "async-trait", @@ -2505,7 +2551,7 @@ dependencies = [ "bs58", "futures", "lazy_static", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-compressible", "light-concurrent-merkle-tree", "light-event", @@ -2549,38 +2595,55 @@ dependencies = [ [[package]] name = "light-compressed-account" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058df2733fa6a3e4bda6f162a6c5d41f10fc8c6f6ddb992af1de76b60214e4a6" +version = "0.8.0" dependencies = [ + "anchor-lang", "borsh 0.10.4", + "bytemuck", "light-hasher", "light-macros", + "light-poseidon 0.3.0", "light-program-profiler", - "light-zero-copy 0.5.0", + "light-zero-copy", + "pinocchio", + "solana-msg", + "solana-program-error", + "solana-pubkey", "thiserror 2.0.17", "tinyvec", "zerocopy", ] [[package]] -name = "light-compressed-account" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "768ae5a56d8c9cf315d132b3faa5b067f95b3d6a294c579e82f8f0e0bf29c7cc" +name = "light-compressed-token" +version = "2.1.0" dependencies = [ + "account-compression", + "anchor-compressed-token", "anchor-lang", + "arrayvec", + "bitvec", "borsh 0.10.4", - "bytemuck", + "light-account-checks", + "light-array-map", + "light-compressed-account", + "light-compressible", "light-hasher", + "light-heap", "light-macros", - "light-poseidon 0.3.0", "light-program-profiler", - "light-zero-copy 0.6.0", - "solana-msg", - "solana-program-error", + "light-system-program-anchor", + "light-token-interface", + "light-zero-copy", + "pinocchio", + "pinocchio-pubkey", + "pinocchio-system", + "pinocchio-token-program", "solana-pubkey", - "thiserror 2.0.17", + "solana-security-txt", + "spl-pod", + "spl-token 7.0.0", + "spl-token-2022 7.0.0", "tinyvec", "zerocopy", ] @@ -2588,20 +2651,18 @@ dependencies = [ [[package]] name = "light-compressible" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff0f0065beb8d16df587b3ea17082e11dea3f67c98813b4bcc061eecd94561f" dependencies = [ "aligned-sized", "anchor-lang", "borsh 0.10.4", "bytemuck", "light-account-checks", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-hasher", "light-macros", "light-program-profiler", - "light-sdk-types", - "light-zero-copy 0.6.0", + "light-zero-copy", + "pinocchio", "pinocchio-pubkey", "solana-msg", "solana-program-error", @@ -2614,8 +2675,6 @@ dependencies = [ [[package]] name = "light-concurrent-merkle-tree" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db96f47253a0907aaa46dac15cecb27b5510130e48da0b36690dcd2e99a6d558" dependencies = [ "borsh 0.10.4", "light-bounded-vec", @@ -2628,21 +2687,28 @@ dependencies = [ [[package]] name = "light-event" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674c9d85b32a9e8abb90cccdee18e35ae29daa1126fdb81a8a28c0a54802096" dependencies = [ "borsh 0.10.4", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-hasher", - "light-zero-copy 0.6.0", + "light-zero-copy", + "thiserror 2.0.17", +] + +[[package]] +name = "light-hash-set" +version = "4.0.0" +dependencies = [ + "light-hasher", + "num-bigint 0.4.6", + "num-traits", + "solana-program-error", "thiserror 2.0.17", ] [[package]] name = "light-hasher" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c822662e6e109bac0e132a43fd52a4ef684811245a794e048cf9cda001e934c8" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", @@ -2656,11 +2722,16 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "light-heap" +version = "2.0.0" +dependencies = [ + "anchor-lang", +] + [[package]] name = "light-indexed-array" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f14f984030d86b6f07bd8f5ae04e2c40fcd0c3bdfcc7a291fff1ed59c9e6554" dependencies = [ "light-hasher", "num-bigint 0.4.6", @@ -2671,8 +2742,6 @@ dependencies = [ [[package]] name = "light-indexed-merkle-tree" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0824755289075f28de2820fc7d4ec4e6b9e99d404e033c07338b91cce8c71fb8" dependencies = [ "light-bounded-vec", "light-concurrent-merkle-tree", @@ -2687,8 +2756,6 @@ dependencies = [ [[package]] name = "light-macros" version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "179ac51cadc1d0ca047b4d6265a7cc245ca3affc16a20a2749585aa6464d39c2" dependencies = [ "bs58", "proc-macro2", @@ -2700,13 +2767,11 @@ dependencies = [ [[package]] name = "light-merkle-tree-metadata" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d08edcc194eef61b0f499934ce398122d54ac57505d44480e5f079a4220566" dependencies = [ "anchor-lang", "borsh 0.10.4", "bytemuck", - "light-compressed-account 0.8.0", + "light-compressed-account", "solana-msg", "solana-program-error", "solana-sysvar", @@ -2717,8 +2782,6 @@ dependencies = [ [[package]] name = "light-merkle-tree-reference" version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8d480f62ca32b38a6231bbc5310d693f91d6b5bdcc18bb13c2d9aab7a1c90e8" dependencies = [ "light-hasher", "light-indexed-array", @@ -2774,9 +2837,8 @@ dependencies = [ [[package]] name = "light-program-test" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a981dfbc19c529543ab1dd8d100319b89aac053b81415a681d1474c986218307" dependencies = [ + "account-compression", "anchor-lang", "async-trait", "base64 0.13.1", @@ -2784,9 +2846,12 @@ dependencies = [ "bs58", "bytemuck", "chrono", + "light-batched-merkle-tree", "light-client", - "light-compressed-account 0.8.0", + "light-compressed-account", + "light-compressed-token", "light-compressible", + "light-concurrent-merkle-tree", "light-event", "light-hasher", "light-indexed-array", @@ -2794,11 +2859,12 @@ dependencies = [ "light-merkle-tree-metadata", "light-merkle-tree-reference", "light-prover-client", + "light-registry", "light-sdk", "light-sdk-types", "light-token", "light-token-interface", - "light-zero-copy 0.6.0", + "light-zero-copy", "litesvm", "log", "num-bigint 0.4.6", @@ -2826,13 +2892,11 @@ dependencies = [ [[package]] name = "light-prover-client" version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75d8c9b8b6e9d445b9ef27467da592ee231e614282c3c0bd2f30f567eb904845" dependencies = [ "ark-bn254 0.5.0", "ark-serialize 0.5.0", "ark-std 0.5.0", - "light-compressed-account 0.7.0", + "light-compressed-account", "light-hasher", "light-indexed-array", "light-sparse-merkle-tree", @@ -2847,23 +2911,46 @@ dependencies = [ "tracing", ] +[[package]] +name = "light-registry" +version = "2.1.0" +dependencies = [ + "account-compression", + "aligned-sized", + "anchor-lang", + "borsh 0.10.4", + "light-account-checks", + "light-batched-merkle-tree", + "light-compressible", + "light-macros", + "light-merkle-tree-metadata", + "light-program-profiler", + "light-system-program-anchor", + "light-token-interface", + "light-zero-copy", + "solana-account-info", + "solana-instruction", + "solana-pubkey", + "solana-sdk", + "solana-security-txt", + "spl-pod", +] + [[package]] name = "light-sdk" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dece106ebd0897bd23a12bad040e0999d93b54447d0473739f91b1f83b1d331" dependencies = [ "anchor-lang", "bincode", "borsh 0.10.4", "light-account-checks", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-compressible", "light-hasher", "light-macros", "light-sdk-macros", "light-sdk-types", - "light-zero-copy 0.6.0", + "light-zero-copy", "num-bigint 0.4.6", "solana-account-info", "solana-clock", @@ -2881,8 +2968,6 @@ dependencies = [ [[package]] name = "light-sdk-macros" version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "315633f6d8bf736dd2f6cec318b662f1dc507f9d66e52ad35d91270870f6acb6" dependencies = [ "darling", "light-hasher", @@ -2896,13 +2981,11 @@ dependencies = [ [[package]] name = "light-sdk-types" version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b765f0a39428a137b8d449fa60ba147194cdbff08aa0add598c6047fff2cb7d2" dependencies = [ "anchor-lang", "borsh 0.10.4", "light-account-checks", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-hasher", "light-macros", "solana-msg", @@ -2912,8 +2995,6 @@ dependencies = [ [[package]] name = "light-sparse-merkle-tree" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4251e79b6c63f4946572dcfd7623680ad0f9e0efe1a761a944733333c5645063" dependencies = [ "light-hasher", "light-indexed-array", @@ -2922,18 +3003,28 @@ dependencies = [ "thiserror 2.0.17", ] +[[package]] +name = "light-system-program-anchor" +version = "2.0.0" +dependencies = [ + "account-compression", + "aligned-sized", + "anchor-lang", + "light-compressed-account", + "light-zero-copy", + "zerocopy", +] + [[package]] name = "light-token" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62907a12a9801200e5f4c03bb7f2dbdd9aa679223a959167c456a06005291d79" dependencies = [ "anchor-lang", "arrayvec", "borsh 0.10.4", "light-account-checks", "light-batched-merkle-tree", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-compressible", "light-macros", "light-program-profiler", @@ -2942,7 +3033,7 @@ dependencies = [ "light-sdk-types", "light-token-interface", "light-token-types", - "light-zero-copy 0.6.0", + "light-zero-copy", "solana-account-info", "solana-cpi", "solana-instruction", @@ -2961,8 +3052,10 @@ dependencies = [ "blake3", "borsh 0.10.4", "light-client", + "light-compressed-account", "light-compressible", "light-program-test", + "light-sdk-types", "light-token", "light-token-interface", "solana-program", @@ -2976,20 +3069,18 @@ dependencies = [ [[package]] name = "light-token-interface" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fb19b8e268a0154a8e13b3a8f6f43fa4928643e2de102d98a90b2af21f482ba" dependencies = [ "aligned-sized", "anchor-lang", "borsh 0.10.4", "bytemuck", "light-array-map", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-compressible", "light-hasher", "light-macros", "light-program-profiler", - "light-zero-copy 0.6.0", + "light-zero-copy", "pinocchio", "pinocchio-pubkey", "solana-account-info", @@ -3004,13 +3095,11 @@ dependencies = [ [[package]] name = "light-token-types" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278dddbf18d104f1225c480ca6d7b8710e1f9ff4104f24be70c522ecb6ed1dfc" dependencies = [ "anchor-lang", "borsh 0.10.4", "light-account-checks", - "light-compressed-account 0.8.0", + "light-compressed-account", "light-macros", "light-sdk-types", "solana-msg", @@ -3020,52 +3109,24 @@ dependencies = [ [[package]] name = "light-verifier" version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f35f47736be493b60d8b56ef0c8e94afd6a99efafebb257f62b0b545e9aacab" dependencies = [ "groth16-solana", - "light-compressed-account 0.8.0", + "light-compressed-account", "thiserror 2.0.17", ] -[[package]] -name = "light-zero-copy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8862f463792fd60ae8f5dc418150c16213e302e19d54fba0694cf8515be5ff" -dependencies = [ - "light-zero-copy-derive 0.5.0", - "zerocopy", -] - [[package]] name = "light-zero-copy" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5621fb515e14af46148699c0b65334aabe230a1d2cbd06736ccc7a408c8a4af" dependencies = [ - "light-zero-copy-derive 0.6.0", + "light-zero-copy-derive", "solana-program-error", "zerocopy", ] -[[package]] -name = "light-zero-copy-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af086d52100b3cab1f2993b146adc7a69fa6aaa878ae4c19514c77c50304379" -dependencies = [ - "lazy_static", - "proc-macro2", - "quote", - "syn 2.0.114", -] - [[package]] name = "light-zero-copy-derive" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c46425e5c7ab5203ff5c86ae2615b169cca55f9283f5f60f5dd74143be6934" dependencies = [ "lazy_static", "proc-macro2", @@ -3543,8 +3604,6 @@ dependencies = [ [[package]] name = "photon-api" version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e572dba0c255f5b8176f15b9e849330d915a8927804f7f9702d5bbbc70e4a1ad" dependencies = [ "reqwest 0.12.28", "serde", @@ -3593,6 +3652,12 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b971851087bc3699b001954ad02389d50c41405ece3548cbcafc88b3e20017a" +[[package]] +name = "pinocchio-log" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd11022408f312e6179ece321c1f7dc0d1b2aa7765fddd39b2a7378d65a899e8" + [[package]] name = "pinocchio-pubkey" version = "0.3.0" @@ -3604,6 +3669,35 @@ dependencies = [ "sha2-const-stable", ] +[[package]] +name = "pinocchio-system" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141ed5eafb4ab04568bb0e224e3dc9a9de13c933de4c004e0d1a553498be3a7c" +dependencies = [ + "pinocchio", + "pinocchio-pubkey", +] + +[[package]] +name = "pinocchio-token-interface" +version = "0.0.0" +source = "git+https://github.com/Lightprotocol/token?rev=f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3#f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3" +dependencies = [ + "pinocchio", + "pinocchio-pubkey", +] + +[[package]] +name = "pinocchio-token-program" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/token?rev=f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3#f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3" +dependencies = [ + "pinocchio", + "pinocchio-log", + "pinocchio-token-interface", +] + [[package]] name = "pkg-config" version = "0.3.32" @@ -3658,7 +3752,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml", + "toml 0.5.11", ] [[package]] @@ -3667,7 +3761,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit", + "toml_edit 0.23.10+spec-1.0.0", ] [[package]] @@ -4347,6 +4441,15 @@ dependencies = [ "zmij", ] +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -7903,6 +8006,27 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + [[package]] name = "toml_datetime" version = "0.7.5+spec-1.1.0" @@ -7912,6 +8036,20 @@ dependencies = [ "serde_core", ] +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap 2.13.0", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + [[package]] name = "toml_edit" version = "0.23.10+spec-1.0.0" @@ -7919,7 +8057,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ "indexmap 2.13.0", - "toml_datetime", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "winnow", ] @@ -7933,6 +8071,12 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "tower" version = "0.5.3" diff --git a/program-examples/native/program/Cargo.toml b/program-examples/native/program/Cargo.toml index 6023575c..75549e6f 100644 --- a/program-examples/native/program/Cargo.toml +++ b/program-examples/native/program/Cargo.toml @@ -12,16 +12,18 @@ test-sbf = [] default = [] [dependencies] -light-token = "0.3.0" -light-token-interface = "0.2.0" -light-compressible = "0.3" +light-token = { path = "../../../../light-protocol/sdk-libs/token-sdk" } +light-token-interface = { path = "../../../../light-protocol/program-libs/token-interface" } +light-compressible = { path = "../../../../light-protocol/program-libs/compressible" } solana-program = "2.2" borsh = "0.10.4" [dev-dependencies] -light-program-test = { version = "0.18.0", features = ["v2"] } -light-client = { version = "0.18.0", features = ["v2"] } -light-token-interface = "0.2.0" +light-program-test = { path = "../../../../light-protocol/sdk-libs/program-test", features = ["v2", "devenv"] } +light-client = { path = "../../../../light-protocol/sdk-libs/client", features = ["v2"] } +light-token-interface = { path = "../../../../light-protocol/program-libs/token-interface" } +light-compressed-account = { path = "../../../../light-protocol/program-libs/compressed-account" } +light-sdk-types = { path = "../../../../light-protocol/sdk-libs/sdk-types" } tokio = { version = "1", features = ["full"] } solana-sdk = "2" anchor-spl = "0.31" diff --git a/program-examples/native/program/src/instructions/approve.rs b/program-examples/native/program/src/instructions/approve.rs index c58e55ff..bfce06dd 100644 --- a/program-examples/native/program/src/instructions/approve.rs +++ b/program-examples/native/program/src/instructions/approve.rs @@ -27,7 +27,10 @@ pub fn approve_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { .invoke() } -pub fn approve_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { +pub fn approve_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { let [token_account, delegate, owner, system_program, _token_program] = accounts else { diff --git a/program-examples/native/program/src/instructions/burn.rs b/program-examples/native/program/src/instructions/burn.rs index 764c1fd8..412aafc3 100644 --- a/program-examples/native/program/src/instructions/burn.rs +++ b/program-examples/native/program/src/instructions/burn.rs @@ -6,7 +6,7 @@ use solana_program::{ }; pub fn burn_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [source, mint, authority, _token_program] = accounts else { + let [source, mint, authority, system_program, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -20,13 +20,18 @@ pub fn burn_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { mint: mint.clone(), amount, authority: authority.clone(), + system_program: system_program.clone(), + fee_payer: None, max_top_up: None, } .invoke() } -pub fn burn_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [source, mint, authority, _token_program] = accounts else { +pub fn burn_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [source, mint, authority, system_program, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -43,6 +48,8 @@ pub fn burn_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResul mint: mint.clone(), amount, authority: authority.clone(), + system_program: system_program.clone(), + fee_payer: None, max_top_up: None, } .invoke_signed(&[signer_seeds]) diff --git a/program-examples/native/program/src/instructions/close.rs b/program-examples/native/program/src/instructions/close.rs index 2d1770ea..00c27402 100644 --- a/program-examples/native/program/src/instructions/close.rs +++ b/program-examples/native/program/src/instructions/close.rs @@ -6,7 +6,7 @@ use solana_program::{ }; pub fn close_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { - let [token_program, account, destination, owner, rent_sponsor] = accounts + let [account, destination, owner, rent_sponsor, token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -21,8 +21,11 @@ pub fn close_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { .invoke() } -pub fn close_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [token_program, account, destination, owner, rent_sponsor] = accounts +pub fn close_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [account, destination, owner, rent_sponsor, token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; diff --git a/program-examples/native/program/src/instructions/create_ata.rs b/program-examples/native/program/src/instructions/create_ata.rs index 16e88ede..b3478125 100644 --- a/program-examples/native/program/src/instructions/create_ata.rs +++ b/program-examples/native/program/src/instructions/create_ata.rs @@ -5,17 +5,12 @@ use solana_program::{ program_error::ProgramError, }; -pub fn create_ata_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [ - owner, - mint, - payer, - associated_token_account, - system_program, - compressible_config, - rent_sponsor, - _token_program, - ] = accounts +pub fn create_ata_invoke( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [owner, mint, payer, associated_token_account, system_program, compressible_config, rent_sponsor, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -51,17 +46,12 @@ pub fn create_ata_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult .invoke() } -pub fn create_ata_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [ - owner, - mint, - payer, - associated_token_account, - system_program, - compressible_config, - rent_sponsor, - _token_program, - ] = accounts +pub fn create_ata_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [owner, mint, payer, associated_token_account, system_program, compressible_config, rent_sponsor, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; diff --git a/program-examples/native/program/src/instructions/create_mint.rs b/program-examples/native/program/src/instructions/create_mint.rs index 8d12ad9e..947526ba 100644 --- a/program-examples/native/program/src/instructions/create_mint.rs +++ b/program-examples/native/program/src/instructions/create_mint.rs @@ -1,10 +1,12 @@ use super::authority_seeds; use borsh::BorshDeserialize; use light_compressible::CreateAccountsProof; +use light_token::instruction::{ + CreateMintCpi, CreateMintParams, SystemAccountInfos, +}; use light_token_interface::instructions::extensions::{ token_metadata::TokenMetadataInstructionData, ExtensionInstructionData, }; -use light_token::instruction::{CreateMintCpi, CreateMintParams, SystemAccountInfos}; use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey, @@ -26,24 +28,12 @@ struct CreateMintData { metadata_uri: Option>, } -pub fn create_mint_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [ - mint_seed, - authority, - payer, - address_tree, - output_queue, - compressible_config, - mint, - rent_sponsor, - light_system_program, - cpi_authority_pda, - registered_program_pda, - account_compression_authority, - account_compression_program, - system_program, - _token_program, - ] = accounts +pub fn create_mint_invoke( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -57,21 +47,28 @@ pub fn create_mint_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResul &ix_data.metadata_symbol, &ix_data.metadata_uri, ) { - (Some(name), Some(symbol), Some(uri)) => Some(vec![ExtensionInstructionData::TokenMetadata( - TokenMetadataInstructionData { - update_authority: Some(ix_data.mint_authority.to_bytes().into()), - name: name.clone(), - symbol: symbol.clone(), - uri: uri.clone(), - additional_metadata: None, - }, - )]), + (Some(name), Some(symbol), Some(uri)) => { + Some(vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some( + ix_data.mint_authority.to_bytes().into(), + ), + name: name.clone(), + symbol: symbol.clone(), + uri: uri.clone(), + additional_metadata: None, + }, + )]) + } _ => None, }; let params = CreateMintParams { decimals: ix_data.decimals, - address_merkle_tree_root_index: ix_data.create_accounts_proof.address_tree_info.root_index, + address_merkle_tree_root_index: ix_data + .create_accounts_proof + .address_tree_info + .root_index, mint_authority: ix_data.mint_authority, proof: ix_data.create_accounts_proof.proof.0.unwrap_or_default(), compression_address: ix_data.compression_address, @@ -123,24 +120,12 @@ struct CreateMintSignedData { metadata_uri: Option>, } -pub fn create_mint_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [ - mint_seed, - authority, - payer, - address_tree, - output_queue, - compressible_config, - mint, - rent_sponsor, - light_system_program, - cpi_authority_pda, - registered_program_pda, - account_compression_authority, - account_compression_program, - system_program, - _token_program, - ] = accounts +pub fn create_mint_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -156,21 +141,26 @@ pub fn create_mint_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> Progr &ix_data.metadata_symbol, &ix_data.metadata_uri, ) { - (Some(name), Some(symbol), Some(uri)) => Some(vec![ExtensionInstructionData::TokenMetadata( - TokenMetadataInstructionData { - update_authority: Some(authority.key.to_bytes().into()), - name: name.clone(), - symbol: symbol.clone(), - uri: uri.clone(), - additional_metadata: None, - }, - )]), + (Some(name), Some(symbol), Some(uri)) => { + Some(vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some(authority.key.to_bytes().into()), + name: name.clone(), + symbol: symbol.clone(), + uri: uri.clone(), + additional_metadata: None, + }, + )]) + } _ => None, }; let params = CreateMintParams { decimals: ix_data.decimals, - address_merkle_tree_root_index: ix_data.create_accounts_proof.address_tree_info.root_index, + address_merkle_tree_root_index: ix_data + .create_accounts_proof + .address_tree_info + .root_index, mint_authority: *authority.key, proof: ix_data.create_accounts_proof.proof.0.unwrap_or_default(), compression_address: ix_data.compression_address, diff --git a/program-examples/native/program/src/instructions/create_token_account.rs b/program-examples/native/program/src/instructions/create_token_account.rs index 2df2f6a9..ab4e4f62 100644 --- a/program-examples/native/program/src/instructions/create_token_account.rs +++ b/program-examples/native/program/src/instructions/create_token_account.rs @@ -13,16 +13,12 @@ use solana_program::{ /// - accounts[4]: system_program (readonly) /// - accounts[5]: rent_sponsor (mut) /// - accounts[6]: light_token_program (readonly) -pub fn create_token_account_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [ - payer, - account, - mint, - compressible_config, - system_program, - rent_sponsor, - token_program, - ] = accounts +pub fn create_token_account_invoke( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [payer, account, mint, compressible_config, system_program, rent_sponsor, token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -50,19 +46,11 @@ pub fn create_token_account_invoke(accounts: &[AccountInfo], data: &[u8]) -> Pro } pub fn create_token_account_invoke_signed( - program_id: &Pubkey, accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [ - payer, - account, - mint, - compressible_config, - system_program, - rent_sponsor, - _token_program, - ] = accounts + let [payer, account, mint, compressible_config, system_program, rent_sponsor, token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -86,7 +74,7 @@ pub fn create_token_account_invoke_signed( compressible_config.clone(), rent_sponsor.clone(), system_program.clone(), - program_id, + token_program.key, ) .invoke_signed(signer_seeds) } diff --git a/program-examples/native/program/src/instructions/freeze.rs b/program-examples/native/program/src/instructions/freeze.rs index cba0e134..a6345988 100644 --- a/program-examples/native/program/src/instructions/freeze.rs +++ b/program-examples/native/program/src/instructions/freeze.rs @@ -19,7 +19,10 @@ pub fn freeze_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { .invoke() } -pub fn freeze_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { +pub fn freeze_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { let [token_account, mint, freeze_authority, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); diff --git a/program-examples/native/program/src/instructions/mint_to.rs b/program-examples/native/program/src/instructions/mint_to.rs index 62799312..4181f4fb 100644 --- a/program-examples/native/program/src/instructions/mint_to.rs +++ b/program-examples/native/program/src/instructions/mint_to.rs @@ -23,12 +23,16 @@ pub fn mint_to_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { amount, authority: authority.clone(), system_program: system_program.clone(), + fee_payer: None, max_top_up: None, } .invoke() } -pub fn mint_to_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { +pub fn mint_to_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { let [mint, destination, authority, system_program, _token_program] = accounts else { @@ -49,6 +53,7 @@ pub fn mint_to_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramRe amount, authority: authority.clone(), system_program: system_program.clone(), + fee_payer: None, max_top_up: None, } .invoke_signed(&[signer_seeds]) diff --git a/program-examples/native/program/src/instructions/mod.rs b/program-examples/native/program/src/instructions/mod.rs index 749c924a..9f099a33 100644 --- a/program-examples/native/program/src/instructions/mod.rs +++ b/program-examples/native/program/src/instructions/mod.rs @@ -52,7 +52,9 @@ pub fn process( 18 => create_ata::create_ata_invoke_signed(accounts, data), 19 => create_mint::create_mint_invoke_signed(accounts, data), 20 => create_token_account::create_token_account_invoke(accounts, data), - 21 => create_token_account::create_token_account_invoke_signed(program_id, accounts, data), + 21 => create_token_account::create_token_account_invoke_signed( + accounts, data, + ), _ => Err( solana_program::program_error::ProgramError::InvalidInstructionData, ), diff --git a/program-examples/native/program/src/instructions/revoke.rs b/program-examples/native/program/src/instructions/revoke.rs index c68dc0d7..4e2fb02c 100644 --- a/program-examples/native/program/src/instructions/revoke.rs +++ b/program-examples/native/program/src/instructions/revoke.rs @@ -19,7 +19,10 @@ pub fn revoke_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { .invoke() } -pub fn revoke_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { +pub fn revoke_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { let [token_account, owner, system_program, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); diff --git a/program-examples/native/program/src/instructions/thaw.rs b/program-examples/native/program/src/instructions/thaw.rs index f7eb0dc5..e1e7f26a 100644 --- a/program-examples/native/program/src/instructions/thaw.rs +++ b/program-examples/native/program/src/instructions/thaw.rs @@ -19,7 +19,10 @@ pub fn thaw_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { .invoke() } -pub fn thaw_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { +pub fn thaw_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { let [token_account, mint, freeze_authority, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); diff --git a/program-examples/native/program/src/instructions/transfer_interface.rs b/program-examples/native/program/src/instructions/transfer_interface.rs index 54431353..9ff1f2d4 100644 --- a/program-examples/native/program/src/instructions/transfer_interface.rs +++ b/program-examples/native/program/src/instructions/transfer_interface.rs @@ -6,15 +6,8 @@ use solana_program::{ }; pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [ - source, - destination, - authority, - payer, - ctoken_authority, - system_program, - _token_program, - ] = accounts + let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -39,16 +32,12 @@ pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { .invoke() } -pub fn transfer_invoke_signed(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [ - source, - destination, - authority, - payer, - ctoken_authority, - system_program, - _token_program, - ] = accounts +pub fn transfer_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; diff --git a/program-examples/native/program/tests/approve.rs b/program-examples/native/program/tests/approve.rs index 5f3e9c5b..e15a27f9 100644 --- a/program-examples/native/program/tests/approve.rs +++ b/program-examples/native/program/tests/approve.rs @@ -1,9 +1,11 @@ mod shared; +use light_client::indexer::Indexer; use light_client::rpc::Rpc; use shared::{ build_approve_cpi_ix, build_approve_signed_cpi_ix, create_test_rpc, - get_authority_pda, setup, setup_pda_owned_ata, SetupContext, + get_authority_pda, setup, setup_empty_ata, setup_pda_owned_ata, + SetupContext, }; use solana_sdk::{signature::Keypair, signer::Signer}; @@ -30,6 +32,26 @@ async fn approve_cpi() { rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) .await .unwrap(); + + // Verify delegate is set + let accounts = rpc + .get_compressed_token_accounts_by_delegate( + &delegate.pubkey(), + None, + None, + ) + .await + .unwrap(); + assert!( + !accounts.value.items.is_empty(), + "Delegate should have delegated token account" + ); + let delegated_account = &accounts.value.items[0]; + assert_eq!( + delegated_account.token.delegate, + Some(delegate.pubkey()), + "Delegate should match" + ); } #[tokio::test(flavor = "multi_thread")] @@ -56,4 +78,50 @@ async fn approve_signed_cpi() { rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) .await .unwrap(); + + // Verify delegate is set + let accounts = rpc + .get_compressed_token_accounts_by_delegate( + &delegate.pubkey(), + None, + None, + ) + .await + .unwrap(); + assert!( + !accounts.value.items.is_empty(), + "Delegate should have delegated token account" + ); +} + +#[tokio::test(flavor = "multi_thread")] +async fn approve_fails_with_wrong_owner() { + // Setup: create mint and ATA with tokens + let SetupContext { + mut rpc, + payer, + ata, + .. + } = setup_empty_ata().await; + + let wrong_owner = Keypair::new(); + let delegate = Keypair::new(); + let delegate_amount = 500_000u64; + + // Try to approve with wrong owner (wrong_owner is not the actual owner) + let ix = build_approve_cpi_ix( + ata, + delegate.pubkey(), + wrong_owner.pubkey(), + delegate_amount, + ); + + let result = rpc + .create_and_send_transaction( + &[ix], + &payer.pubkey(), + &[&payer, &wrong_owner], + ) + .await; + assert!(result.is_err(), "Approve with wrong owner should fail"); } diff --git a/program-examples/native/program/tests/burn.rs b/program-examples/native/program/tests/burn.rs index a9ee9ef5..869c916f 100644 --- a/program-examples/native/program/tests/burn.rs +++ b/program-examples/native/program/tests/burn.rs @@ -1,5 +1,6 @@ mod shared; +use light_client::indexer::Indexer; use light_client::rpc::Rpc; use shared::{ build_burn_cpi_ix, build_burn_signed_cpi_ix, create_test_rpc, @@ -18,13 +19,37 @@ async fn burn_cpi() { .. } = setup().await; + let initial_amount = 1_000_000u64; let burn_amount = 300_000u64; + // Get balance before burn + let balance_before = rpc + .get_compressed_token_account_balance(Some(ata.to_bytes()), None, None) + .await + .unwrap() + .value; + assert_eq!( + balance_before, initial_amount, + "Initial balance should match" + ); + let ix = build_burn_cpi_ix(ata, mint, payer.pubkey(), burn_amount); rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) .await .unwrap(); + + // Verify balance decreased + let balance_after = rpc + .get_compressed_token_account_balance(Some(ata.to_bytes()), None, None) + .await + .unwrap() + .value; + assert_eq!( + balance_after, + initial_amount - burn_amount, + "Balance should decrease by burn amount" + ); } #[tokio::test(flavor = "multi_thread")] @@ -44,4 +69,41 @@ async fn burn_signed_cpi() { rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) .await .unwrap(); + + // Verify balance decreased + let balance_after = rpc + .get_compressed_token_account_balance(Some(ata.to_bytes()), None, None) + .await + .unwrap() + .value; + assert_eq!( + balance_after, + initial_amount - burn_amount, + "Balance should decrease by burn amount" + ); +} + +#[tokio::test(flavor = "multi_thread")] +async fn burn_fails_with_insufficient_balance() { + // Setup: create mint and ATA with tokens + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup().await; + + let initial_amount = 1_000_000u64; + let burn_amount = initial_amount + 1; // More than balance + + let ix = build_burn_cpi_ix(ata, mint, payer.pubkey(), burn_amount); + + let result = rpc + .create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await; + assert!( + result.is_err(), + "Burn with insufficient balance should fail" + ); } diff --git a/program-examples/native/program/tests/create_token_account.rs b/program-examples/native/program/tests/create_token_account.rs index 0925e1fa..451bd681 100644 --- a/program-examples/native/program/tests/create_token_account.rs +++ b/program-examples/native/program/tests/create_token_account.rs @@ -2,8 +2,9 @@ mod shared; use light_client::rpc::Rpc; use shared::{ - build_create_token_account_cpi_ix, build_create_token_account_signed_cpi_ix, - create_test_rpc, get_authority_pda, setup_mint_with_tokens, + build_create_token_account_cpi_ix, + build_create_token_account_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup_mint_with_tokens, }; use solana_sdk::{signature::Keypair, signer::Signer}; @@ -32,9 +33,13 @@ async fn create_token_account_cpi() { owner, ); - rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer, &token_account]) - .await - .unwrap(); + rpc.create_and_send_transaction( + &[ix], + &payer.pubkey(), + &[&payer, &token_account], + ) + .await + .unwrap(); let account = rpc.get_account(token_account.pubkey()).await.unwrap(); assert!(account.is_some()); diff --git a/program-examples/native/program/tests/freeze.rs b/program-examples/native/program/tests/freeze.rs index cbfb1e5a..927be0e5 100644 --- a/program-examples/native/program/tests/freeze.rs +++ b/program-examples/native/program/tests/freeze.rs @@ -1,6 +1,8 @@ mod shared; +use light_client::indexer::Indexer; use light_client::rpc::Rpc; +use light_token::compat::AccountState; use shared::{ build_freeze_cpi_ix, build_freeze_signed_cpi_ix, create_ata, create_test_rpc, get_authority_pda, setup, setup_mint_with_tokens, @@ -24,6 +26,22 @@ async fn freeze_cpi() { rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) .await .unwrap(); + + // Verify account is frozen + let accounts = rpc + .get_compressed_token_accounts_by_owner(&payer.pubkey(), None, None) + .await + .unwrap(); + assert!( + !accounts.value.items.is_empty(), + "Owner should have token account" + ); + let account = &accounts.value.items[0]; + assert_eq!( + account.token.state, + AccountState::Frozen, + "Account should be frozen" + ); } #[tokio::test(flavor = "multi_thread")] @@ -50,4 +68,20 @@ async fn freeze_signed_cpi() { rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) .await .unwrap(); + + // Verify account is frozen + let accounts = rpc + .get_compressed_token_accounts_by_owner(&payer.pubkey(), None, None) + .await + .unwrap(); + assert!( + !accounts.value.items.is_empty(), + "Owner should have token account" + ); + let account = &accounts.value.items[0]; + assert_eq!( + account.token.state, + AccountState::Frozen, + "Account should be frozen" + ); } diff --git a/program-examples/native/program/tests/mint_to.rs b/program-examples/native/program/tests/mint_to.rs index ffcd3683..29a32eac 100644 --- a/program-examples/native/program/tests/mint_to.rs +++ b/program-examples/native/program/tests/mint_to.rs @@ -1,25 +1,14 @@ mod shared; -use borsh::BorshSerialize; -use light_client::{ - indexer::{AddressWithTree, Indexer}, - rpc::Rpc, -}; -use light_token::instruction::{ - config_pda, derive_mint_compressed_address, derive_token_ata, - find_mint_address, rent_sponsor_pda, SystemAccounts, - LIGHT_TOKEN_PROGRAM_ID, -}; +use light_client::rpc::Rpc; +use light_token::instruction::derive_token_ata; use shared::{ - build_mint_to_cpi_ix, build_mint_to_signed_cpi_ix, create_test_rpc, - get_authority_pda, setup_empty_ata, SetupContext, PROGRAM_ID, -}; -use solana_sdk::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, - signature::Keypair, - signer::Signer, + build_create_ata_signed_cpi_ix, build_mint_to_cpi_ix, + build_mint_to_signed_cpi_ix, create_ata, create_test_rpc, + get_authority_pda, setup_empty_ata, setup_mint_with_pda_authority, + SetupContext, }; +use solana_sdk::signer::Signer; #[tokio::test(flavor = "multi_thread")] async fn mint_to_cpi() { @@ -41,138 +30,76 @@ async fn mint_to_cpi() { .unwrap(); } +/// Tests minting tokens via CPI with a PDA authority. +/// +/// Uses `setup_mint_with_pda_authority` to create a mint where the program's +/// PDA is the mint authority, then mints tokens using a signed CPI call. #[tokio::test(flavor = "multi_thread")] async fn mint_to_signed_cpi() { let mut rpc = create_test_rpc().await; let payer = rpc.get_payer().insecure_clone(); let (pda_authority, authority_bump) = get_authority_pda(); - let mint_seed = Keypair::new(); let decimals = 9u8; - let address_tree = rpc.get_address_tree_v2(); - let output_queue = rpc.get_random_state_tree_info().unwrap().queue; - - let compression_address = - derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); - let (mint, bump) = find_mint_address(&mint_seed.pubkey()); - - let rpc_result = rpc - .get_validity_proof( - vec![], - vec![AddressWithTree { - address: compression_address, - tree: address_tree.tree, - }], - None, - ) - .await - .unwrap() - .value; - - let proof = rpc_result.proof.0.unwrap(); - - #[derive(BorshSerialize)] - struct CreateMintSignedDataTest { - decimals: u8, - address_merkle_tree_root_index: u16, - proof_a: [u8; 32], - proof_b: [u8; 64], - proof_c: [u8; 32], - compression_address: [u8; 32], - mint: Pubkey, - bump: u8, - freeze_authority: Option, - rent_payment: u8, - write_top_up: u32, - authority_bump: u8, - metadata_name: Option>, - metadata_symbol: Option>, - metadata_uri: Option>, - } - - let create_mint_data = CreateMintSignedDataTest { + // Create mint with PDA authority + let mint = setup_mint_with_pda_authority( + &mut rpc, + &payer, + pda_authority, decimals, - address_merkle_tree_root_index: rpc_result.addresses[0].root_index, - proof_a: proof.a, - proof_b: proof.b, - proof_c: proof.c, - compression_address, + ) + .await; + + // Create ATA for the payer + let ata = create_ata(&mut rpc, &payer, payer.pubkey(), mint).await; + + // Mint tokens using signed CPI + let amount = 1_000_000u64; + let mint_to_ix = build_mint_to_signed_cpi_ix( mint, - bump, - freeze_authority: None, - rent_payment: 16, - write_top_up: 766, + ata, + pda_authority, + amount, authority_bump, - metadata_name: None, - metadata_symbol: None, - metadata_uri: None, - }; - - let mut data = vec![19u8]; - data.extend(create_mint_data.try_to_vec().unwrap()); - - let system_accounts = SystemAccounts::default(); - - let create_mint_ix = Instruction { - program_id: PROGRAM_ID, - accounts: vec![ - AccountMeta::new(mint_seed.pubkey(), true), - AccountMeta::new(pda_authority, false), - AccountMeta::new(payer.pubkey(), true), - AccountMeta::new(address_tree.tree, false), - AccountMeta::new(output_queue, false), - AccountMeta::new_readonly(config_pda(), false), - AccountMeta::new(mint, false), - AccountMeta::new(rent_sponsor_pda(), false), - AccountMeta::new_readonly( - system_accounts.light_system_program, - false, - ), - AccountMeta::new_readonly(system_accounts.cpi_authority_pda, false), - AccountMeta::new_readonly( - system_accounts.registered_program_pda, - false, - ), - AccountMeta::new_readonly( - system_accounts.account_compression_authority, - false, - ), - AccountMeta::new_readonly( - system_accounts.account_compression_program, - false, - ), - AccountMeta::new_readonly(system_accounts.system_program, false), - AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), - ], - data, - }; + ); - rpc.create_and_send_transaction( - &[create_mint_ix], - &payer.pubkey(), - &[&payer, &mint_seed], + rpc.create_and_send_transaction(&[mint_to_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +/// Tests minting tokens via signed CPI using the CPI-style ATA creation. +/// +/// This test demonstrates the full flow of creating a mint with PDA authority, +/// creating an ATA using the CPI instruction, and minting tokens. +#[tokio::test(flavor = "multi_thread")] +async fn mint_to_signed_cpi_with_ata_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_authority, authority_bump) = get_authority_pda(); + let decimals = 9u8; + + // Create mint with PDA authority + let mint = setup_mint_with_pda_authority( + &mut rpc, + &payer, + pda_authority, + decimals, ) - .await - .unwrap(); + .await; + // Create ATA using the signed CPI instruction let (ata, ata_bump) = derive_token_ata(&payer.pubkey(), &mint); - - let create_ata_data = vec![1u8, ata_bump, 0u8]; - let create_ata_ix = Instruction { - program_id: PROGRAM_ID, - accounts: vec![ - AccountMeta::new_readonly(payer.pubkey(), false), - AccountMeta::new_readonly(mint, false), - AccountMeta::new(payer.pubkey(), true), - AccountMeta::new(ata, false), - AccountMeta::new_readonly(solana_sdk::system_program::ID, false), - AccountMeta::new_readonly(config_pda(), false), - AccountMeta::new(rent_sponsor_pda(), false), - AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), - ], - data: create_ata_data, - }; + let create_ata_ix = build_create_ata_signed_cpi_ix( + payer.pubkey(), + mint, + payer.pubkey(), + ata, + ata_bump, + authority_bump, + ); rpc.create_and_send_transaction( &[create_ata_ix], @@ -182,6 +109,7 @@ async fn mint_to_signed_cpi() { .await .unwrap(); + // Mint tokens using signed CPI let amount = 1_000_000u64; let mint_to_ix = build_mint_to_signed_cpi_ix( mint, diff --git a/program-examples/native/program/tests/shared.rs b/program-examples/native/program/tests/shared.rs index 2ce34251..e4b7f7c1 100644 --- a/program-examples/native/program/tests/shared.rs +++ b/program-examples/native/program/tests/shared.rs @@ -1,20 +1,12 @@ -use anchor_spl::{ - associated_token::spl_associated_token_account, - token::{spl_token, Mint as SPLMint}, -}; use light_client::{ indexer::{AddressWithTree, Indexer}, rpc::Rpc, }; use light_program_test::{LightProgramTest, ProgramTestConfig}; -use light_token::{ - spl_interface::CreateSplInterfacePda, - instruction::{ - config_pda, derive_mint_compressed_address, derive_token_ata, - find_mint_address, rent_sponsor_pda, Approve, - CreateAssociatedTokenAccount, CreateMint, CreateMintParams, Freeze, - MintTo, LIGHT_TOKEN_PROGRAM_ID, - }, +use light_token::instruction::{ + config_pda, derive_mint_compressed_address, derive_token_ata, + find_mint_address, rent_sponsor_pda, Approve, CreateAssociatedTokenAccount, + CreateMint, CreateMintParams, Freeze, MintTo, LIGHT_TOKEN_PROGRAM_ID, }; #[allow(deprecated)] use solana_sdk::{ @@ -22,20 +14,39 @@ use solana_sdk::{ pubkey::Pubkey, signature::Keypair, signer::Signer, - system_instruction, system_program, + system_program, }; pub const PROGRAM_ID: Pubkey = solana_sdk::pubkey!("TokenCpi11111111111111111111111111111111111"); +/// Rent payment parameter for compressed account creation. +/// This value represents the number of slots for rent exemption. +const RENT_PAYMENT: u8 = 16; + +/// Write top-up parameter for compressed account creation. +/// This value covers the cost of writing compressed state to the ledger. +const WRITE_TOP_UP: u32 = 766; + #[allow(unused)] pub async fn create_test_rpc() -> LightProgramTest { - LightProgramTest::new(ProgramTestConfig::new_v2( + let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2( false, Some(vec![("light_token_cpi", PROGRAM_ID)]), )) .await - .unwrap() + .unwrap(); + + // Initialize the CompressibleConfig account required for mint creation. + // Skip if it already exists (pre-loaded state has it initialized). + if rpc.get_account(config_pda()).await.unwrap().is_none() { + let (_config_pda, _rent_sponsor, _compression_authority) = + light_program_test::accounts::compressible_config::create_compressible_config(&mut rpc) + .await + .unwrap(); + } + + rpc } #[allow(dead_code)] @@ -210,8 +221,8 @@ pub async fn setup_mint_with_tokens( bump: find_mint_address(&mint_seed.pubkey()).1, freeze_authority, extensions: None, - rent_payment: 16, - write_top_up: 766, + rent_payment: RENT_PAYMENT, + write_top_up: WRITE_TOP_UP, }; let create_mint_ix = CreateMint::new( @@ -262,6 +273,7 @@ pub async fn setup_mint_with_tokens( amount: *amount, authority: mint_authority, max_top_up: None, + fee_payer: None, } .instruction() .unwrap(); @@ -299,101 +311,6 @@ pub async fn create_ata( ata } -#[allow(unused)] -pub async fn setup_spl_mint( - rpc: &mut (impl Rpc + Indexer), - payer: &Keypair, - decimals: u8, -) -> Pubkey { - let mint_keypair = Keypair::new(); - let mint = mint_keypair.pubkey(); - - let mint_rent = rpc - .get_minimum_balance_for_rent_exemption(SPLMint::LEN) - .await - .unwrap(); - - let create_mint_ix = system_instruction::create_account( - &payer.pubkey(), - &mint, - mint_rent, - SPLMint::LEN as u64, - &spl_token::ID, - ); - - let init_mint_ix = spl_token::instruction::initialize_mint( - &spl_token::ID, - &mint, - &payer.pubkey(), - None, - decimals, - ) - .unwrap(); - - rpc.create_and_send_transaction( - &[create_mint_ix, init_mint_ix], - &payer.pubkey(), - &[payer, &mint_keypair], - ) - .await - .unwrap(); - - let create_interface_ix = - CreateSplInterfacePda::new(payer.pubkey(), mint, spl_token::ID, false) - .instruction(); - - rpc.create_and_send_transaction( - &[create_interface_ix], - &payer.pubkey(), - &[payer], - ) - .await - .unwrap(); - - mint -} - -#[allow(unused)] -pub async fn setup_spl_ata( - rpc: &mut (impl Rpc + Indexer), - payer: &Keypair, - mint: &Pubkey, - owner: &Pubkey, - amount: u64, -) -> Pubkey { - let ata = - spl_associated_token_account::get_associated_token_address(owner, mint); - - let create_ata_ix = - spl_associated_token_account::instruction::create_associated_token_account_idempotent( - &payer.pubkey(), - owner, - mint, - &spl_token::ID, - ); - - let mut ixs = vec![create_ata_ix]; - - if amount > 0 { - let mint_ix = spl_token::instruction::mint_to( - &spl_token::ID, - mint, - &ata, - &payer.pubkey(), - &[], - amount, - ) - .unwrap(); - ixs.push(mint_ix); - } - - rpc.create_and_send_transaction(&ixs, &payer.pubkey(), &[payer]) - .await - .unwrap(); - - ata -} - #[allow(unused)] pub fn build_create_ata_cpi_ix( owner: Pubkey, @@ -502,11 +419,11 @@ pub fn build_close_cpi_ix( Instruction { program_id: PROGRAM_ID, accounts: vec![ - AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), AccountMeta::new(account, false), AccountMeta::new(destination, false), AccountMeta::new(owner, true), AccountMeta::new(rent_sponsor, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data: vec![4u8], } @@ -754,8 +671,8 @@ pub async fn setup_mint_with_pda_authority( bump: find_mint_address(&mint_seed.pubkey()).1, freeze_authority: None, extensions: None, - rent_payment: 16, - write_top_up: 766, + rent_payment: RENT_PAYMENT, + write_top_up: WRITE_TOP_UP, }; let create_mint_ix = CreateMint::new( @@ -799,6 +716,7 @@ pub async fn setup_pda_owned_ata( amount, authority: payer.pubkey(), max_top_up: None, + fee_payer: None, } .instruction() .unwrap(); @@ -878,11 +796,11 @@ pub fn build_close_signed_cpi_ix( Instruction { program_id: PROGRAM_ID, accounts: vec![ - AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), AccountMeta::new(account, false), AccountMeta::new(destination, false), AccountMeta::new(owner, false), AccountMeta::new(rent_sponsor, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data, } diff --git a/program-examples/native/program/tests/transfer.rs b/program-examples/native/program/tests/transfer.rs index bc37ccdd..db6f0996 100644 --- a/program-examples/native/program/tests/transfer.rs +++ b/program-examples/native/program/tests/transfer.rs @@ -76,3 +76,40 @@ async fn transfer_interface_signed_cpi() { .await .unwrap(); } + +/// Tests transferring the exact balance from a token account. +/// +/// This edge case verifies that transferring the entire balance succeeds +/// and leaves the source account with zero tokens remaining. +#[tokio::test(flavor = "multi_thread")] +async fn transfer_exact_balance_cpi() { + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup().await; + + // The setup() function creates an ATA with 1_000_000 tokens + let exact_balance = 1_000_000u64; + + let recipient = Keypair::new(); + let recipient_ata = + create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + + // Transfer the exact balance, leaving source with 0 + let ix = build_transfer_interface_cpi_ix( + ata, + recipient_ata, + payer.pubkey(), + payer.pubkey(), + cpi_authority(), + exact_balance, + 9, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} From ea3576d0b48043f40b2bc623bea43a974b959a0f Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 23 Jan 2026 17:35:17 +0000 Subject: [PATCH 05/12] fiX LIGHT TOKEN --- .../native/program/src/instructions/mod.rs | 2 +- .../native/program/tests/approve.rs | 41 ++++----------- program-examples/native/program/tests/burn.rs | 27 ++++------ .../native/program/tests/create_mint.rs | 50 ++++++++++-------- .../native/program/tests/freeze.rs | 51 ++++++------------- .../native/program/tests/shared.rs | 2 + 6 files changed, 69 insertions(+), 104 deletions(-) diff --git a/program-examples/native/program/src/instructions/mod.rs b/program-examples/native/program/src/instructions/mod.rs index 9f099a33..3cfd1afd 100644 --- a/program-examples/native/program/src/instructions/mod.rs +++ b/program-examples/native/program/src/instructions/mod.rs @@ -22,7 +22,7 @@ mod thaw; mod transfer_interface; pub fn process( - program_id: &Pubkey, + _program_id: &Pubkey, accounts: &[AccountInfo], instruction_data: &[u8], ) -> ProgramResult { diff --git a/program-examples/native/program/tests/approve.rs b/program-examples/native/program/tests/approve.rs index e15a27f9..04c96c51 100644 --- a/program-examples/native/program/tests/approve.rs +++ b/program-examples/native/program/tests/approve.rs @@ -1,7 +1,8 @@ mod shared; -use light_client::indexer::Indexer; +use borsh::BorshDeserialize; use light_client::rpc::Rpc; +use light_token_interface::state::Token; use shared::{ build_approve_cpi_ix, build_approve_signed_cpi_ix, create_test_rpc, get_authority_pda, setup, setup_empty_ata, setup_pda_owned_ata, @@ -34,24 +35,10 @@ async fn approve_cpi() { .unwrap(); // Verify delegate is set - let accounts = rpc - .get_compressed_token_accounts_by_delegate( - &delegate.pubkey(), - None, - None, - ) - .await - .unwrap(); - assert!( - !accounts.value.items.is_empty(), - "Delegate should have delegated token account" - ); - let delegated_account = &accounts.value.items[0]; - assert_eq!( - delegated_account.token.delegate, - Some(delegate.pubkey()), - "Delegate should match" - ); + let account_data = rpc.get_account(ata).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + assert_eq!(token_state.delegate, Some(delegate.pubkey().into())); + assert_eq!(token_state.delegated_amount, delegate_amount); } #[tokio::test(flavor = "multi_thread")] @@ -80,18 +67,10 @@ async fn approve_signed_cpi() { .unwrap(); // Verify delegate is set - let accounts = rpc - .get_compressed_token_accounts_by_delegate( - &delegate.pubkey(), - None, - None, - ) - .await - .unwrap(); - assert!( - !accounts.value.items.is_empty(), - "Delegate should have delegated token account" - ); + let account_data = rpc.get_account(ata).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + assert_eq!(token_state.delegate, Some(delegate.pubkey().into())); + assert_eq!(token_state.delegated_amount, delegate_amount); } #[tokio::test(flavor = "multi_thread")] diff --git a/program-examples/native/program/tests/burn.rs b/program-examples/native/program/tests/burn.rs index 869c916f..48f3d0ee 100644 --- a/program-examples/native/program/tests/burn.rs +++ b/program-examples/native/program/tests/burn.rs @@ -1,7 +1,8 @@ mod shared; -use light_client::indexer::Indexer; +use borsh::BorshDeserialize; use light_client::rpc::Rpc; +use light_token_interface::state::Token; use shared::{ build_burn_cpi_ix, build_burn_signed_cpi_ix, create_test_rpc, get_authority_pda, setup, setup_pda_owned_ata, SetupContext, @@ -23,11 +24,9 @@ async fn burn_cpi() { let burn_amount = 300_000u64; // Get balance before burn - let balance_before = rpc - .get_compressed_token_account_balance(Some(ata.to_bytes()), None, None) - .await - .unwrap() - .value; + let account_data = rpc.get_account(ata).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let balance_before = token_state.amount; assert_eq!( balance_before, initial_amount, "Initial balance should match" @@ -40,11 +39,9 @@ async fn burn_cpi() { .unwrap(); // Verify balance decreased - let balance_after = rpc - .get_compressed_token_account_balance(Some(ata.to_bytes()), None, None) - .await - .unwrap() - .value; + let account_data = rpc.get_account(ata).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let balance_after = token_state.amount; assert_eq!( balance_after, initial_amount - burn_amount, @@ -71,11 +68,9 @@ async fn burn_signed_cpi() { .unwrap(); // Verify balance decreased - let balance_after = rpc - .get_compressed_token_account_balance(Some(ata.to_bytes()), None, None) - .await - .unwrap() - .value; + let account_data = rpc.get_account(ata).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let balance_after = token_state.amount; assert_eq!( balance_after, initial_amount - burn_amount, diff --git a/program-examples/native/program/tests/create_mint.rs b/program-examples/native/program/tests/create_mint.rs index 3d8fcced..35cba3e7 100644 --- a/program-examples/native/program/tests/create_mint.rs +++ b/program-examples/native/program/tests/create_mint.rs @@ -5,6 +5,10 @@ use light_client::{ indexer::{AddressWithTree, Indexer}, rpc::Rpc, }; +use light_compressible::CreateAccountsProof; +use light_compressed_account::instruction_data::{ + compressed_proof::ValidityProof, data::PackedAddressTreeInfo, +}; use light_token::instruction::{ config_pda, derive_mint_compressed_address, find_mint_address, rent_sponsor_pda, SystemAccounts, LIGHT_TOKEN_PROGRAM_ID, @@ -49,17 +53,12 @@ async fn create_mint_cpi() { .unwrap() .value; - let proof = rpc_result.proof.0.unwrap(); - // Build instruction data #[derive(BorshSerialize)] struct CreateMintDataTest { decimals: u8, - address_merkle_tree_root_index: u16, mint_authority: Pubkey, - proof_a: [u8; 32], - proof_b: [u8; 64], - proof_c: [u8; 32], + create_accounts_proof: CreateAccountsProof, compression_address: [u8; 32], mint: Pubkey, bump: u8, @@ -71,13 +70,21 @@ async fn create_mint_cpi() { metadata_uri: Option>, } + let create_accounts_proof = CreateAccountsProof { + proof: ValidityProof(rpc_result.proof.0), + address_tree_info: PackedAddressTreeInfo { + address_merkle_tree_pubkey_index: 0, + address_queue_pubkey_index: 0, + root_index: rpc_result.addresses[0].root_index, + }, + output_state_tree_index: 0, + state_tree_index: None, + }; + let test_data = CreateMintDataTest { decimals, - address_merkle_tree_root_index: rpc_result.addresses[0].root_index, mint_authority: payer.pubkey(), - proof_a: proof.a, - proof_b: proof.b, - proof_c: proof.c, + create_accounts_proof, compression_address, mint, bump, @@ -175,16 +182,11 @@ async fn create_mint_signed_cpi() { .unwrap() .value; - let proof = rpc_result.proof.0.unwrap(); - // Build instruction data #[derive(BorshSerialize)] struct CreateMintSignedDataTest { decimals: u8, - address_merkle_tree_root_index: u16, - proof_a: [u8; 32], - proof_b: [u8; 64], - proof_c: [u8; 32], + create_accounts_proof: CreateAccountsProof, compression_address: [u8; 32], mint: Pubkey, bump: u8, @@ -197,12 +199,20 @@ async fn create_mint_signed_cpi() { metadata_uri: Option>, } + let create_accounts_proof = CreateAccountsProof { + proof: ValidityProof(rpc_result.proof.0), + address_tree_info: PackedAddressTreeInfo { + address_merkle_tree_pubkey_index: 0, + address_queue_pubkey_index: 0, + root_index: rpc_result.addresses[0].root_index, + }, + output_state_tree_index: 0, + state_tree_index: None, + }; + let test_data = CreateMintSignedDataTest { decimals, - address_merkle_tree_root_index: rpc_result.addresses[0].root_index, - proof_a: proof.a, - proof_b: proof.b, - proof_c: proof.c, + create_accounts_proof, compression_address, mint, bump, diff --git a/program-examples/native/program/tests/freeze.rs b/program-examples/native/program/tests/freeze.rs index 927be0e5..5e720677 100644 --- a/program-examples/native/program/tests/freeze.rs +++ b/program-examples/native/program/tests/freeze.rs @@ -1,12 +1,11 @@ mod shared; -use light_client::indexer::Indexer; +use borsh::BorshDeserialize; use light_client::rpc::Rpc; -use light_token::compat::AccountState; +use light_token_interface::state::Token; use shared::{ - build_freeze_cpi_ix, build_freeze_signed_cpi_ix, create_ata, - create_test_rpc, get_authority_pda, setup, setup_mint_with_tokens, - SetupContext, + build_freeze_cpi_ix, build_freeze_signed_cpi_ix, create_test_rpc, + get_authority_pda, setup, setup_mint_with_tokens, SetupContext, }; use solana_sdk::signer::Signer; @@ -28,20 +27,9 @@ async fn freeze_cpi() { .unwrap(); // Verify account is frozen - let accounts = rpc - .get_compressed_token_accounts_by_owner(&payer.pubkey(), None, None) - .await - .unwrap(); - assert!( - !accounts.value.items.is_empty(), - "Owner should have token account" - ); - let account = &accounts.value.items[0]; - assert_eq!( - account.token.state, - AccountState::Frozen, - "Account should be frozen" - ); + let account_data = rpc.get_account(ata).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + assert!(token_state.is_frozen(), "Account should be frozen"); } #[tokio::test(flavor = "multi_thread")] @@ -50,18 +38,20 @@ async fn freeze_signed_cpi() { let payer = rpc.get_payer().insecure_clone(); let (pda_authority, bump) = get_authority_pda(); + let initial_amount = 1_000_000u64; - let (mint, _) = setup_mint_with_tokens( + // Create mint with PDA as freeze authority and mint tokens to payer + let (mint, atas) = setup_mint_with_tokens( &mut rpc, &payer, payer.pubkey(), Some(pda_authority), 9, - vec![], + vec![(initial_amount, payer.pubkey())], ) .await; - let ata = create_ata(&mut rpc, &payer, payer.pubkey(), mint).await; + let ata = atas[0]; let ix = build_freeze_signed_cpi_ix(ata, mint, pda_authority, bump); @@ -70,18 +60,7 @@ async fn freeze_signed_cpi() { .unwrap(); // Verify account is frozen - let accounts = rpc - .get_compressed_token_accounts_by_owner(&payer.pubkey(), None, None) - .await - .unwrap(); - assert!( - !accounts.value.items.is_empty(), - "Owner should have token account" - ); - let account = &accounts.value.items[0]; - assert_eq!( - account.token.state, - AccountState::Frozen, - "Account should be frozen" - ); + let account_data = rpc.get_account(ata).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + assert!(token_state.is_frozen(), "Account should be frozen"); } diff --git a/program-examples/native/program/tests/shared.rs b/program-examples/native/program/tests/shared.rs index e4b7f7c1..b1e4ac93 100644 --- a/program-examples/native/program/tests/shared.rs +++ b/program-examples/native/program/tests/shared.rs @@ -403,6 +403,7 @@ pub fn build_burn_cpi_ix( AccountMeta::new(source, false), AccountMeta::new(mint, false), AccountMeta::new_readonly(authority, true), + AccountMeta::new_readonly(system_program::ID, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data, @@ -776,6 +777,7 @@ pub fn build_burn_signed_cpi_ix( AccountMeta::new(source, false), AccountMeta::new(mint, false), AccountMeta::new_readonly(authority, false), + AccountMeta::new_readonly(system_program::ID, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data, From a6df611679e861126740b4a58e09b91f9df17b11 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 23 Jan 2026 17:57:31 +0000 Subject: [PATCH 06/12] bump to latest --- .../src/instructions/create_token_account.rs | 5 +- .../native/program/src/instructions/mod.rs | 4 +- .../native/program/tests/shared.rs | 85 +++++++++++++++---- 3 files changed, 73 insertions(+), 21 deletions(-) diff --git a/program-examples/native/program/src/instructions/create_token_account.rs b/program-examples/native/program/src/instructions/create_token_account.rs index ab4e4f62..84ba9c7e 100644 --- a/program-examples/native/program/src/instructions/create_token_account.rs +++ b/program-examples/native/program/src/instructions/create_token_account.rs @@ -46,10 +46,11 @@ pub fn create_token_account_invoke( } pub fn create_token_account_invoke_signed( + program_id: &Pubkey, accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [payer, account, mint, compressible_config, system_program, rent_sponsor, token_program] = + let [payer, account, mint, compressible_config, system_program, rent_sponsor, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); @@ -74,7 +75,7 @@ pub fn create_token_account_invoke_signed( compressible_config.clone(), rent_sponsor.clone(), system_program.clone(), - token_program.key, + program_id, ) .invoke_signed(signer_seeds) } diff --git a/program-examples/native/program/src/instructions/mod.rs b/program-examples/native/program/src/instructions/mod.rs index 3cfd1afd..b87d7cb7 100644 --- a/program-examples/native/program/src/instructions/mod.rs +++ b/program-examples/native/program/src/instructions/mod.rs @@ -22,7 +22,7 @@ mod thaw; mod transfer_interface; pub fn process( - _program_id: &Pubkey, + program_id: &Pubkey, accounts: &[AccountInfo], instruction_data: &[u8], ) -> ProgramResult { @@ -53,7 +53,7 @@ pub fn process( 19 => create_mint::create_mint_invoke_signed(accounts, data), 20 => create_token_account::create_token_account_invoke(accounts, data), 21 => create_token_account::create_token_account_invoke_signed( - accounts, data, + program_id, accounts, data, ), _ => Err( solana_program::program_error::ProgramError::InvalidInstructionData, diff --git a/program-examples/native/program/tests/shared.rs b/program-examples/native/program/tests/shared.rs index b1e4ac93..b516a5b4 100644 --- a/program-examples/native/program/tests/shared.rs +++ b/program-examples/native/program/tests/shared.rs @@ -1,12 +1,17 @@ +use borsh::BorshSerialize; use light_client::{ indexer::{AddressWithTree, Indexer}, rpc::Rpc, }; +use light_compressible::CreateAccountsProof; +use light_compressed_account::instruction_data::{ + compressed_proof::ValidityProof, data::PackedAddressTreeInfo, +}; use light_program_test::{LightProgramTest, ProgramTestConfig}; use light_token::instruction::{ config_pda, derive_mint_compressed_address, derive_token_ata, find_mint_address, rent_sponsor_pda, Approve, CreateAssociatedTokenAccount, - CreateMint, CreateMintParams, Freeze, MintTo, LIGHT_TOKEN_PROGRAM_ID, + CreateMint, CreateMintParams, Freeze, MintTo, SystemAccounts, LIGHT_TOKEN_PROGRAM_ID, }; #[allow(deprecated)] use solana_sdk::{ @@ -641,13 +646,14 @@ pub async fn setup_mint_with_pda_authority( pda_authority: Pubkey, decimals: u8, ) -> Pubkey { + let (_, authority_bump) = get_authority_pda(); let mint_seed = Keypair::new(); let address_tree = rpc.get_address_tree_v2(); let output_queue = rpc.get_random_state_tree_info().unwrap().queue; let compression_address = derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); - let mint = find_mint_address(&mint_seed.pubkey()).0; + let (mint, bump) = find_mint_address(&mint_seed.pubkey()); let rpc_result = rpc .get_validity_proof( @@ -662,29 +668,74 @@ pub async fn setup_mint_with_pda_authority( .unwrap() .value; - let params = CreateMintParams { + #[derive(BorshSerialize)] + struct CreateMintSignedData { + decimals: u8, + create_accounts_proof: CreateAccountsProof, + compression_address: [u8; 32], + mint: Pubkey, + bump: u8, + freeze_authority: Option, + rent_payment: u8, + write_top_up: u32, + authority_bump: u8, + metadata_name: Option>, + metadata_symbol: Option>, + metadata_uri: Option>, + } + + let create_accounts_proof = CreateAccountsProof { + proof: ValidityProof(rpc_result.proof.0), + address_tree_info: PackedAddressTreeInfo { + address_merkle_tree_pubkey_index: 0, + address_queue_pubkey_index: 0, + root_index: rpc_result.addresses[0].root_index, + }, + output_state_tree_index: 0, + state_tree_index: None, + }; + + let ix_data = CreateMintSignedData { decimals, - address_merkle_tree_root_index: rpc_result.addresses[0].root_index, - mint_authority: pda_authority, - proof: rpc_result.proof.0.unwrap(), + create_accounts_proof, compression_address, mint, - bump: find_mint_address(&mint_seed.pubkey()).1, + bump, freeze_authority: None, - extensions: None, rent_payment: RENT_PAYMENT, write_top_up: WRITE_TOP_UP, + authority_bump, + metadata_name: None, + metadata_symbol: None, + metadata_uri: None, }; - let create_mint_ix = CreateMint::new( - params, - mint_seed.pubkey(), - payer.pubkey(), - address_tree.tree, - output_queue, - ) - .instruction() - .unwrap(); + let mut data = vec![19u8]; + data.extend(ix_data.try_to_vec().unwrap()); + + let system_accounts = SystemAccounts::default(); + + let create_mint_ix = Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint_seed.pubkey(), true), + AccountMeta::new(pda_authority, false), + AccountMeta::new(payer.pubkey(), true), + AccountMeta::new(address_tree.tree, false), + AccountMeta::new(output_queue, false), + AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new(mint, false), + AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(system_accounts.light_system_program, false), + AccountMeta::new_readonly(system_accounts.cpi_authority_pda, false), + AccountMeta::new_readonly(system_accounts.registered_program_pda, false), + AccountMeta::new_readonly(system_accounts.account_compression_authority, false), + AccountMeta::new_readonly(system_accounts.account_compression_program, false), + AccountMeta::new_readonly(system_accounts.system_program, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + }; rpc.create_and_send_transaction( &[create_mint_ix], From d23e768d9527e35e194908b7972767b7bef98570 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 23 Jan 2026 18:17:54 +0000 Subject: [PATCH 07/12] apply comments --- .../program/src/instructions/create_mint.rs | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/program-examples/native/program/src/instructions/create_mint.rs b/program-examples/native/program/src/instructions/create_mint.rs index 947526ba..bfd34b8d 100644 --- a/program-examples/native/program/src/instructions/create_mint.rs +++ b/program-examples/native/program/src/instructions/create_mint.rs @@ -32,8 +32,23 @@ pub fn create_mint_invoke( accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = - accounts + let [ + mint_seed, + authority, + payer, + address_tree, + output_queue, + compressible_config, + mint, + rent_sponsor, + light_system_program, + cpi_authority_pda, + registered_program_pda, + account_compression_authority, + account_compression_program, + system_program, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -124,8 +139,23 @@ pub fn create_mint_invoke_signed( accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = - accounts + let [ + mint_seed, + authority, + payer, + address_tree, + output_queue, + compressible_config, + mint, + rent_sponsor, + light_system_program, + cpi_authority_pda, + registered_program_pda, + account_compression_authority, + account_compression_program, + system_program, + _token_program, + ] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; From 0d76e639dae732d5c2759b96392ea16a65a81d1e Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Sun, 25 Jan 2026 22:26:19 +0000 Subject: [PATCH 08/12] fix ctoken --- .../native/program/src/instructions/transfer_interface.rs | 8 ++++---- program-examples/native/program/tests/shared.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/program-examples/native/program/src/instructions/transfer_interface.rs b/program-examples/native/program/src/instructions/transfer_interface.rs index 9ff1f2d4..0df03788 100644 --- a/program-examples/native/program/src/instructions/transfer_interface.rs +++ b/program-examples/native/program/src/instructions/transfer_interface.rs @@ -6,7 +6,7 @@ use solana_program::{ }; pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = + let [source, destination, authority, payer, light_token_authority, system_program, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); @@ -26,7 +26,7 @@ pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { destination.clone(), authority.clone(), payer.clone(), - ctoken_authority.clone(), + light_token_authority.clone(), system_program.clone(), ) .invoke() @@ -36,7 +36,7 @@ pub fn transfer_invoke_signed( accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [source, destination, authority, payer, ctoken_authority, system_program, _token_program] = + let [source, destination, authority, payer, light_token_authority, system_program, _token_program] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); @@ -58,7 +58,7 @@ pub fn transfer_invoke_signed( destination.clone(), authority.clone(), payer.clone(), - ctoken_authority.clone(), + light_token_authority.clone(), system_program.clone(), ) .invoke_signed(&[signer_seeds]) diff --git a/program-examples/native/program/tests/shared.rs b/program-examples/native/program/tests/shared.rs index b516a5b4..6f94c2ef 100644 --- a/program-examples/native/program/tests/shared.rs +++ b/program-examples/native/program/tests/shared.rs @@ -555,7 +555,7 @@ pub fn build_transfer_interface_cpi_ix( destination: Pubkey, authority: Pubkey, payer: Pubkey, - ctoken_authority: Pubkey, + light_token_authority: Pubkey, amount: u64, decimals: u8, ) -> Instruction { @@ -570,7 +570,7 @@ pub fn build_transfer_interface_cpi_ix( AccountMeta::new(destination, false), AccountMeta::new_readonly(authority, true), AccountMeta::new(payer, true), - AccountMeta::new_readonly(ctoken_authority, false), + AccountMeta::new_readonly(light_token_authority, false), AccountMeta::new_readonly(system_program::ID, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], @@ -614,7 +614,7 @@ pub fn build_transfer_interface_signed_cpi_ix( destination: Pubkey, authority: Pubkey, payer: Pubkey, - ctoken_authority: Pubkey, + light_token_authority: Pubkey, amount: u64, decimals: u8, bump: u8, @@ -631,7 +631,7 @@ pub fn build_transfer_interface_signed_cpi_ix( AccountMeta::new(destination, false), AccountMeta::new_readonly(authority, false), AccountMeta::new(payer, true), - AccountMeta::new_readonly(ctoken_authority, false), + AccountMeta::new_readonly(light_token_authority, false), AccountMeta::new_readonly(system_program::ID, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], From ae9a0951cda6399d02a5651cf91857a0e7f9cabe Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Mon, 26 Jan 2026 00:42:45 +0000 Subject: [PATCH 09/12] feat: add transfer_checked, mint_to_checked; use public crates - Add transfer_checked CPI instruction with decimal validation - Add mint_to_checked CPI instruction with decimal validation - Update Cargo.toml to use public crates from crates.io - Refactor tests to use COMPRESSIBLE_CONFIG_V1 constant - Update README with new instructions --- .gitignore | 2 +- program-examples/native/Cargo.lock | 379 ++++++------------ program-examples/native/README.md | 16 +- program-examples/native/program/Cargo.toml | 18 +- .../src/instructions/mint_to_checked.rs | 65 +++ .../native/program/src/instructions/mod.rs | 6 + .../src/instructions/transfer_checked.rs | 67 ++++ .../native/program/tests/mint_to_checked.rs | 67 ++++ .../native/program/tests/shared.rs | 149 +++++-- .../native/program/tests/transfer_checked.rs | 102 +++++ 10 files changed, 562 insertions(+), 309 deletions(-) create mode 100644 program-examples/native/program/src/instructions/mint_to_checked.rs create mode 100644 program-examples/native/program/src/instructions/transfer_checked.rs create mode 100644 program-examples/native/program/tests/mint_to_checked.rs create mode 100644 program-examples/native/program/tests/transfer_checked.rs diff --git a/.gitignore b/.gitignore index 1803e1d1..b7f1cace 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ **/*.json.bak **/test-ledger **/target -cli/accounts/ +cli diff --git a/program-examples/native/Cargo.lock b/program-examples/native/Cargo.lock index 5b907481..6d1ce028 100644 --- a/program-examples/native/Cargo.lock +++ b/program-examples/native/Cargo.lock @@ -12,29 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "account-compression" -version = "2.0.0" -dependencies = [ - "aligned-sized", - "anchor-lang", - "bytemuck", - "light-account-checks", - "light-batched-merkle-tree", - "light-bounded-vec", - "light-compressed-account", - "light-concurrent-merkle-tree", - "light-hash-set", - "light-hasher", - "light-indexed-merkle-tree", - "light-merkle-tree-metadata", - "light-zero-copy", - "num-bigint 0.4.6", - "solana-sdk", - "solana-security-txt", - "zerocopy", -] - [[package]] name = "adler2" version = "2.0.1" @@ -149,6 +126,8 @@ dependencies = [ [[package]] name = "aligned-sized" version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48a526ec4434d531d488af59fe866f36b310fe8906691c75dffa664450a3800a" dependencies = [ "proc-macro2", "quote", @@ -252,27 +231,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-compressed-token" -version = "2.0.0" -dependencies = [ - "account-compression", - "anchor-lang", - "anchor-spl", - "light-compressed-account", - "light-hasher", - "light-heap", - "light-system-program-anchor", - "light-token-interface", - "light-zero-copy", - "pinocchio-pubkey", - "solana-sdk", - "solana-security-txt", - "spl-token 7.0.0", - "spl-token-2022 7.0.0", - "zerocopy", -] - [[package]] name = "anchor-derive-accounts" version = "0.31.1" @@ -323,7 +281,6 @@ dependencies = [ "anchor-derive-accounts", "anchor-derive-serde", "anchor-derive-space", - "anchor-lang-idl", "base64 0.21.7", "bincode", "borsh 0.10.4", @@ -341,7 +298,6 @@ dependencies = [ "anchor-lang-idl-spec", "anyhow", "heck 0.3.3", - "regex", "serde", "serde_json", "sha2 0.10.9", @@ -380,7 +336,6 @@ checksum = "5dc7a6d90cc643df0ed2744862cdf180587d1e5d28936538c18fc8908489ed67" dependencies = [ "anyhow", "bs58", - "cargo_toml", "heck 0.3.3", "proc-macro2", "quote", @@ -783,9 +738,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.5" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", @@ -965,16 +920,6 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" -[[package]] -name = "cargo_toml" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" -dependencies = [ - "serde", - "toml 0.8.23", -] - [[package]] name = "cc" version = "1.2.52" @@ -2476,9 +2421,10 @@ dependencies = [ [[package]] name = "light-account-checks" -version = "0.6.0" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f20b8640212dd450e18d452a247e28d8ba6fdce3c713fd8b69f1e95874d1b7ab" dependencies = [ - "pinocchio", "solana-account-info", "solana-msg", "solana-program-error", @@ -2489,14 +2435,18 @@ dependencies = [ [[package]] name = "light-array-map" -version = "0.1.1" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bdd13b18028ac9d80d0a987551c0dad7fe81be8140e87cc9d568b80f3728203" dependencies = [ "tinyvec", ] [[package]] name = "light-batched-merkle-tree" -version = "0.8.0" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01e838c523b49371097f948cd5662bd9a89d9dca037fb61fd38001e99f485702" dependencies = [ "aligned-sized", "borsh 0.10.4", @@ -2519,7 +2469,9 @@ dependencies = [ [[package]] name = "light-bloom-filter" -version = "0.5.0" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b8cf734ccf5fbc1f5fed8e5308b57ebde6774d9304c167bcb0de2854412d8" dependencies = [ "bitvec", "num-bigint 0.4.6", @@ -2542,7 +2494,9 @@ dependencies = [ [[package]] name = "light-client" -version = "0.18.0" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33203f596d48d28d1cb67dee5762b151e0073207a5e828c63ec68f9efb9a5ee8" dependencies = [ "anchor-lang", "async-trait", @@ -2595,7 +2549,9 @@ dependencies = [ [[package]] name = "light-compressed-account" -version = "0.8.0" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c3537bbad9df133ca97fc191b164bba93dba1de4da01a92d979ef63f8ce106" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -2605,7 +2561,6 @@ dependencies = [ "light-poseidon 0.3.0", "light-program-profiler", "light-zero-copy", - "pinocchio", "solana-msg", "solana-program-error", "solana-pubkey", @@ -2614,43 +2569,11 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "light-compressed-token" -version = "2.1.0" -dependencies = [ - "account-compression", - "anchor-compressed-token", - "anchor-lang", - "arrayvec", - "bitvec", - "borsh 0.10.4", - "light-account-checks", - "light-array-map", - "light-compressed-account", - "light-compressible", - "light-hasher", - "light-heap", - "light-macros", - "light-program-profiler", - "light-system-program-anchor", - "light-token-interface", - "light-zero-copy", - "pinocchio", - "pinocchio-pubkey", - "pinocchio-system", - "pinocchio-token-program", - "solana-pubkey", - "solana-security-txt", - "spl-pod", - "spl-token 7.0.0", - "spl-token-2022 7.0.0", - "tinyvec", - "zerocopy", -] - [[package]] name = "light-compressible" -version = "0.3.1" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d1dc14271907009f4ca23ae99c49279f7d2acc5a83f0f8d7362834b37e2e16" dependencies = [ "aligned-sized", "anchor-lang", @@ -2662,11 +2585,11 @@ dependencies = [ "light-macros", "light-program-profiler", "light-zero-copy", - "pinocchio", "pinocchio-pubkey", "solana-msg", "solana-program-error", "solana-pubkey", + "solana-rent", "solana-sysvar", "thiserror 2.0.17", "zerocopy", @@ -2675,6 +2598,8 @@ dependencies = [ [[package]] name = "light-concurrent-merkle-tree" version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db96f47253a0907aaa46dac15cecb27b5510130e48da0b36690dcd2e99a6d558" dependencies = [ "borsh 0.10.4", "light-bounded-vec", @@ -2686,7 +2611,9 @@ dependencies = [ [[package]] name = "light-event" -version = "0.3.0" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4bae725ee1d4d944d442ac0bfdf2031b1b2379c04c7e39c475277aaaea08fb1" dependencies = [ "borsh 0.10.4", "light-compressed-account", @@ -2695,20 +2622,11 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "light-hash-set" -version = "4.0.0" -dependencies = [ - "light-hasher", - "num-bigint 0.4.6", - "num-traits", - "solana-program-error", - "thiserror 2.0.17", -] - [[package]] name = "light-hasher" version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c822662e6e109bac0e132a43fd52a4ef684811245a794e048cf9cda001e934c8" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", @@ -2722,16 +2640,11 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "light-heap" -version = "2.0.0" -dependencies = [ - "anchor-lang", -] - [[package]] name = "light-indexed-array" version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f14f984030d86b6f07bd8f5ae04e2c40fcd0c3bdfcc7a291fff1ed59c9e6554" dependencies = [ "light-hasher", "num-bigint 0.4.6", @@ -2742,6 +2655,8 @@ dependencies = [ [[package]] name = "light-indexed-merkle-tree" version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0824755289075f28de2820fc7d4ec4e6b9e99d404e033c07338b91cce8c71fb8" dependencies = [ "light-bounded-vec", "light-concurrent-merkle-tree", @@ -2753,9 +2668,45 @@ dependencies = [ "thiserror 2.0.17", ] +[[package]] +name = "light-instruction-decoder" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bd98e842f21b754ec28020a56de37cb0b1089952ef24340d21c2d5afd5c5" +dependencies = [ + "borsh 0.10.4", + "bs58", + "light-compressed-account", + "light-instruction-decoder-derive", + "light-sdk-types", + "light-token-interface", + "serde", + "solana-instruction", + "solana-pubkey", + "solana-signature", + "tabled", +] + +[[package]] +name = "light-instruction-decoder-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2035d04a0a1590da05634efcac149a2ac852565e28c9a55bd07a6620c0e90bff" +dependencies = [ + "bs58", + "darling", + "heck 0.5.0", + "proc-macro2", + "quote", + "sha2 0.10.9", + "syn 2.0.114", +] + [[package]] name = "light-macros" version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "179ac51cadc1d0ca047b4d6265a7cc245ca3affc16a20a2749585aa6464d39c2" dependencies = [ "bs58", "proc-macro2", @@ -2766,7 +2717,9 @@ dependencies = [ [[package]] name = "light-merkle-tree-metadata" -version = "0.8.0" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c2e63e8345dcfb80efac69136fdcc6c36a12354675aca6e3daf13ec40422d1" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -2782,6 +2735,8 @@ dependencies = [ [[package]] name = "light-merkle-tree-reference" version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d480f62ca32b38a6231bbc5310d693f91d6b5bdcc18bb13c2d9aab7a1c90e8" dependencies = [ "light-hasher", "light-indexed-array", @@ -2836,9 +2791,10 @@ dependencies = [ [[package]] name = "light-program-test" -version = "0.18.0" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e85916a9da34a44971e1a30badaf04cb75213fbfa9f61a139ea6ebd0f021bdde" dependencies = [ - "account-compression", "anchor-lang", "async-trait", "base64 0.13.1", @@ -2846,20 +2802,17 @@ dependencies = [ "bs58", "bytemuck", "chrono", - "light-batched-merkle-tree", "light-client", "light-compressed-account", - "light-compressed-token", "light-compressible", - "light-concurrent-merkle-tree", "light-event", "light-hasher", "light-indexed-array", "light-indexed-merkle-tree", + "light-instruction-decoder", "light-merkle-tree-metadata", "light-merkle-tree-reference", "light-prover-client", - "light-registry", "light-sdk", "light-sdk-types", "light-token", @@ -2891,7 +2844,9 @@ dependencies = [ [[package]] name = "light-prover-client" -version = "5.0.1" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd2195f4573628a8aaca37504cde1b1903b8ed20e2706acbad875b7d41acbeab" dependencies = [ "ark-bn254 0.5.0", "ark-serialize 0.5.0", @@ -2911,34 +2866,11 @@ dependencies = [ "tracing", ] -[[package]] -name = "light-registry" -version = "2.1.0" -dependencies = [ - "account-compression", - "aligned-sized", - "anchor-lang", - "borsh 0.10.4", - "light-account-checks", - "light-batched-merkle-tree", - "light-compressible", - "light-macros", - "light-merkle-tree-metadata", - "light-program-profiler", - "light-system-program-anchor", - "light-token-interface", - "light-zero-copy", - "solana-account-info", - "solana-instruction", - "solana-pubkey", - "solana-sdk", - "solana-security-txt", - "spl-pod", -] - [[package]] name = "light-sdk" -version = "0.18.0" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f523c64a6fcdafe6df81d647560770529896f2707be8ffcf048d909b7e2b30" dependencies = [ "anchor-lang", "bincode", @@ -2967,7 +2899,9 @@ dependencies = [ [[package]] name = "light-sdk-macros" -version = "0.18.1" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d12bb13b84df21a4871dc0837aafc0b48464d3e9b17e2773c0719b6cc724c5" dependencies = [ "darling", "light-hasher", @@ -2980,7 +2914,9 @@ dependencies = [ [[package]] name = "light-sdk-types" -version = "0.18.0" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8153b27d057ded7b2b6bbd78c643e3f20bd9a9718ca1a8d4183169ccd812c3" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -2995,6 +2931,8 @@ dependencies = [ [[package]] name = "light-sparse-merkle-tree" version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4251e79b6c63f4946572dcfd7623680ad0f9e0efe1a761a944733333c5645063" dependencies = [ "light-hasher", "light-indexed-array", @@ -3003,21 +2941,11 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "light-system-program-anchor" -version = "2.0.0" -dependencies = [ - "account-compression", - "aligned-sized", - "anchor-lang", - "light-compressed-account", - "light-zero-copy", - "zerocopy", -] - [[package]] name = "light-token" -version = "0.3.0" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fd2e8ca6d7d70c77658010e1ae6ed6d4fe23e29054964b053f51e5c4676e49" dependencies = [ "anchor-lang", "arrayvec", @@ -3068,7 +2996,9 @@ dependencies = [ [[package]] name = "light-token-interface" -version = "0.2.0" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46decebc2a13ec984e2ba7f1e691c0d46b9061875c6bdd12636b7c100a60e6c" dependencies = [ "aligned-sized", "anchor-lang", @@ -3094,7 +3024,9 @@ dependencies = [ [[package]] name = "light-token-types" -version = "0.3.0" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411481fe2e04b1241235c2572480c153c5669507e227f5e3327057b0d2ba5734" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -3108,7 +3040,9 @@ dependencies = [ [[package]] name = "light-verifier" -version = "7.0.0" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecba4c14ac08b078a9d84033d628b12bb2577141f405140d506bacd392a830bc" dependencies = [ "groth16-solana", "light-compressed-account", @@ -3118,6 +3052,8 @@ dependencies = [ [[package]] name = "light-zero-copy" version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5621fb515e14af46148699c0b65334aabe230a1d2cbd06736ccc7a408c8a4af" dependencies = [ "light-zero-copy-derive", "solana-program-error", @@ -3127,6 +3063,8 @@ dependencies = [ [[package]] name = "light-zero-copy-derive" version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c46425e5c7ab5203ff5c86ae2615b169cca55f9283f5f60f5dd74143be6934" dependencies = [ "lazy_static", "proc-macro2", @@ -3604,6 +3542,8 @@ dependencies = [ [[package]] name = "photon-api" version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e572dba0c255f5b8176f15b9e849330d915a8927804f7f9702d5bbbc70e4a1ad" dependencies = [ "reqwest 0.12.28", "serde", @@ -3652,12 +3592,6 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b971851087bc3699b001954ad02389d50c41405ece3548cbcafc88b3e20017a" -[[package]] -name = "pinocchio-log" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd11022408f312e6179ece321c1f7dc0d1b2aa7765fddd39b2a7378d65a899e8" - [[package]] name = "pinocchio-pubkey" version = "0.3.0" @@ -3669,35 +3603,6 @@ dependencies = [ "sha2-const-stable", ] -[[package]] -name = "pinocchio-system" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141ed5eafb4ab04568bb0e224e3dc9a9de13c933de4c004e0d1a553498be3a7c" -dependencies = [ - "pinocchio", - "pinocchio-pubkey", -] - -[[package]] -name = "pinocchio-token-interface" -version = "0.0.0" -source = "git+https://github.com/Lightprotocol/token?rev=f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3#f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3" -dependencies = [ - "pinocchio", - "pinocchio-pubkey", -] - -[[package]] -name = "pinocchio-token-program" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/token?rev=f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3#f7bee9bbc8039c224a88ea76e9ae2edd78e0f9c3" -dependencies = [ - "pinocchio", - "pinocchio-log", - "pinocchio-token-interface", -] - [[package]] name = "pkg-config" version = "0.3.32" @@ -3752,7 +3657,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml 0.5.11", + "toml", ] [[package]] @@ -3761,7 +3666,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.23.10+spec-1.0.0", + "toml_edit", ] [[package]] @@ -4441,15 +4346,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -8006,27 +7902,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime 0.6.11", - "toml_edit 0.22.27", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" -dependencies = [ - "serde", -] - [[package]] name = "toml_datetime" version = "0.7.5+spec-1.1.0" @@ -8036,20 +7911,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap 2.13.0", - "serde", - "serde_spanned", - "toml_datetime 0.6.11", - "toml_write", - "winnow", -] - [[package]] name = "toml_edit" version = "0.23.10+spec-1.0.0" @@ -8057,7 +7918,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ "indexmap 2.13.0", - "toml_datetime 0.7.5+spec-1.1.0", + "toml_datetime", "toml_parser", "winnow", ] @@ -8071,12 +7932,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "toml_write" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" - [[package]] name = "tower" version = "0.5.3" diff --git a/program-examples/native/README.md b/program-examples/native/README.md index 1237968a..ef5b58ad 100644 --- a/program-examples/native/README.md +++ b/program-examples/native/README.md @@ -1,8 +1,4 @@ -# Light Token Native Programs - -Native Solana program examples that CPI the Light Token Program. - -## Programs +# Light Token Native Rust Solana Programs - **create-mint** - Create a light-token mint via CPI - [Instruction](program/src/instructions/create_mint.rs) | [Test](program/tests/create_mint.rs) @@ -12,8 +8,12 @@ Native Solana program examples that CPI the Light Token Program. - [Instruction](program/src/instructions/create_token_account.rs) | [Test](program/tests/create_token_account.rs) - **mint-to** - Mint tokens via CPI - [Instruction](program/src/instructions/mint_to.rs) | [Test](program/tests/mint_to.rs) +- **mint-to-checked** - Mint tokens with decimal validation via CPI + - [Instruction](program/src/instructions/mint_to_checked.rs) | [Test](program/tests/mint_to_checked.rs) - **transfer-interface** - Transfer between light-token, T22, and SPL accounts via CPI - [Instruction](program/src/instructions/transfer_interface.rs) | [Test](program/tests/transfer.rs) +- **transfer-checked** - Transfer with decimal validation against mint via CPI + - [Instruction](program/src/instructions/transfer_checked.rs) | [Test](program/tests/transfer_checked.rs) - **approve** - Approve delegate via CPI - [Instruction](program/src/instructions/approve.rs) | [Test](program/tests/approve.rs) - **revoke** - Revoke delegate via CPI @@ -46,12 +46,6 @@ cargo build-sbf cargo test-sbf ``` -## Disclaimer - -This reference implementation is not audited. - -The Light Protocol programs are audited and deployed on Solana devnet and mainnet. - ## Documentation Learn more [about Light-Token here](https://www.zkcompression.com/light-token/welcome). diff --git a/program-examples/native/program/Cargo.toml b/program-examples/native/program/Cargo.toml index 75549e6f..7927a53c 100644 --- a/program-examples/native/program/Cargo.toml +++ b/program-examples/native/program/Cargo.toml @@ -12,25 +12,25 @@ test-sbf = [] default = [] [dependencies] -light-token = { path = "../../../../light-protocol/sdk-libs/token-sdk" } -light-token-interface = { path = "../../../../light-protocol/program-libs/token-interface" } -light-compressible = { path = "../../../../light-protocol/program-libs/compressible" } +light-token = "0.4.0" +light-token-interface = "0.3.0" +light-compressible = "0.4.0" solana-program = "2.2" borsh = "0.10.4" [dev-dependencies] -light-program-test = { path = "../../../../light-protocol/sdk-libs/program-test", features = ["v2", "devenv"] } -light-client = { path = "../../../../light-protocol/sdk-libs/client", features = ["v2"] } -light-token-interface = { path = "../../../../light-protocol/program-libs/token-interface" } -light-compressed-account = { path = "../../../../light-protocol/program-libs/compressed-account" } -light-sdk-types = { path = "../../../../light-protocol/sdk-libs/sdk-types" } +light-program-test = { version = "0.19.0", features = ["v2"] } +light-client = { version = "0.19.0", features = ["v2"] } +light-token-interface = "0.3.0" +light-compressed-account = "0.9.0" +light-sdk-types = "0.19.0" tokio = { version = "1", features = ["full"] } solana-sdk = "2" anchor-spl = "0.31" spl-token = "7" spl-token-2022 = "7" spl-pod = "0.5" -blake3 = "=1.5.5" +blake3 = "=1.8.2" [lints.rust.unexpected_cfgs] level = "allow" diff --git a/program-examples/native/program/src/instructions/mint_to_checked.rs b/program-examples/native/program/src/instructions/mint_to_checked.rs new file mode 100644 index 00000000..a9e910ca --- /dev/null +++ b/program-examples/native/program/src/instructions/mint_to_checked.rs @@ -0,0 +1,65 @@ +use super::authority_seeds; +use light_token::instruction::MintToCheckedCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn mint_to_checked_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [mint, destination, authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 9 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let decimals = data[8]; + + MintToCheckedCpi { + mint: mint.clone(), + destination: destination.clone(), + amount, + decimals, + authority: authority.clone(), + system_program: system_program.clone(), + max_top_up: None, + fee_payer: None, + } + .invoke() +} + +pub fn mint_to_checked_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [mint, destination, authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 10 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let decimals = data[8]; + let bump = data[9]; + let signer_seeds = authority_seeds!(bump); + + MintToCheckedCpi { + mint: mint.clone(), + destination: destination.clone(), + amount, + decimals, + authority: authority.clone(), + system_program: system_program.clone(), + max_top_up: None, + fee_payer: None, + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/src/instructions/mod.rs b/program-examples/native/program/src/instructions/mod.rs index b87d7cb7..1f95461e 100644 --- a/program-examples/native/program/src/instructions/mod.rs +++ b/program-examples/native/program/src/instructions/mod.rs @@ -17,8 +17,10 @@ mod create_mint; mod create_token_account; mod freeze; mod mint_to; +mod mint_to_checked; mod revoke; mod thaw; +mod transfer_checked; mod transfer_interface; pub fn process( @@ -55,6 +57,10 @@ pub fn process( 21 => create_token_account::create_token_account_invoke_signed( program_id, accounts, data, ), + 22 => transfer_checked::transfer_checked_invoke(accounts, data), + 23 => transfer_checked::transfer_checked_invoke_signed(accounts, data), + 24 => mint_to_checked::mint_to_checked_invoke(accounts, data), + 25 => mint_to_checked::mint_to_checked_invoke_signed(accounts, data), _ => Err( solana_program::program_error::ProgramError::InvalidInstructionData, ), diff --git a/program-examples/native/program/src/instructions/transfer_checked.rs b/program-examples/native/program/src/instructions/transfer_checked.rs new file mode 100644 index 00000000..3a3fa0fc --- /dev/null +++ b/program-examples/native/program/src/instructions/transfer_checked.rs @@ -0,0 +1,67 @@ +use super::authority_seeds; +use light_token::instruction::TransferCheckedCpi; +use solana_program::{ + account_info::AccountInfo, entrypoint::ProgramResult, + program_error::ProgramError, +}; + +pub fn transfer_checked_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { + let [source, mint, destination, authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 9 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let decimals = data[8]; + + TransferCheckedCpi { + source: source.clone(), + mint: mint.clone(), + destination: destination.clone(), + amount, + decimals, + authority: authority.clone(), + system_program: system_program.clone(), + max_top_up: None, + fee_payer: None, + } + .invoke() +} + +pub fn transfer_checked_invoke_signed( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { + let [source, mint, destination, authority, system_program, _token_program] = + accounts + else { + return Err(ProgramError::NotEnoughAccountKeys); + }; + + if data.len() < 10 { + return Err(ProgramError::InvalidInstructionData); + } + + let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); + let decimals = data[8]; + let bump = data[9]; + let signer_seeds = authority_seeds!(bump); + + TransferCheckedCpi { + source: source.clone(), + mint: mint.clone(), + destination: destination.clone(), + amount, + decimals, + authority: authority.clone(), + system_program: system_program.clone(), + max_top_up: None, + fee_payer: None, + } + .invoke_signed(&[signer_seeds]) +} diff --git a/program-examples/native/program/tests/mint_to_checked.rs b/program-examples/native/program/tests/mint_to_checked.rs new file mode 100644 index 00000000..15647472 --- /dev/null +++ b/program-examples/native/program/tests/mint_to_checked.rs @@ -0,0 +1,67 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_mint_to_checked_cpi_ix, build_mint_to_checked_signed_cpi_ix, + create_test_rpc, get_authority_pda, setup_mint_with_pda_authority, + setup_mint_with_tokens, create_ata, +}; +use solana_sdk::{signature::Keypair, signer::Signer}; + +#[tokio::test(flavor = "multi_thread")] +async fn mint_to_checked_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (mint, atas) = setup_mint_with_tokens( + &mut rpc, + &payer, + payer.pubkey(), + None, + 9, + vec![(0, payer.pubkey())], + ) + .await; + + let mint_amount = 1_000_000u64; + + let ix = build_mint_to_checked_cpi_ix( + mint, + atas[0], + payer.pubkey(), + mint_amount, + 9, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn mint_to_checked_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_authority, bump) = get_authority_pda(); + + let mint = setup_mint_with_pda_authority(&mut rpc, &payer, pda_authority, 9).await; + + let recipient = Keypair::new(); + let recipient_ata = create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + + let mint_amount = 1_000_000u64; + + let ix = build_mint_to_checked_signed_cpi_ix( + mint, + recipient_ata, + pda_authority, + mint_amount, + 9, + bump, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} diff --git a/program-examples/native/program/tests/shared.rs b/program-examples/native/program/tests/shared.rs index 6f94c2ef..2565e50b 100644 --- a/program-examples/native/program/tests/shared.rs +++ b/program-examples/native/program/tests/shared.rs @@ -9,9 +9,9 @@ use light_compressed_account::instruction_data::{ }; use light_program_test::{LightProgramTest, ProgramTestConfig}; use light_token::instruction::{ - config_pda, derive_mint_compressed_address, derive_token_ata, - find_mint_address, rent_sponsor_pda, Approve, CreateAssociatedTokenAccount, - CreateMint, CreateMintParams, Freeze, MintTo, SystemAccounts, LIGHT_TOKEN_PROGRAM_ID, + derive_mint_compressed_address, derive_token_ata, find_mint_address, Approve, + CreateAssociatedTokenAccount, CreateMint, CreateMintParams, Freeze, MintTo, + SystemAccounts, COMPRESSIBLE_CONFIG_V1, LIGHT_TOKEN_PROGRAM_ID, RENT_SPONSOR, }; #[allow(deprecated)] use solana_sdk::{ @@ -35,23 +35,12 @@ const WRITE_TOP_UP: u32 = 766; #[allow(unused)] pub async fn create_test_rpc() -> LightProgramTest { - let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2( + LightProgramTest::new(ProgramTestConfig::new_v2( false, Some(vec![("light_token_cpi", PROGRAM_ID)]), )) .await - .unwrap(); - - // Initialize the CompressibleConfig account required for mint creation. - // Skip if it already exists (pre-loaded state has it initialized). - if rpc.get_account(config_pda()).await.unwrap().is_none() { - let (_config_pda, _rent_sponsor, _compression_authority) = - light_program_test::accounts::compressible_config::create_compressible_config(&mut rpc) - .await - .unwrap(); - } - - rpc + .unwrap() } #[allow(dead_code)] @@ -334,8 +323,8 @@ pub fn build_create_ata_cpi_ix( AccountMeta::new(payer, true), AccountMeta::new(associated_token_account, false), AccountMeta::new_readonly(system_program::ID, false), - AccountMeta::new_readonly(config_pda(), false), - AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(COMPRESSIBLE_CONFIG_V1, false), + AccountMeta::new(RENT_SPONSOR, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data, @@ -361,8 +350,8 @@ pub fn build_create_ata_signed_cpi_ix( AccountMeta::new(payer, true), AccountMeta::new(associated_token_account, false), AccountMeta::new_readonly(system_program::ID, false), - AccountMeta::new_readonly(config_pda(), false), - AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new_readonly(COMPRESSIBLE_CONFIG_V1, false), + AccountMeta::new(RENT_SPONSOR, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data, @@ -723,9 +712,9 @@ pub async fn setup_mint_with_pda_authority( AccountMeta::new(payer.pubkey(), true), AccountMeta::new(address_tree.tree, false), AccountMeta::new(output_queue, false), - AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new_readonly(COMPRESSIBLE_CONFIG_V1, false), AccountMeta::new(mint, false), - AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new(RENT_SPONSOR, false), AccountMeta::new_readonly(system_accounts.light_system_program, false), AccountMeta::new_readonly(system_accounts.cpi_authority_pda, false), AccountMeta::new_readonly(system_accounts.registered_program_pda, false), @@ -896,9 +885,9 @@ pub fn build_create_token_account_cpi_ix( AccountMeta::new(payer, true), AccountMeta::new(account, true), AccountMeta::new_readonly(mint, false), - AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new_readonly(COMPRESSIBLE_CONFIG_V1, false), AccountMeta::new_readonly(system_program::ID, false), - AccountMeta::new(rent_sponsor_pda(), false), + AccountMeta::new(RENT_SPONSOR, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data, @@ -923,9 +912,117 @@ pub fn build_create_token_account_signed_cpi_ix( AccountMeta::new(payer, true), AccountMeta::new(account, false), AccountMeta::new_readonly(mint, false), - AccountMeta::new_readonly(config_pda(), false), + AccountMeta::new_readonly(COMPRESSIBLE_CONFIG_V1, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new(RENT_SPONSOR, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_transfer_checked_cpi_ix( + source: Pubkey, + mint: Pubkey, + destination: Pubkey, + authority: Pubkey, + amount: u64, + decimals: u8, +) -> Instruction { + let mut data = vec![22u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(decimals); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(source, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new(destination, false), + AccountMeta::new_readonly(authority, true), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_transfer_checked_signed_cpi_ix( + source: Pubkey, + mint: Pubkey, + destination: Pubkey, + authority: Pubkey, + amount: u64, + decimals: u8, + bump: u8, +) -> Instruction { + let mut data = vec![23u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(decimals); + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(source, false), + AccountMeta::new_readonly(mint, false), + AccountMeta::new(destination, false), + AccountMeta::new_readonly(authority, false), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_mint_to_checked_cpi_ix( + mint: Pubkey, + destination: Pubkey, + authority: Pubkey, + amount: u64, + decimals: u8, +) -> Instruction { + let mut data = vec![24u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(decimals); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint, false), + AccountMeta::new(destination, false), + AccountMeta::new(authority, true), + AccountMeta::new_readonly(system_program::ID, false), + AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), + ], + data, + } +} + +#[allow(unused)] +pub fn build_mint_to_checked_signed_cpi_ix( + mint: Pubkey, + destination: Pubkey, + authority: Pubkey, + amount: u64, + decimals: u8, + bump: u8, +) -> Instruction { + let mut data = vec![25u8]; + data.extend_from_slice(&amount.to_le_bytes()); + data.push(decimals); + data.push(bump); + + Instruction { + program_id: PROGRAM_ID, + accounts: vec![ + AccountMeta::new(mint, false), + AccountMeta::new(destination, false), + AccountMeta::new(authority, false), AccountMeta::new_readonly(system_program::ID, false), - AccountMeta::new(rent_sponsor_pda(), false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ], data, diff --git a/program-examples/native/program/tests/transfer_checked.rs b/program-examples/native/program/tests/transfer_checked.rs new file mode 100644 index 00000000..8f7bac34 --- /dev/null +++ b/program-examples/native/program/tests/transfer_checked.rs @@ -0,0 +1,102 @@ +mod shared; + +use light_client::rpc::Rpc; +use shared::{ + build_transfer_checked_cpi_ix, build_transfer_checked_signed_cpi_ix, + create_ata, create_test_rpc, get_authority_pda, setup, setup_pda_owned_ata, + SetupContext, +}; +use solana_sdk::{signature::Keypair, signer::Signer}; + +#[tokio::test(flavor = "multi_thread")] +async fn transfer_checked_cpi() { + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup().await; + + let transfer_amount = 500_000u64; + + let recipient = Keypair::new(); + let recipient_ata = + create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + + let ix = build_transfer_checked_cpi_ix( + ata, + mint, + recipient_ata, + payer.pubkey(), + transfer_amount, + 9, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn transfer_checked_signed_cpi() { + let mut rpc = create_test_rpc().await; + let payer = rpc.get_payer().insecure_clone(); + + let (pda_authority, bump) = get_authority_pda(); + let initial_amount = 1_000_000u64; + + let (mint, pda_ata) = + setup_pda_owned_ata(&mut rpc, &payer, pda_authority, initial_amount) + .await; + + let recipient = Keypair::new(); + let recipient_ata = + create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + + let transfer_amount = 500_000u64; + let ix = build_transfer_checked_signed_cpi_ix( + pda_ata, + mint, + recipient_ata, + pda_authority, + transfer_amount, + 9, + bump, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} + +/// Tests transferring the exact balance from a token account. +#[tokio::test(flavor = "multi_thread")] +async fn transfer_checked_exact_balance_cpi() { + let SetupContext { + mut rpc, + payer, + mint, + ata, + .. + } = setup().await; + + let exact_balance = 1_000_000u64; + + let recipient = Keypair::new(); + let recipient_ata = + create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + + let ix = build_transfer_checked_cpi_ix( + ata, + mint, + recipient_ata, + payer.pubkey(), + exact_balance, + 9, + ); + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); +} From eb9fe29ed02b3c9546f6441bf0c3e429777b45ab Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Mon, 26 Jan 2026 22:29:00 +0000 Subject: [PATCH 10/12] docs: add module-level doc comments to instruction files Co-Authored-By: Claude Opus 4.5 --- program-examples/native/program/src/instructions/approve.rs | 2 ++ program-examples/native/program/src/instructions/burn.rs | 2 ++ program-examples/native/program/src/instructions/close.rs | 2 ++ .../native/program/src/instructions/create_ata.rs | 3 +++ .../native/program/src/instructions/create_mint.rs | 6 ++++++ .../native/program/src/instructions/create_token_account.rs | 3 +++ program-examples/native/program/src/instructions/freeze.rs | 3 +++ program-examples/native/program/src/instructions/mint_to.rs | 2 ++ .../native/program/src/instructions/mint_to_checked.rs | 2 ++ program-examples/native/program/src/instructions/revoke.rs | 2 ++ program-examples/native/program/src/instructions/thaw.rs | 3 +++ .../native/program/src/instructions/transfer_checked.rs | 4 ++++ .../native/program/src/instructions/transfer_interface.rs | 2 ++ 13 files changed, 36 insertions(+) diff --git a/program-examples/native/program/src/instructions/approve.rs b/program-examples/native/program/src/instructions/approve.rs index bfce06dd..ff2020db 100644 --- a/program-examples/native/program/src/instructions/approve.rs +++ b/program-examples/native/program/src/instructions/approve.rs @@ -1,3 +1,5 @@ +//! Approves a delegate to transfer tokens on behalf of the owner. + use super::authority_seeds; use light_token::instruction::ApproveCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/burn.rs b/program-examples/native/program/src/instructions/burn.rs index 412aafc3..a8641f5e 100644 --- a/program-examples/native/program/src/instructions/burn.rs +++ b/program-examples/native/program/src/instructions/burn.rs @@ -1,3 +1,5 @@ +//! Burns tokens from a source account, reducing total supply. + use super::authority_seeds; use light_token::instruction::BurnCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/close.rs b/program-examples/native/program/src/instructions/close.rs index 00c27402..438864e7 100644 --- a/program-examples/native/program/src/instructions/close.rs +++ b/program-examples/native/program/src/instructions/close.rs @@ -1,3 +1,5 @@ +//! Closes a token account. Account must be empty (balance = 0) to close. + use super::authority_seeds; use light_token::instruction::CloseAccountCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/create_ata.rs b/program-examples/native/program/src/instructions/create_ata.rs index b3478125..3d55c063 100644 --- a/program-examples/native/program/src/instructions/create_ata.rs +++ b/program-examples/native/program/src/instructions/create_ata.rs @@ -1,3 +1,6 @@ +//! Creates an associated token account. +//! You can use light, spl, t22 mints to create a light token ATA. + use super::authority_seeds; use light_token::instruction::CreateAssociatedAccountCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/create_mint.rs b/program-examples/native/program/src/instructions/create_mint.rs index bfd34b8d..04390c92 100644 --- a/program-examples/native/program/src/instructions/create_mint.rs +++ b/program-examples/native/program/src/instructions/create_mint.rs @@ -1,3 +1,9 @@ +//! Creates a new Light token mint. +//! +//! Rent parameters: +//! - rent_payment: ~24 hours rent per unit +//! - write_top_up: ~3 hours rent per write + use super::authority_seeds; use borsh::BorshDeserialize; use light_compressible::CreateAccountsProof; diff --git a/program-examples/native/program/src/instructions/create_token_account.rs b/program-examples/native/program/src/instructions/create_token_account.rs index 84ba9c7e..d5dde3ce 100644 --- a/program-examples/native/program/src/instructions/create_token_account.rs +++ b/program-examples/native/program/src/instructions/create_token_account.rs @@ -1,3 +1,6 @@ +//! Creates a token account. +//! You can use light, spl, t22 mints to create a light token account. +//! use super::authority_seeds; use light_token::instruction::CreateTokenAccountCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/freeze.rs b/program-examples/native/program/src/instructions/freeze.rs index a6345988..35cf8629 100644 --- a/program-examples/native/program/src/instructions/freeze.rs +++ b/program-examples/native/program/src/instructions/freeze.rs @@ -1,3 +1,6 @@ +//! Freezes a token account. +//! freeze_authority must match what was set during mint creation. + use super::authority_seeds; use light_token::instruction::FreezeCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/mint_to.rs b/program-examples/native/program/src/instructions/mint_to.rs index 4181f4fb..6eabf3b5 100644 --- a/program-examples/native/program/src/instructions/mint_to.rs +++ b/program-examples/native/program/src/instructions/mint_to.rs @@ -1,3 +1,5 @@ +//! Mints tokens to a destination account. + use super::authority_seeds; use light_token::instruction::MintToCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/mint_to_checked.rs b/program-examples/native/program/src/instructions/mint_to_checked.rs index a9e910ca..542ce7b7 100644 --- a/program-examples/native/program/src/instructions/mint_to_checked.rs +++ b/program-examples/native/program/src/instructions/mint_to_checked.rs @@ -1,3 +1,5 @@ +//! MintToChecked validates decimals match the mint's decimals. + use super::authority_seeds; use light_token::instruction::MintToCheckedCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/revoke.rs b/program-examples/native/program/src/instructions/revoke.rs index 4e2fb02c..d5969bcd 100644 --- a/program-examples/native/program/src/instructions/revoke.rs +++ b/program-examples/native/program/src/instructions/revoke.rs @@ -1,3 +1,5 @@ +//! Revokes delegate authority from a token account. + use super::authority_seeds; use light_token::instruction::RevokeCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/thaw.rs b/program-examples/native/program/src/instructions/thaw.rs index e1e7f26a..323cc51b 100644 --- a/program-examples/native/program/src/instructions/thaw.rs +++ b/program-examples/native/program/src/instructions/thaw.rs @@ -1,3 +1,6 @@ +//! Thaws a frozen token account. +//! freeze_authority must match what was set during mint creation. + use super::authority_seeds; use light_token::instruction::ThawCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/transfer_checked.rs b/program-examples/native/program/src/instructions/transfer_checked.rs index 3a3fa0fc..6e5d02df 100644 --- a/program-examples/native/program/src/instructions/transfer_checked.rs +++ b/program-examples/native/program/src/instructions/transfer_checked.rs @@ -1,3 +1,7 @@ +//! TransferChecked validates decimals match the mint's decimals. +//! Only use for Light->Light transfers. +//! Use TransferInterface for all other transfers (Light, SPL or Token-2022). + use super::authority_seeds; use light_token::instruction::TransferCheckedCpi; use solana_program::{ diff --git a/program-examples/native/program/src/instructions/transfer_interface.rs b/program-examples/native/program/src/instructions/transfer_interface.rs index 0df03788..130e1365 100644 --- a/program-examples/native/program/src/instructions/transfer_interface.rs +++ b/program-examples/native/program/src/instructions/transfer_interface.rs @@ -1,3 +1,5 @@ +//! Transfers tokens between accounts (SPL, Token-2022, or Light) in a single call. + use super::authority_seeds; use light_token::instruction::TransferInterfaceCpi; use solana_program::{ From 8e5b71d382ad77570c2c97531121402782fa36bf Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Mon, 26 Jan 2026 23:00:44 +0000 Subject: [PATCH 11/12] refactor: rename native to native-rust, move module docs inline, simplify test comments --- .../{native => native-rust}/Cargo.lock | 0 .../{native => native-rust}/Cargo.toml | 0 .../{native => native-rust}/README.md | 0 .../program/Cargo.toml | 0 .../program/src/instructions/approve.rs | 3 +- .../program/src/instructions/burn.rs | 3 +- .../program/src/instructions/close.rs | 3 +- .../program/src/instructions/create_ata.rs | 4 +-- .../program/src/instructions/create_mint.rs | 7 +--- .../src/instructions/create_token_account.rs | 4 +-- .../program/src/instructions/freeze.rs | 4 +-- .../program/src/instructions/mint_to.rs | 3 +- .../src/instructions/mint_to_checked.rs | 3 +- .../program/src/instructions/mod.rs | 0 .../program/src/instructions/revoke.rs | 3 +- .../program/src/instructions/thaw.rs | 4 +-- .../src/instructions/transfer_checked.rs | 5 +-- .../src/instructions/transfer_interface.rs | 3 +- .../program/src/lib.rs | 0 .../program/tests/approve.rs | 32 ------------------- .../program/tests/burn.rs | 0 .../program/tests/close.rs | 0 .../program/tests/create_ata.rs | 0 .../program/tests/create_mint.rs | 0 .../program/tests/create_token_account.rs | 0 .../program/tests/freeze.rs | 0 .../program/tests/mint_to.rs | 10 ++---- .../program/tests/mint_to_checked.rs | 0 .../program/tests/revoke.rs | 0 .../program/tests/shared.rs | 0 .../program/tests/thaw.rs | 0 .../program/tests/transfer.rs | 5 +-- .../program/tests/transfer_checked.rs | 0 .../rust-toolchain.toml | 0 .../{native => native-rust}/rustfmt.toml | 0 35 files changed, 16 insertions(+), 80 deletions(-) rename program-examples/{native => native-rust}/Cargo.lock (100%) rename program-examples/{native => native-rust}/Cargo.toml (100%) rename program-examples/{native => native-rust}/README.md (100%) rename program-examples/{native => native-rust}/program/Cargo.toml (100%) rename program-examples/{native => native-rust}/program/src/instructions/approve.rs (95%) rename program-examples/{native => native-rust}/program/src/instructions/burn.rs (96%) rename program-examples/{native => native-rust}/program/src/instructions/close.rs (94%) rename program-examples/{native => native-rust}/program/src/instructions/create_ata.rs (95%) rename program-examples/{native => native-rust}/program/src/instructions/create_mint.rs (97%) rename program-examples/{native => native-rust}/program/src/instructions/create_token_account.rs (95%) rename program-examples/{native => native-rust}/program/src/instructions/freeze.rs (92%) rename program-examples/{native => native-rust}/program/src/instructions/mint_to.rs (97%) rename program-examples/{native => native-rust}/program/src/instructions/mint_to_checked.rs (96%) rename program-examples/{native => native-rust}/program/src/instructions/mod.rs (100%) rename program-examples/{native => native-rust}/program/src/instructions/revoke.rs (95%) rename program-examples/{native => native-rust}/program/src/instructions/thaw.rs (91%) rename program-examples/{native => native-rust}/program/src/instructions/transfer_checked.rs (90%) rename program-examples/{native => native-rust}/program/src/instructions/transfer_interface.rs (95%) rename program-examples/{native => native-rust}/program/src/lib.rs (100%) rename program-examples/{native => native-rust}/program/tests/approve.rs (72%) rename program-examples/{native => native-rust}/program/tests/burn.rs (100%) rename program-examples/{native => native-rust}/program/tests/close.rs (100%) rename program-examples/{native => native-rust}/program/tests/create_ata.rs (100%) rename program-examples/{native => native-rust}/program/tests/create_mint.rs (100%) rename program-examples/{native => native-rust}/program/tests/create_token_account.rs (100%) rename program-examples/{native => native-rust}/program/tests/freeze.rs (100%) rename program-examples/{native => native-rust}/program/tests/mint_to.rs (86%) rename program-examples/{native => native-rust}/program/tests/mint_to_checked.rs (100%) rename program-examples/{native => native-rust}/program/tests/revoke.rs (100%) rename program-examples/{native => native-rust}/program/tests/shared.rs (100%) rename program-examples/{native => native-rust}/program/tests/thaw.rs (100%) rename program-examples/{native => native-rust}/program/tests/transfer.rs (93%) rename program-examples/{native => native-rust}/program/tests/transfer_checked.rs (100%) rename program-examples/{native => native-rust}/rust-toolchain.toml (100%) rename program-examples/{native => native-rust}/rustfmt.toml (100%) diff --git a/program-examples/native/Cargo.lock b/program-examples/native-rust/Cargo.lock similarity index 100% rename from program-examples/native/Cargo.lock rename to program-examples/native-rust/Cargo.lock diff --git a/program-examples/native/Cargo.toml b/program-examples/native-rust/Cargo.toml similarity index 100% rename from program-examples/native/Cargo.toml rename to program-examples/native-rust/Cargo.toml diff --git a/program-examples/native/README.md b/program-examples/native-rust/README.md similarity index 100% rename from program-examples/native/README.md rename to program-examples/native-rust/README.md diff --git a/program-examples/native/program/Cargo.toml b/program-examples/native-rust/program/Cargo.toml similarity index 100% rename from program-examples/native/program/Cargo.toml rename to program-examples/native-rust/program/Cargo.toml diff --git a/program-examples/native/program/src/instructions/approve.rs b/program-examples/native-rust/program/src/instructions/approve.rs similarity index 95% rename from program-examples/native/program/src/instructions/approve.rs rename to program-examples/native-rust/program/src/instructions/approve.rs index ff2020db..03e0228a 100644 --- a/program-examples/native/program/src/instructions/approve.rs +++ b/program-examples/native-rust/program/src/instructions/approve.rs @@ -1,5 +1,3 @@ -//! Approves a delegate to transfer tokens on behalf of the owner. - use super::authority_seeds; use light_token::instruction::ApproveCpi; use solana_program::{ @@ -19,6 +17,7 @@ pub fn approve_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { .map_err(|_| ProgramError::InvalidInstructionData)?, ); + // Approve delegate to transfer tokens on behalf of owner ApproveCpi { token_account: token_account.clone(), delegate: delegate.clone(), diff --git a/program-examples/native/program/src/instructions/burn.rs b/program-examples/native-rust/program/src/instructions/burn.rs similarity index 96% rename from program-examples/native/program/src/instructions/burn.rs rename to program-examples/native-rust/program/src/instructions/burn.rs index a8641f5e..0b373080 100644 --- a/program-examples/native/program/src/instructions/burn.rs +++ b/program-examples/native-rust/program/src/instructions/burn.rs @@ -1,5 +1,3 @@ -//! Burns tokens from a source account, reducing total supply. - use super::authority_seeds; use light_token::instruction::BurnCpi; use solana_program::{ @@ -17,6 +15,7 @@ pub fn burn_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { .map_err(|_| ProgramError::InvalidInstructionData)?, ); + // Burn tokens from source account, reducing total supply BurnCpi { source: source.clone(), mint: mint.clone(), diff --git a/program-examples/native/program/src/instructions/close.rs b/program-examples/native-rust/program/src/instructions/close.rs similarity index 94% rename from program-examples/native/program/src/instructions/close.rs rename to program-examples/native-rust/program/src/instructions/close.rs index 438864e7..74820031 100644 --- a/program-examples/native/program/src/instructions/close.rs +++ b/program-examples/native-rust/program/src/instructions/close.rs @@ -1,5 +1,3 @@ -//! Closes a token account. Account must be empty (balance = 0) to close. - use super::authority_seeds; use light_token::instruction::CloseAccountCpi; use solana_program::{ @@ -13,6 +11,7 @@ pub fn close_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { return Err(ProgramError::NotEnoughAccountKeys); }; + // Close token account. Must be empty (balance = 0) CloseAccountCpi { token_program: token_program.clone(), account: account.clone(), diff --git a/program-examples/native/program/src/instructions/create_ata.rs b/program-examples/native-rust/program/src/instructions/create_ata.rs similarity index 95% rename from program-examples/native/program/src/instructions/create_ata.rs rename to program-examples/native-rust/program/src/instructions/create_ata.rs index 3d55c063..76a1d4fb 100644 --- a/program-examples/native/program/src/instructions/create_ata.rs +++ b/program-examples/native-rust/program/src/instructions/create_ata.rs @@ -1,6 +1,3 @@ -//! Creates an associated token account. -//! You can use light, spl, t22 mints to create a light token ATA. - use super::authority_seeds; use light_token::instruction::CreateAssociatedAccountCpi; use solana_program::{ @@ -25,6 +22,7 @@ pub fn create_ata_invoke( let bump = data[0]; let idempotent = data.get(1).copied().unwrap_or(0) != 0; + // Create associated token account. Works with light, spl, t22 mints let cpi = CreateAssociatedAccountCpi { payer: payer.clone(), owner: owner.clone(), diff --git a/program-examples/native/program/src/instructions/create_mint.rs b/program-examples/native-rust/program/src/instructions/create_mint.rs similarity index 97% rename from program-examples/native/program/src/instructions/create_mint.rs rename to program-examples/native-rust/program/src/instructions/create_mint.rs index 04390c92..43e27505 100644 --- a/program-examples/native/program/src/instructions/create_mint.rs +++ b/program-examples/native-rust/program/src/instructions/create_mint.rs @@ -1,9 +1,3 @@ -//! Creates a new Light token mint. -//! -//! Rent parameters: -//! - rent_payment: ~24 hours rent per unit -//! - write_top_up: ~3 hours rent per write - use super::authority_seeds; use borsh::BorshDeserialize; use light_compressible::CreateAccountsProof; @@ -84,6 +78,7 @@ pub fn create_mint_invoke( _ => None, }; + // Create mint. rent_payment: ~24h rent/unit, write_top_up: ~3h rent/write let params = CreateMintParams { decimals: ix_data.decimals, address_merkle_tree_root_index: ix_data diff --git a/program-examples/native/program/src/instructions/create_token_account.rs b/program-examples/native-rust/program/src/instructions/create_token_account.rs similarity index 95% rename from program-examples/native/program/src/instructions/create_token_account.rs rename to program-examples/native-rust/program/src/instructions/create_token_account.rs index d5dde3ce..2fbb6109 100644 --- a/program-examples/native/program/src/instructions/create_token_account.rs +++ b/program-examples/native-rust/program/src/instructions/create_token_account.rs @@ -1,6 +1,3 @@ -//! Creates a token account. -//! You can use light, spl, t22 mints to create a light token account. -//! use super::authority_seeds; use light_token::instruction::CreateTokenAccountCpi; use solana_program::{ @@ -33,6 +30,7 @@ pub fn create_token_account_invoke( let owner = Pubkey::try_from(&data[0..32]) .map_err(|_| ProgramError::InvalidInstructionData)?; + // Create token account. Works with light, spl, t22 mints CreateTokenAccountCpi { payer: payer.clone(), account: account.clone(), diff --git a/program-examples/native/program/src/instructions/freeze.rs b/program-examples/native-rust/program/src/instructions/freeze.rs similarity index 92% rename from program-examples/native/program/src/instructions/freeze.rs rename to program-examples/native-rust/program/src/instructions/freeze.rs index 35cf8629..9fb107db 100644 --- a/program-examples/native/program/src/instructions/freeze.rs +++ b/program-examples/native-rust/program/src/instructions/freeze.rs @@ -1,6 +1,3 @@ -//! Freezes a token account. -//! freeze_authority must match what was set during mint creation. - use super::authority_seeds; use light_token::instruction::FreezeCpi; use solana_program::{ @@ -14,6 +11,7 @@ pub fn freeze_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { return Err(ProgramError::NotEnoughAccountKeys); }; + // Freeze token account. freeze_authority must match mint creation FreezeCpi { token_account: token_account.clone(), mint: mint.clone(), diff --git a/program-examples/native/program/src/instructions/mint_to.rs b/program-examples/native-rust/program/src/instructions/mint_to.rs similarity index 97% rename from program-examples/native/program/src/instructions/mint_to.rs rename to program-examples/native-rust/program/src/instructions/mint_to.rs index 6eabf3b5..8f831d09 100644 --- a/program-examples/native/program/src/instructions/mint_to.rs +++ b/program-examples/native-rust/program/src/instructions/mint_to.rs @@ -1,5 +1,3 @@ -//! Mints tokens to a destination account. - use super::authority_seeds; use light_token::instruction::MintToCpi; use solana_program::{ @@ -19,6 +17,7 @@ pub fn mint_to_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { .map_err(|_| ProgramError::InvalidInstructionData)?, ); + // Mint tokens to destination account MintToCpi { mint: mint.clone(), destination: destination.clone(), diff --git a/program-examples/native/program/src/instructions/mint_to_checked.rs b/program-examples/native-rust/program/src/instructions/mint_to_checked.rs similarity index 96% rename from program-examples/native/program/src/instructions/mint_to_checked.rs rename to program-examples/native-rust/program/src/instructions/mint_to_checked.rs index 542ce7b7..4b3053f6 100644 --- a/program-examples/native/program/src/instructions/mint_to_checked.rs +++ b/program-examples/native-rust/program/src/instructions/mint_to_checked.rs @@ -1,5 +1,3 @@ -//! MintToChecked validates decimals match the mint's decimals. - use super::authority_seeds; use light_token::instruction::MintToCheckedCpi; use solana_program::{ @@ -21,6 +19,7 @@ pub fn mint_to_checked_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramR let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); let decimals = data[8]; + // MintToChecked validates decimals match the mint MintToCheckedCpi { mint: mint.clone(), destination: destination.clone(), diff --git a/program-examples/native/program/src/instructions/mod.rs b/program-examples/native-rust/program/src/instructions/mod.rs similarity index 100% rename from program-examples/native/program/src/instructions/mod.rs rename to program-examples/native-rust/program/src/instructions/mod.rs diff --git a/program-examples/native/program/src/instructions/revoke.rs b/program-examples/native-rust/program/src/instructions/revoke.rs similarity index 95% rename from program-examples/native/program/src/instructions/revoke.rs rename to program-examples/native-rust/program/src/instructions/revoke.rs index d5969bcd..5e949e3a 100644 --- a/program-examples/native/program/src/instructions/revoke.rs +++ b/program-examples/native-rust/program/src/instructions/revoke.rs @@ -1,5 +1,3 @@ -//! Revokes delegate authority from a token account. - use super::authority_seeds; use light_token::instruction::RevokeCpi; use solana_program::{ @@ -13,6 +11,7 @@ pub fn revoke_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { return Err(ProgramError::NotEnoughAccountKeys); }; + // Revoke delegate authority from token account RevokeCpi { token_account: token_account.clone(), owner: owner.clone(), diff --git a/program-examples/native/program/src/instructions/thaw.rs b/program-examples/native-rust/program/src/instructions/thaw.rs similarity index 91% rename from program-examples/native/program/src/instructions/thaw.rs rename to program-examples/native-rust/program/src/instructions/thaw.rs index 323cc51b..75e4b63b 100644 --- a/program-examples/native/program/src/instructions/thaw.rs +++ b/program-examples/native-rust/program/src/instructions/thaw.rs @@ -1,6 +1,3 @@ -//! Thaws a frozen token account. -//! freeze_authority must match what was set during mint creation. - use super::authority_seeds; use light_token::instruction::ThawCpi; use solana_program::{ @@ -14,6 +11,7 @@ pub fn thaw_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { return Err(ProgramError::NotEnoughAccountKeys); }; + // Thaw frozen token account. freeze_authority must match mint creation ThawCpi { token_account: token_account.clone(), mint: mint.clone(), diff --git a/program-examples/native/program/src/instructions/transfer_checked.rs b/program-examples/native-rust/program/src/instructions/transfer_checked.rs similarity index 90% rename from program-examples/native/program/src/instructions/transfer_checked.rs rename to program-examples/native-rust/program/src/instructions/transfer_checked.rs index 6e5d02df..c107e159 100644 --- a/program-examples/native/program/src/instructions/transfer_checked.rs +++ b/program-examples/native-rust/program/src/instructions/transfer_checked.rs @@ -1,7 +1,3 @@ -//! TransferChecked validates decimals match the mint's decimals. -//! Only use for Light->Light transfers. -//! Use TransferInterface for all other transfers (Light, SPL or Token-2022). - use super::authority_seeds; use light_token::instruction::TransferCheckedCpi; use solana_program::{ @@ -23,6 +19,7 @@ pub fn transfer_checked_invoke(accounts: &[AccountInfo], data: &[u8]) -> Program let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); let decimals = data[8]; + // TransferChecked validates decimals. Only for Light->Light. Use TransferInterface for SPL/T22 TransferCheckedCpi { source: source.clone(), mint: mint.clone(), diff --git a/program-examples/native/program/src/instructions/transfer_interface.rs b/program-examples/native-rust/program/src/instructions/transfer_interface.rs similarity index 95% rename from program-examples/native/program/src/instructions/transfer_interface.rs rename to program-examples/native-rust/program/src/instructions/transfer_interface.rs index 130e1365..cc412ab9 100644 --- a/program-examples/native/program/src/instructions/transfer_interface.rs +++ b/program-examples/native-rust/program/src/instructions/transfer_interface.rs @@ -1,5 +1,3 @@ -//! Transfers tokens between accounts (SPL, Token-2022, or Light) in a single call. - use super::authority_seeds; use light_token::instruction::TransferInterfaceCpi; use solana_program::{ @@ -21,6 +19,7 @@ pub fn transfer_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { let amount = u64::from_le_bytes(data[0..8].try_into().unwrap()); let decimals = data[8]; + // Transfer tokens between accounts (SPL, Token-2022, or Light) TransferInterfaceCpi::new( amount, decimals, diff --git a/program-examples/native/program/src/lib.rs b/program-examples/native-rust/program/src/lib.rs similarity index 100% rename from program-examples/native/program/src/lib.rs rename to program-examples/native-rust/program/src/lib.rs diff --git a/program-examples/native/program/tests/approve.rs b/program-examples/native-rust/program/tests/approve.rs similarity index 72% rename from program-examples/native/program/tests/approve.rs rename to program-examples/native-rust/program/tests/approve.rs index 04c96c51..5da4d88c 100644 --- a/program-examples/native/program/tests/approve.rs +++ b/program-examples/native-rust/program/tests/approve.rs @@ -72,35 +72,3 @@ async fn approve_signed_cpi() { assert_eq!(token_state.delegate, Some(delegate.pubkey().into())); assert_eq!(token_state.delegated_amount, delegate_amount); } - -#[tokio::test(flavor = "multi_thread")] -async fn approve_fails_with_wrong_owner() { - // Setup: create mint and ATA with tokens - let SetupContext { - mut rpc, - payer, - ata, - .. - } = setup_empty_ata().await; - - let wrong_owner = Keypair::new(); - let delegate = Keypair::new(); - let delegate_amount = 500_000u64; - - // Try to approve with wrong owner (wrong_owner is not the actual owner) - let ix = build_approve_cpi_ix( - ata, - delegate.pubkey(), - wrong_owner.pubkey(), - delegate_amount, - ); - - let result = rpc - .create_and_send_transaction( - &[ix], - &payer.pubkey(), - &[&payer, &wrong_owner], - ) - .await; - assert!(result.is_err(), "Approve with wrong owner should fail"); -} diff --git a/program-examples/native/program/tests/burn.rs b/program-examples/native-rust/program/tests/burn.rs similarity index 100% rename from program-examples/native/program/tests/burn.rs rename to program-examples/native-rust/program/tests/burn.rs diff --git a/program-examples/native/program/tests/close.rs b/program-examples/native-rust/program/tests/close.rs similarity index 100% rename from program-examples/native/program/tests/close.rs rename to program-examples/native-rust/program/tests/close.rs diff --git a/program-examples/native/program/tests/create_ata.rs b/program-examples/native-rust/program/tests/create_ata.rs similarity index 100% rename from program-examples/native/program/tests/create_ata.rs rename to program-examples/native-rust/program/tests/create_ata.rs diff --git a/program-examples/native/program/tests/create_mint.rs b/program-examples/native-rust/program/tests/create_mint.rs similarity index 100% rename from program-examples/native/program/tests/create_mint.rs rename to program-examples/native-rust/program/tests/create_mint.rs diff --git a/program-examples/native/program/tests/create_token_account.rs b/program-examples/native-rust/program/tests/create_token_account.rs similarity index 100% rename from program-examples/native/program/tests/create_token_account.rs rename to program-examples/native-rust/program/tests/create_token_account.rs diff --git a/program-examples/native/program/tests/freeze.rs b/program-examples/native-rust/program/tests/freeze.rs similarity index 100% rename from program-examples/native/program/tests/freeze.rs rename to program-examples/native-rust/program/tests/freeze.rs diff --git a/program-examples/native/program/tests/mint_to.rs b/program-examples/native-rust/program/tests/mint_to.rs similarity index 86% rename from program-examples/native/program/tests/mint_to.rs rename to program-examples/native-rust/program/tests/mint_to.rs index 29a32eac..129233ca 100644 --- a/program-examples/native/program/tests/mint_to.rs +++ b/program-examples/native-rust/program/tests/mint_to.rs @@ -30,10 +30,7 @@ async fn mint_to_cpi() { .unwrap(); } -/// Tests minting tokens via CPI with a PDA authority. -/// -/// Uses `setup_mint_with_pda_authority` to create a mint where the program's -/// PDA is the mint authority, then mints tokens using a signed CPI call. +/// Mints tokens via CPI with PDA authority. #[tokio::test(flavor = "multi_thread")] async fn mint_to_signed_cpi() { let mut rpc = create_test_rpc().await; @@ -69,10 +66,7 @@ async fn mint_to_signed_cpi() { .unwrap(); } -/// Tests minting tokens via signed CPI using the CPI-style ATA creation. -/// -/// This test demonstrates the full flow of creating a mint with PDA authority, -/// creating an ATA using the CPI instruction, and minting tokens. +/// Mints tokens using CPI-style ATA creation. #[tokio::test(flavor = "multi_thread")] async fn mint_to_signed_cpi_with_ata_cpi() { let mut rpc = create_test_rpc().await; diff --git a/program-examples/native/program/tests/mint_to_checked.rs b/program-examples/native-rust/program/tests/mint_to_checked.rs similarity index 100% rename from program-examples/native/program/tests/mint_to_checked.rs rename to program-examples/native-rust/program/tests/mint_to_checked.rs diff --git a/program-examples/native/program/tests/revoke.rs b/program-examples/native-rust/program/tests/revoke.rs similarity index 100% rename from program-examples/native/program/tests/revoke.rs rename to program-examples/native-rust/program/tests/revoke.rs diff --git a/program-examples/native/program/tests/shared.rs b/program-examples/native-rust/program/tests/shared.rs similarity index 100% rename from program-examples/native/program/tests/shared.rs rename to program-examples/native-rust/program/tests/shared.rs diff --git a/program-examples/native/program/tests/thaw.rs b/program-examples/native-rust/program/tests/thaw.rs similarity index 100% rename from program-examples/native/program/tests/thaw.rs rename to program-examples/native-rust/program/tests/thaw.rs diff --git a/program-examples/native/program/tests/transfer.rs b/program-examples/native-rust/program/tests/transfer.rs similarity index 93% rename from program-examples/native/program/tests/transfer.rs rename to program-examples/native-rust/program/tests/transfer.rs index db6f0996..4e29a1a9 100644 --- a/program-examples/native/program/tests/transfer.rs +++ b/program-examples/native-rust/program/tests/transfer.rs @@ -77,10 +77,7 @@ async fn transfer_interface_signed_cpi() { .unwrap(); } -/// Tests transferring the exact balance from a token account. -/// -/// This edge case verifies that transferring the entire balance succeeds -/// and leaves the source account with zero tokens remaining. +/// Transfers exact balance from token account. #[tokio::test(flavor = "multi_thread")] async fn transfer_exact_balance_cpi() { let SetupContext { diff --git a/program-examples/native/program/tests/transfer_checked.rs b/program-examples/native-rust/program/tests/transfer_checked.rs similarity index 100% rename from program-examples/native/program/tests/transfer_checked.rs rename to program-examples/native-rust/program/tests/transfer_checked.rs diff --git a/program-examples/native/rust-toolchain.toml b/program-examples/native-rust/rust-toolchain.toml similarity index 100% rename from program-examples/native/rust-toolchain.toml rename to program-examples/native-rust/rust-toolchain.toml diff --git a/program-examples/native/rustfmt.toml b/program-examples/native-rust/rustfmt.toml similarity index 100% rename from program-examples/native/rustfmt.toml rename to program-examples/native-rust/rustfmt.toml From 431bc9bf366cd8111b4460b4533adecea86fa70c Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Tue, 27 Jan 2026 14:53:59 +0000 Subject: [PATCH 12/12] fixes --- program-examples/native-rust/Cargo.toml | 2 +- program-examples/native-rust/README.md | 28 ++++++------- .../native-rust/program/Cargo.toml | 1 - .../program/src/instructions/burn.rs | 6 ++- .../program/src/instructions/close.rs | 2 +- .../program/src/instructions/create_mint.rs | 42 +++---------------- .../src/instructions/mint_to_checked.rs | 5 ++- .../src/instructions/transfer_checked.rs | 5 ++- .../native-rust/program/tests/approve.rs | 3 +- .../native-rust/program/tests/create_mint.rs | 2 +- .../native-rust/program/tests/freeze.rs | 4 +- .../program/tests/mint_to_checked.rs | 14 ++++--- .../native-rust/program/tests/shared.rs | 41 +++++++++++------- 13 files changed, 73 insertions(+), 82 deletions(-) diff --git a/program-examples/native-rust/Cargo.toml b/program-examples/native-rust/Cargo.toml index f977cad3..f55cfc9e 100644 --- a/program-examples/native-rust/Cargo.toml +++ b/program-examples/native-rust/Cargo.toml @@ -5,7 +5,7 @@ resolver = "2" [workspace.dependencies] # Pin to match light-protocol Cargo.lock constant_time_eq = "=0.3.1" -blake3 = "=1.5.5" +blake3 = "=1.8.2" [profile.release] overflow-checks = true diff --git a/program-examples/native-rust/README.md b/program-examples/native-rust/README.md index ef5b58ad..3306c1d5 100644 --- a/program-examples/native-rust/README.md +++ b/program-examples/native-rust/README.md @@ -1,31 +1,31 @@ # Light Token Native Rust Solana Programs +- **approve** - Approve delegate via CPI + - [Instruction](program/src/instructions/approve.rs) | [Test](program/tests/approve.rs) +- **burn** - Burn tokens via CPI + - [Instruction](program/src/instructions/burn.rs) | [Test](program/tests/burn.rs) +- **close** - Close token account via CPI + - [Instruction](program/src/instructions/close.rs) | [Test](program/tests/close.rs) +- **create-associated** - Create an associated light-token account via CPI + - [Instruction](program/src/instructions/create_ata.rs) | [Test](program/tests/create_ata.rs) - **create-mint** - Create a light-token mint via CPI - [Instruction](program/src/instructions/create_mint.rs) | [Test](program/tests/create_mint.rs) -- **create-ata** - Create an associated light-token account via CPI - - [Instruction](program/src/instructions/create_ata.rs) | [Test](program/tests/create_ata.rs) - **create-token-account** - Create a light-token account via CPI - [Instruction](program/src/instructions/create_token_account.rs) | [Test](program/tests/create_token_account.rs) +- **freeze** - Freeze token account via CPI + - [Instruction](program/src/instructions/freeze.rs) | [Test](program/tests/freeze.rs) - **mint-to** - Mint tokens via CPI - [Instruction](program/src/instructions/mint_to.rs) | [Test](program/tests/mint_to.rs) - **mint-to-checked** - Mint tokens with decimal validation via CPI - [Instruction](program/src/instructions/mint_to_checked.rs) | [Test](program/tests/mint_to_checked.rs) -- **transfer-interface** - Transfer between light-token, T22, and SPL accounts via CPI - - [Instruction](program/src/instructions/transfer_interface.rs) | [Test](program/tests/transfer.rs) -- **transfer-checked** - Transfer with decimal validation against mint via CPI - - [Instruction](program/src/instructions/transfer_checked.rs) | [Test](program/tests/transfer_checked.rs) -- **approve** - Approve delegate via CPI - - [Instruction](program/src/instructions/approve.rs) | [Test](program/tests/approve.rs) - **revoke** - Revoke delegate via CPI - [Instruction](program/src/instructions/revoke.rs) | [Test](program/tests/revoke.rs) -- **burn** - Burn tokens via CPI - - [Instruction](program/src/instructions/burn.rs) | [Test](program/tests/burn.rs) -- **freeze** - Freeze token account via CPI - - [Instruction](program/src/instructions/freeze.rs) | [Test](program/tests/freeze.rs) - **thaw** - Thaw token account via CPI - [Instruction](program/src/instructions/thaw.rs) | [Test](program/tests/thaw.rs) -- **close** - Close token account via CPI - - [Instruction](program/src/instructions/close.rs) | [Test](program/tests/close.rs) +- **transfer-checked** - Transfer with decimal validation against mint via CPI + - [Instruction](program/src/instructions/transfer_checked.rs) | [Test](program/tests/transfer_checked.rs) +- **transfer-interface** - Transfer between light-token, T22, and SPL accounts via CPI + - [Instruction](program/src/instructions/transfer_interface.rs) | [Test](program/tests/transfer.rs) ## Build diff --git a/program-examples/native-rust/program/Cargo.toml b/program-examples/native-rust/program/Cargo.toml index 7927a53c..71599c10 100644 --- a/program-examples/native-rust/program/Cargo.toml +++ b/program-examples/native-rust/program/Cargo.toml @@ -13,7 +13,6 @@ default = [] [dependencies] light-token = "0.4.0" -light-token-interface = "0.3.0" light-compressible = "0.4.0" solana-program = "2.2" borsh = "0.10.4" diff --git a/program-examples/native-rust/program/src/instructions/burn.rs b/program-examples/native-rust/program/src/instructions/burn.rs index 0b373080..a1e6dd56 100644 --- a/program-examples/native-rust/program/src/instructions/burn.rs +++ b/program-examples/native-rust/program/src/instructions/burn.rs @@ -6,7 +6,8 @@ use solana_program::{ }; pub fn burn_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { - let [source, mint, authority, system_program, _token_program] = accounts else { + let [source, mint, authority, system_program, _token_program] = accounts + else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -32,7 +33,8 @@ pub fn burn_invoke_signed( accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [source, mint, authority, system_program, _token_program] = accounts else { + let [source, mint, authority, system_program, _token_program] = accounts + else { return Err(ProgramError::NotEnoughAccountKeys); }; diff --git a/program-examples/native-rust/program/src/instructions/close.rs b/program-examples/native-rust/program/src/instructions/close.rs index 74820031..68ba5098 100644 --- a/program-examples/native-rust/program/src/instructions/close.rs +++ b/program-examples/native-rust/program/src/instructions/close.rs @@ -11,7 +11,7 @@ pub fn close_invoke(accounts: &[AccountInfo], _data: &[u8]) -> ProgramResult { return Err(ProgramError::NotEnoughAccountKeys); }; - // Close token account. Must be empty (balance = 0) + // Close token account. Must be empty (balance == 0) CloseAccountCpi { token_program: token_program.clone(), account: account.clone(), diff --git a/program-examples/native-rust/program/src/instructions/create_mint.rs b/program-examples/native-rust/program/src/instructions/create_mint.rs index 43e27505..81186744 100644 --- a/program-examples/native-rust/program/src/instructions/create_mint.rs +++ b/program-examples/native-rust/program/src/instructions/create_mint.rs @@ -4,8 +4,8 @@ use light_compressible::CreateAccountsProof; use light_token::instruction::{ CreateMintCpi, CreateMintParams, SystemAccountInfos, }; -use light_token_interface::instructions::extensions::{ - token_metadata::TokenMetadataInstructionData, ExtensionInstructionData, +use light_token::instruction::{ + ExtensionInstructionData, TokenMetadataInstructionData, }; use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, @@ -32,23 +32,8 @@ pub fn create_mint_invoke( accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [ - mint_seed, - authority, - payer, - address_tree, - output_queue, - compressible_config, - mint, - rent_sponsor, - light_system_program, - cpi_authority_pda, - registered_program_pda, - account_compression_authority, - account_compression_program, - system_program, - _token_program, - ] = accounts + let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; @@ -140,23 +125,8 @@ pub fn create_mint_invoke_signed( accounts: &[AccountInfo], data: &[u8], ) -> ProgramResult { - let [ - mint_seed, - authority, - payer, - address_tree, - output_queue, - compressible_config, - mint, - rent_sponsor, - light_system_program, - cpi_authority_pda, - registered_program_pda, - account_compression_authority, - account_compression_program, - system_program, - _token_program, - ] = accounts + let [mint_seed, authority, payer, address_tree, output_queue, compressible_config, mint, rent_sponsor, light_system_program, cpi_authority_pda, registered_program_pda, account_compression_authority, account_compression_program, system_program, _token_program] = + accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; diff --git a/program-examples/native-rust/program/src/instructions/mint_to_checked.rs b/program-examples/native-rust/program/src/instructions/mint_to_checked.rs index 4b3053f6..80be40d6 100644 --- a/program-examples/native-rust/program/src/instructions/mint_to_checked.rs +++ b/program-examples/native-rust/program/src/instructions/mint_to_checked.rs @@ -5,7 +5,10 @@ use solana_program::{ program_error::ProgramError, }; -pub fn mint_to_checked_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { +pub fn mint_to_checked_invoke( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { let [mint, destination, authority, system_program, _token_program] = accounts else { diff --git a/program-examples/native-rust/program/src/instructions/transfer_checked.rs b/program-examples/native-rust/program/src/instructions/transfer_checked.rs index c107e159..d27c888c 100644 --- a/program-examples/native-rust/program/src/instructions/transfer_checked.rs +++ b/program-examples/native-rust/program/src/instructions/transfer_checked.rs @@ -5,7 +5,10 @@ use solana_program::{ program_error::ProgramError, }; -pub fn transfer_checked_invoke(accounts: &[AccountInfo], data: &[u8]) -> ProgramResult { +pub fn transfer_checked_invoke( + accounts: &[AccountInfo], + data: &[u8], +) -> ProgramResult { let [source, mint, destination, authority, system_program, _token_program] = accounts else { diff --git a/program-examples/native-rust/program/tests/approve.rs b/program-examples/native-rust/program/tests/approve.rs index 5da4d88c..a215a692 100644 --- a/program-examples/native-rust/program/tests/approve.rs +++ b/program-examples/native-rust/program/tests/approve.rs @@ -5,8 +5,7 @@ use light_client::rpc::Rpc; use light_token_interface::state::Token; use shared::{ build_approve_cpi_ix, build_approve_signed_cpi_ix, create_test_rpc, - get_authority_pda, setup, setup_empty_ata, setup_pda_owned_ata, - SetupContext, + get_authority_pda, setup, setup_pda_owned_ata, SetupContext, }; use solana_sdk::{signature::Keypair, signer::Signer}; diff --git a/program-examples/native-rust/program/tests/create_mint.rs b/program-examples/native-rust/program/tests/create_mint.rs index 35cba3e7..fa35931b 100644 --- a/program-examples/native-rust/program/tests/create_mint.rs +++ b/program-examples/native-rust/program/tests/create_mint.rs @@ -5,10 +5,10 @@ use light_client::{ indexer::{AddressWithTree, Indexer}, rpc::Rpc, }; -use light_compressible::CreateAccountsProof; use light_compressed_account::instruction_data::{ compressed_proof::ValidityProof, data::PackedAddressTreeInfo, }; +use light_compressible::CreateAccountsProof; use light_token::instruction::{ config_pda, derive_mint_compressed_address, find_mint_address, rent_sponsor_pda, SystemAccounts, LIGHT_TOKEN_PROGRAM_ID, diff --git a/program-examples/native-rust/program/tests/freeze.rs b/program-examples/native-rust/program/tests/freeze.rs index 5e720677..3cfe4bd3 100644 --- a/program-examples/native-rust/program/tests/freeze.rs +++ b/program-examples/native-rust/program/tests/freeze.rs @@ -41,7 +41,7 @@ async fn freeze_signed_cpi() { let initial_amount = 1_000_000u64; // Create mint with PDA as freeze authority and mint tokens to payer - let (mint, atas) = setup_mint_with_tokens( + let (mint, associated_token_accounts) = setup_mint_with_tokens( &mut rpc, &payer, payer.pubkey(), @@ -51,7 +51,7 @@ async fn freeze_signed_cpi() { ) .await; - let ata = atas[0]; + let ata = associated_token_accounts[0]; let ix = build_freeze_signed_cpi_ix(ata, mint, pda_authority, bump); diff --git a/program-examples/native-rust/program/tests/mint_to_checked.rs b/program-examples/native-rust/program/tests/mint_to_checked.rs index 15647472..b9b496ad 100644 --- a/program-examples/native-rust/program/tests/mint_to_checked.rs +++ b/program-examples/native-rust/program/tests/mint_to_checked.rs @@ -3,8 +3,8 @@ mod shared; use light_client::rpc::Rpc; use shared::{ build_mint_to_checked_cpi_ix, build_mint_to_checked_signed_cpi_ix, - create_test_rpc, get_authority_pda, setup_mint_with_pda_authority, - setup_mint_with_tokens, create_ata, + create_ata, create_test_rpc, get_authority_pda, + setup_mint_with_pda_authority, setup_mint_with_tokens, }; use solana_sdk::{signature::Keypair, signer::Signer}; @@ -13,7 +13,7 @@ async fn mint_to_checked_cpi() { let mut rpc = create_test_rpc().await; let payer = rpc.get_payer().insecure_clone(); - let (mint, atas) = setup_mint_with_tokens( + let (mint, associated_token_accounts) = setup_mint_with_tokens( &mut rpc, &payer, payer.pubkey(), @@ -27,7 +27,7 @@ async fn mint_to_checked_cpi() { let ix = build_mint_to_checked_cpi_ix( mint, - atas[0], + associated_token_accounts[0], payer.pubkey(), mint_amount, 9, @@ -45,10 +45,12 @@ async fn mint_to_checked_signed_cpi() { let (pda_authority, bump) = get_authority_pda(); - let mint = setup_mint_with_pda_authority(&mut rpc, &payer, pda_authority, 9).await; + let mint = + setup_mint_with_pda_authority(&mut rpc, &payer, pda_authority, 9).await; let recipient = Keypair::new(); - let recipient_ata = create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; + let recipient_ata = + create_ata(&mut rpc, &payer, recipient.pubkey(), mint).await; let mint_amount = 1_000_000u64; diff --git a/program-examples/native-rust/program/tests/shared.rs b/program-examples/native-rust/program/tests/shared.rs index 2565e50b..586b4080 100644 --- a/program-examples/native-rust/program/tests/shared.rs +++ b/program-examples/native-rust/program/tests/shared.rs @@ -3,15 +3,16 @@ use light_client::{ indexer::{AddressWithTree, Indexer}, rpc::Rpc, }; -use light_compressible::CreateAccountsProof; use light_compressed_account::instruction_data::{ compressed_proof::ValidityProof, data::PackedAddressTreeInfo, }; +use light_compressible::CreateAccountsProof; use light_program_test::{LightProgramTest, ProgramTestConfig}; use light_token::instruction::{ - derive_mint_compressed_address, derive_token_ata, find_mint_address, Approve, - CreateAssociatedTokenAccount, CreateMint, CreateMintParams, Freeze, MintTo, - SystemAccounts, COMPRESSIBLE_CONFIG_V1, LIGHT_TOKEN_PROGRAM_ID, RENT_SPONSOR, + derive_mint_compressed_address, derive_token_ata, find_mint_address, + Approve, CreateAssociatedTokenAccount, CreateMint, CreateMintParams, + Freeze, MintTo, SystemAccounts, COMPRESSIBLE_CONFIG_V1, + LIGHT_TOKEN_PROGRAM_ID, RENT_SPONSOR, }; #[allow(deprecated)] use solana_sdk::{ @@ -59,7 +60,7 @@ pub async fn setup() -> SetupContext { let payer = rpc.get_payer().insecure_clone(); let initial_amount = 1_000_000u64; - let (mint, atas) = setup_mint_with_tokens( + let (mint, associated_token_accounts) = setup_mint_with_tokens( &mut rpc, &payer, payer.pubkey(), @@ -69,7 +70,7 @@ pub async fn setup() -> SetupContext { ) .await; - let ata = atas[0]; + let ata = associated_token_accounts[0]; let delegate = Keypair::new(); let approve_ix = Approve { @@ -100,7 +101,7 @@ pub async fn setup_empty_ata() -> SetupContext { let payer = rpc.get_payer().insecure_clone(); - let (mint, atas) = setup_mint_with_tokens( + let (mint, associated_token_accounts) = setup_mint_with_tokens( &mut rpc, &payer, payer.pubkey(), @@ -116,7 +117,7 @@ pub async fn setup_empty_ata() -> SetupContext { rpc, payer, mint, - ata: atas[0], + ata: associated_token_accounts[0], delegate, } } @@ -128,7 +129,7 @@ pub async fn setup_frozen() -> SetupContext { let payer = rpc.get_payer().insecure_clone(); let initial_amount = 1_000_000u64; - let (mint, atas) = setup_mint_with_tokens( + let (mint, associated_token_accounts) = setup_mint_with_tokens( &mut rpc, &payer, payer.pubkey(), @@ -138,7 +139,7 @@ pub async fn setup_frozen() -> SetupContext { ) .await; - let ata = atas[0]; + let ata = associated_token_accounts[0]; let delegate = Keypair::new(); let approve_ix = Approve { @@ -715,11 +716,23 @@ pub async fn setup_mint_with_pda_authority( AccountMeta::new_readonly(COMPRESSIBLE_CONFIG_V1, false), AccountMeta::new(mint, false), AccountMeta::new(RENT_SPONSOR, false), - AccountMeta::new_readonly(system_accounts.light_system_program, false), + AccountMeta::new_readonly( + system_accounts.light_system_program, + false, + ), AccountMeta::new_readonly(system_accounts.cpi_authority_pda, false), - AccountMeta::new_readonly(system_accounts.registered_program_pda, false), - AccountMeta::new_readonly(system_accounts.account_compression_authority, false), - AccountMeta::new_readonly(system_accounts.account_compression_program, false), + AccountMeta::new_readonly( + system_accounts.registered_program_pda, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_authority, + false, + ), + AccountMeta::new_readonly( + system_accounts.account_compression_program, + false, + ), AccountMeta::new_readonly(system_accounts.system_program, false), AccountMeta::new_readonly(LIGHT_TOKEN_PROGRAM_ID, false), ],