From 6b53faa0f35a84799802a503ad01ca188469c3c5 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Thu, 27 Nov 2025 21:10:58 +0000 Subject: [PATCH 01/11] Create README.md --- ctoken/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 ctoken/README.md diff --git a/ctoken/README.md b/ctoken/README.md new file mode 100644 index 0000000..89c1a4f --- /dev/null +++ b/ctoken/README.md @@ -0,0 +1 @@ +Examples cToken From 71b97a715f93600ba53823427ff245cce5b6890f Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Sat, 6 Dec 2025 18:23:27 +0000 Subject: [PATCH 02/11] feat: add c-token client examples Add compressed token (cToken) client examples: - client-create-cmint.rs - Create compressed mint with metadata - client-create-ctoken.rs - Create compressed token account - client-create-cata.rs - Create compressed ATA - client-mint-to-ctoken.rs - Mint tokens to cToken - client-transfer-interface.rs - SPL to cToken transfers - client-close-ctoken.rs - Close cToken account Rename ctoken/ to c-token/ and add proper Cargo.toml with git dependencies pinned to commit 3b811efce. --- README.md | 11 +- c-token/Cargo.lock | 9270 ++++++++++++++++++++ c-token/Cargo.toml | 61 + c-token/README.md | 59 + c-token/tests/client-close-ctoken.rs | 140 + c-token/tests/client-create-cata.rs | 113 + c-token/tests/client-create-cmint.rs | 96 + c-token/tests/client-create-ctoken.rs | 115 + c-token/tests/client-mint-to-ctoken.rs | 181 + c-token/tests/client-transfer-interface.rs | 174 + ctoken/README.md | 1 - 11 files changed, 10219 insertions(+), 2 deletions(-) create mode 100644 c-token/Cargo.lock create mode 100644 c-token/Cargo.toml create mode 100644 c-token/README.md create mode 100644 c-token/tests/client-close-ctoken.rs create mode 100644 c-token/tests/client-create-cata.rs create mode 100644 c-token/tests/client-create-cmint.rs create mode 100644 c-token/tests/client-create-ctoken.rs create mode 100644 c-token/tests/client-mint-to-ctoken.rs create mode 100644 c-token/tests/client-transfer-interface.rs delete mode 100644 ctoken/README.md diff --git a/README.md b/README.md index 57ddfa2..6f64787 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,16 @@ Full compressed account lifecycle (create, increment, decrement, reset, close): - **[zk-id](./zk-id)** - A minimal zk id Solana program that uses zero-knowledge proofs for identity verification with compressed accounts. - +### Compressed Token (c-token) Examples + +- **[c-token](./c-token/)** - Client examples for compressed tokens (cToken) including: + - Create compressed mint (cMint) with metadata + - Create compressed token account (cToken) + - Create compressed associated token account (cATA) + - Mint tokens to cToken account + - Transfer between SPL and cToken accounts + - Close cToken account + ## Light Protocol dependencies ### Rust Crates diff --git a/c-token/Cargo.lock b/c-token/Cargo.lock new file mode 100644 index 0000000..8b6a6e5 --- /dev/null +++ b/c-token/Cargo.lock @@ -0,0 +1,9270 @@ +# 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 = "account-compression" +version = "2.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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" +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 = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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-compressed-token" +version = "2.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "account-compression", + "anchor-lang", + "anchor-spl", + "light-compressed-account", + "light-ctoken-interface", + "light-hasher", + "light-heap", + "light-system-program-anchor", + "light-zero-copy", + "pinocchio-pubkey", + "solana-sdk", + "solana-security-txt", + "spl-token 7.0.0", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "zerocopy", +] + +[[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", + "anchor-lang-idl", + "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", + "regex", + "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", + "cargo_toml", + "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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[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.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e86f6d3dc9dc4352edeea6b8e499e13e3f5dc3b964d7ca5fd411415a3498473" +dependencies = [ + "compression-codecs", + "compression-core", + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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.111", +] + +[[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 = "bb8" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89aabfae550a5c44b43ab941844ffcd2e993cb6900b342debf59e9ea74acdb8" +dependencies = [ + "async-trait", + "futures-util", + "parking_lot", + "tokio", +] + +[[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.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +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.111", +] + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[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.111", +] + +[[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 = "c-token-examples" +version = "0.1.0" +dependencies = [ + "anchor-spl", + "borsh 0.10.4", + "light-client", + "light-ctoken-interface", + "light-ctoken-sdk", + "light-program-test", + "light-test-utils", + "solana-program", + "solana-sdk", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio", +] + +[[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.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" +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.111", +] + +[[package]] +name = "chrono" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +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.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302266479cb963552d11bd042013a58ef1adc56768016c8b82b4199488f2d4ad" +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 = "create-address-test-program" +version = "1.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "account-compression", + "anchor-lang", + "light-compressed-account", + "light-hasher", + "light-sdk", + "light-sdk-types", + "light-system-program-anchor", +] + +[[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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + +[[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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2152dbcb980c05735e2a651d96011320a949eb31a0c8b38b72645ce97dec676" +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 = "forester-utils" +version = "2.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "account-compression", + "anchor-lang", + "anyhow", + "async-stream", + "async-trait", + "bb8", + "futures", + "governor", + "light-account-checks", + "light-batched-merkle-tree", + "light-client", + "light-compressed-account", + "light-concurrent-merkle-tree", + "light-hash-set", + "light-hasher", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-merkle-tree-reference", + "light-prover-client", + "light-registry", + "light-sdk", + "light-sparse-merkle-tree", + "num-traits", + "solana-sdk", + "thiserror 2.0.17", + "tokio", + "tracing", +] + +[[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.111", +] + +[[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-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + +[[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.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +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 = "governor" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be93b4ec2e4710b04d9264c0c7350cdd62a8c20e5e4ac732552ebb8f0debe8eb" +dependencies = [ + "cfg-if", + "dashmap", + "futures-sink", + "futures-timer", + "futures-util", + "getrandom 0.3.4", + "no-std-compat", + "nonzero_ext", + "parking_lot", + "portable-atomic", + "quanta", + "rand 0.9.2", + "smallvec", + "spinning_top", + "web-time", +] + +[[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.12.1", + "slab", + "tokio", + "tokio-util 0.7.17", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.4.0", + "indexmap 2.12.1", + "slab", + "tokio", + "tokio-util 0.7.17", + "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.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[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.12", + "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.35", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.4", + "tower-service", + "webpki-roots 1.0.4", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" + +[[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.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +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.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[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.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +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.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[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.5.1" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "pinocchio", + "solana-account-info", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sysvar", + "thiserror 2.0.17", +] + +[[package]] +name = "light-array-map" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "light-batched-merkle-tree" +version = "0.6.1" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "aligned-sized", + "borsh 0.10.4", + "light-account-checks", + "light-bloom-filter", + "light-compressed-account", + "light-hasher", + "light-macros", + "light-merkle-tree-metadata", + "light-verifier", + "light-zero-copy", + "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 = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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.16.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "async-trait", + "base64 0.13.1", + "borsh 0.10.4", + "bs58", + "lazy_static", + "light-compressed-account", + "light-concurrent-merkle-tree", + "light-ctoken-sdk", + "light-event", + "light-hasher", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-prover-client", + "light-sdk", + "litesvm", + "num-bigint 0.4.6", + "photon-api", + "rand 0.8.5", + "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", + "thiserror 2.0.17", + "tokio", + "tracing", +] + +[[package]] +name = "light-compressed-account" +version = "0.6.2" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-hasher", + "light-macros", + "light-poseidon 0.3.0", + "light-program-profiler", + "light-zero-copy", + "pinocchio", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "thiserror 2.0.17", + "tinyvec", + "zerocopy", +] + +[[package]] +name = "light-compressed-token" +version = "2.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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-ctoken-interface", + "light-hasher", + "light-heap", + "light-program-profiler", + "light-sdk", + "light-sdk-pinocchio", + "light-sdk-types", + "light-system-program-anchor", + "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 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 7.0.0 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "tinyvec", + "zerocopy", +] + +[[package]] +name = "light-compressed-token-types" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account", + "light-macros", + "light-sdk-types", + "solana-msg", + "thiserror 2.0.17", +] + +[[package]] +name = "light-compressible" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "aligned-sized", + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-account-checks", + "light-compressed-account", + "light-hasher", + "light-macros", + "light-program-profiler", + "light-zero-copy", + "pinocchio", + "pinocchio-pubkey", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sysvar", + "thiserror 2.0.17", + "zerocopy", +] + +[[package]] +name = "light-compressible-client" +version = "0.13.1" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "light-client", + "light-sdk", + "solana-account", + "solana-instruction", + "solana-pubkey", + "thiserror 2.0.17", +] + +[[package]] +name = "light-concurrent-merkle-tree" +version = "4.0.1" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "borsh 0.10.4", + "light-bounded-vec", + "light-hasher", + "memoffset", + "solana-program-error", + "thiserror 2.0.17", +] + +[[package]] +name = "light-ctoken-interface" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "aligned-sized", + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-array-map", + "light-compressed-account", + "light-compressible", + "light-hasher", + "light-macros", + "light-program-profiler", + "light-zero-copy", + "pinocchio", + "pinocchio-pubkey", + "solana-account-info", + "solana-pubkey", + "spl-pod", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 2.0.17", + "tinyvec", + "zerocopy", +] + +[[package]] +name = "light-ctoken-sdk" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "arrayvec", + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account", + "light-compressed-token-types", + "light-compressible", + "light-ctoken-interface", + "light-macros", + "light-program-profiler", + "light-sdk", + "light-sdk-types", + "light-zero-copy", + "solana-account-info", + "solana-cpi", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-pod", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 2.0.17", +] + +[[package]] +name = "light-event" +version = "0.1.1" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "borsh 0.10.4", + "light-compressed-account", + "light-hasher", + "light-zero-copy", + "thiserror 2.0.17", +] + +[[package]] +name = "light-hash-set" +version = "4.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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 = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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-heap" +version = "2.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "anchor-lang", +] + +[[package]] +name = "light-indexed-array" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "light-hasher", + "num-bigint 0.4.6", + "num-traits", + "thiserror 2.0.17", +] + +[[package]] +name = "light-indexed-merkle-tree" +version = "4.0.1" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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 = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "bs58", + "proc-macro2", + "quote", + "solana-pubkey", + "syn 2.0.111", +] + +[[package]] +name = "light-merkle-tree-metadata" +version = "0.6.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-compressed-account", + "solana-msg", + "solana-program-error", + "solana-sysvar", + "thiserror 2.0.17", + "zerocopy", +] + +[[package]] +name = "light-merkle-tree-reference" +version = "4.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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.111", +] + +[[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.16.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "account-compression", + "anchor-lang", + "async-trait", + "base64 0.22.1", + "borsh 0.10.4", + "bs58", + "bytemuck", + "chrono", + "light-batched-merkle-tree", + "light-client", + "light-compressed-account", + "light-compressed-token", + "light-compressible", + "light-compressible-client", + "light-concurrent-merkle-tree", + "light-ctoken-interface", + "light-ctoken-sdk", + "light-event", + "light-hasher", + "light-indexed-array", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-merkle-tree-reference", + "light-prover-client", + "light-registry", + "light-sdk", + "light-sdk-types", + "light-zero-copy", + "litesvm", + "log", + "num-bigint 0.4.6", + "num-traits", + "photon-api", + "rand 0.8.5", + "reqwest 0.12.24", + "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 (registry+https://github.com/rust-lang/crates.io-index)", + "tabled", + "tokio", +] + +[[package]] +name = "light-prover-client" +version = "4.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "ark-bn254 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "light-compressed-account", + "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-registry" +version = "2.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "account-compression", + "aligned-sized", + "anchor-lang", + "borsh 0.10.4", + "light-account-checks", + "light-batched-merkle-tree", + "light-compressible", + "light-ctoken-interface", + "light-macros", + "light-merkle-tree-metadata", + "light-program-profiler", + "light-system-program-anchor", + "solana-account-info", + "solana-instruction", + "solana-pubkey", + "solana-sdk", + "solana-security-txt", + "spl-pod", +] + +[[package]] +name = "light-sdk" +version = "0.16.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "anchor-lang", + "bincode", + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account", + "light-compressible", + "light-hasher", + "light-macros", + "light-sdk-macros", + "light-sdk-types", + "light-zero-copy", + "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.16.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "light-hasher", + "light-sdk-types", + "proc-macro2", + "quote", + "solana-pubkey", + "syn 2.0.111", +] + +[[package]] +name = "light-sdk-pinocchio" +version = "0.16.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account", + "light-hasher", + "light-macros", + "light-sdk-macros", + "light-sdk-types", + "pinocchio", + "thiserror 2.0.17", +] + +[[package]] +name = "light-sdk-types" +version = "0.16.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "light-account-checks", + "light-compressed-account", + "light-hasher", + "light-macros", + "solana-msg", + "thiserror 2.0.17", +] + +[[package]] +name = "light-sparse-merkle-tree" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "light-hasher", + "light-indexed-array", + "num-bigint 0.4.6", + "num-traits", + "thiserror 2.0.17", +] + +[[package]] +name = "light-system-program-anchor" +version = "2.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "account-compression", + "aligned-sized", + "anchor-lang", + "light-compressed-account", + "light-zero-copy", + "zerocopy", +] + +[[package]] +name = "light-test-utils" +version = "1.2.1" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "account-compression", + "anchor-lang", + "anchor-spl", + "base64 0.13.1", + "create-address-test-program", + "forester-utils", + "light-account-checks", + "light-batched-merkle-tree", + "light-client", + "light-compressed-account", + "light-compressed-token", + "light-compressible", + "light-concurrent-merkle-tree", + "light-ctoken-interface", + "light-ctoken-sdk", + "light-event", + "light-hasher", + "light-indexed-array", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-merkle-tree-reference", + "light-program-test", + "light-prover-client", + "light-registry", + "light-sdk", + "light-sparse-merkle-tree", + "light-system-program-anchor", + "light-token-client", + "light-zero-copy", + "log", + "num-bigint 0.4.6", + "num-traits", + "rand 0.8.5", + "reqwest 0.12.24", + "solana-banks-client", + "solana-sdk", + "spl-token 7.0.0", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 2.0.17", +] + +[[package]] +name = "light-token-client" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "borsh 0.10.4", + "light-client", + "light-compressed-account", + "light-compressed-token-types", + "light-ctoken-interface", + "light-ctoken-sdk", + "light-sdk", + "light-zero-copy", + "solana-instruction", + "solana-keypair", + "solana-msg", + "solana-pubkey", + "solana-signature", + "solana-signer", + "spl-pod", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "light-verifier" +version = "5.0.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "groth16-solana", + "light-compressed-account", + "thiserror 2.0.17", +] + +[[package]] +name = "light-zero-copy" +version = "0.5.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "light-zero-copy-derive", + "solana-program-error", + "zerocopy", +] + +[[package]] +name = "light-zero-copy-derive" +version = "0.5.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "lazy_static", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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.12.1", + "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 = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + +[[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", + "rand 0.8.5", + "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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[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.52.0" +source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +dependencies = [ + "reqwest 0.12.24", + "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.111", +] + +[[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-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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0225638cadcbebae8932cb7f49cb5da7c15c21beb19f048f05a5ca7d93f065" +dependencies = [ + "five8_const", + "pinocchio", + "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=38d8634353e5eeb8c015d364df0eaa39f5c48b05#38d8634353e5eeb8c015d364df0eaa39f5c48b05" +dependencies = [ + "pinocchio", + "pinocchio-pubkey", +] + +[[package]] +name = "pinocchio-token-program" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/token?rev=38d8634353e5eeb8c015d364df0eaa39f5c48b05#38d8634353e5eeb8c015d364df0eaa39f5c48b05" +dependencies = [ + "pinocchio", + "pinocchio-log", + "pinocchio-token-interface", +] + +[[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.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[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 0.5.11", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit 0.23.9", +] + +[[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.111", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +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.111", +] + +[[package]] +name = "quanta" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.1+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + +[[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.35", + "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.35", + "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.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +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.3", +] + +[[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.3", +] + +[[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.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +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 = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags 2.10.0", +] + +[[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.111", +] + +[[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.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" +dependencies = [ + "async-compression", + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.4.12", + "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.35", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.26.4", + "tokio-util 0.7.17", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 1.0.4", +] + +[[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.24", + "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.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +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.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" +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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" +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.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[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.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" +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.111", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[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" +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.12.1", + "schemars 0.9.0", + "schemars 1.1.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.111", +] + +[[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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +dependencies = [ + "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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[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.16", + "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.24", + "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.16", + "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.16", + "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.24", + "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.24", + "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.111", +] + +[[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 = "spinning_top" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" +dependencies = [ + "lock_api", +] + +[[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.111", +] + +[[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.111", + "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 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spl-elgamal-registry" +version = "0.1.1" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +dependencies = [ + "bytemuck", + "solana-program", + "solana-zk-sdk", + "spl-pod", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", +] + +[[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.111", +] + +[[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.111", +] + +[[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 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-memo", + "spl-pod", + "spl-token 7.0.0", + "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "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 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-memo", + "spl-pod", + "spl-token 7.0.0", + "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-confidential-transfer-proof-generation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "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 = "7.0.0" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "solana-security-txt", + "solana-zk-sdk", + "spl-elgamal-registry 0.1.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "spl-memo", + "spl-pod", + "spl-token 7.0.0", + "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "spl-token-confidential-transfer-proof-generation 0.3.0 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "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-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.2.1" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +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.2.1" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +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-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.3.0" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +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.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +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.111", +] + +[[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.111", +] + +[[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.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +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.111", +] + +[[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.111", +] + +[[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.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" + +[[package]] +name = "time-macros" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +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.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +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.111", +] + +[[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.35", + "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.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +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" +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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +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.12.1", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.23.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" +dependencies = [ + "indexmap 2.12.1", + "toml_datetime 0.7.3", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf146f99d442e8e68e585f5d798ccd3cad9a7835b917e09728880a862706456" +dependencies = [ + "bitflags 2.10.0", + "bytes", + "futures-util", + "http 1.4.0", + "http-body 1.0.1", + "iri-string", + "pin-project-lite", + "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.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" +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.111", +] + +[[package]] +name = "tracing-core" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" +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.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +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.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.111", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" +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.111", +] + +[[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.111", +] + +[[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.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[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.111", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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.111", + "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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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.111", +] + +[[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/c-token/Cargo.toml b/c-token/Cargo.toml new file mode 100644 index 0000000..efcbdef --- /dev/null +++ b/c-token/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "c-token-examples" +version = "0.1.0" +description = "Client examples for compressed tokens (cToken) using Light Protocol" +repository = "https://github.com/Lightprotocol/program-examples" +license = "Apache-2.0" +edition = "2021" + +# No lib - this is a test-only crate +[[test]] +name = "client-create-cmint" +path = "tests/client-create-cmint.rs" + +[[test]] +name = "client-create-ctoken" +path = "tests/client-create-ctoken.rs" + +[[test]] +name = "client-create-cata" +path = "tests/client-create-cata.rs" + +[[test]] +name = "client-mint-to-ctoken" +path = "tests/client-mint-to-ctoken.rs" + +[[test]] +name = "client-transfer-interface" +path = "tests/client-transfer-interface.rs" + +[[test]] +name = "client-close-ctoken" +path = "tests/client-close-ctoken.rs" + +[dev-dependencies] +# Light Protocol dependencies (pinned to specific commit) +light-ctoken-sdk = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" } +light-ctoken-interface = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" } +light-client = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" } +light-program-test = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1", features = ["devenv"] } +light-test-utils = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1", features = ["devenv"] } + +# Solana dependencies +solana-sdk = "2.2" +solana-program = "2.2" + +# SPL dependencies +anchor-spl = "0.31.1" +spl-token-2022 = { version = "7.0.0", features = ["no-entrypoint"] } + +# Serialization +borsh = "0.10.4" + +# Async runtime +tokio = { version = "1.36.0", features = ["full"] } + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("frozen-abi", "no-entrypoint"))', +] diff --git a/c-token/README.md b/c-token/README.md new file mode 100644 index 0000000..e54dc83 --- /dev/null +++ b/c-token/README.md @@ -0,0 +1,59 @@ +# c-Token Examples + +Program and Rust Client examples for c-Tokens using the `light_ctoken_sdk`. + +## Prerequisites + +Requirements +- light cli version 0.27.1-alpha.2+ +- solana cli version 2.1.16+ +- Node.js and npm + + +Install dependencies: + +```bash +# Install Light CLI +npm -g i @lightprotocol/zk-compression-cli +``` + +Start the local test validator with Light programs: + +```bash +light test-validator +``` + +# Build + +```bash +cd create/ # or update/, close/, reinit/, burn/ +cargo build-sbf +``` + +The compiled `.so` files will be in `target/deploy/`. + + +# Test +## Rust Tests + +```bash +cd create/ # or update/, close/, reinit/, burn/ +cargo test-sbf + +``` + +# Notes + +`light test-validator` spawns the following background processes: + +1. solana test validator `http://127.0.0.1:8899` +2. prover server `http://127.0.0.1:3001` +3. photon indexer `http://127.0.0.1:8784` + +You can kill these background processes with `lsof -i:` and `kill `. + +## Disclaimer + +This reference implementation is not audited. + +The Light Protocol programs are audited and deployed on Solana devnet and mainnet. \ No newline at end of file diff --git a/c-token/tests/client-close-ctoken.rs b/c-token/tests/client-close-ctoken.rs new file mode 100644 index 0000000..5fd525f --- /dev/null +++ b/c-token/tests/client-close-ctoken.rs @@ -0,0 +1,140 @@ +// Test for: close-ctoken.mdx + +use borsh::BorshDeserialize; +use light_client::indexer::{AddressWithTree, Indexer}; +use light_client::rpc::Rpc; +use light_ctoken_sdk::ctoken::{ + CloseAccount, CreateCMint, CreateCMintParams, CreateCTokenAccount, + CTOKEN_PROGRAM_ID, +}; +use light_ctoken_interface::state::CToken; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_close_ctoken_account() { + // Step 1: Setup test environment + let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) + .await + .unwrap(); + + let payer = rpc.get_payer().insecure_clone(); + + // Step 2: Create compressed mint (prerequisite) + let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + + // Step 3: Create cToken account with 0 balance + let account = Keypair::new(); + let owner = payer.pubkey(); + + let create_instruction = CreateCTokenAccount::new( + payer.pubkey(), + account.pubkey(), + mint, + owner, + ) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[create_instruction], + &payer.pubkey(), + &[&payer, &account], + ) + .await + .unwrap(); + + // Step 4: Verify account exists before closing + let account_before_close = rpc.get_account(account.pubkey()).await.unwrap(); + assert!( + account_before_close.is_some(), + "Account should exist before closing" + ); + + let ctoken_state = CToken::deserialize(&mut &account_before_close.unwrap().data[..]).unwrap(); + assert_eq!(ctoken_state.amount, 0, "Account balance must be 0 to close"); + + // Step 5: Build close instruction using SDK builder + let close_instruction = CloseAccount::new( + CTOKEN_PROGRAM_ID, + account.pubkey(), + payer.pubkey(), // Destination for remaining lamports + owner, + ) + .instruction() + .unwrap(); + + // Step 6: Send close transaction + rpc.create_and_send_transaction(&[close_instruction], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Step 7: Verify account is closed + let account_after_close = rpc.get_account(account.pubkey()).await.unwrap(); + assert!( + account_after_close.is_none(), + "Account should be closed and no longer exist" + ); +} +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Derive compression address + let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = + light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: None, + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} diff --git a/c-token/tests/client-create-cata.rs b/c-token/tests/client-create-cata.rs new file mode 100644 index 0000000..75e83e0 --- /dev/null +++ b/c-token/tests/client-create-cata.rs @@ -0,0 +1,113 @@ +// Test for: create-cata.mdx + +use borsh::BorshDeserialize; +use light_client::indexer::{AddressWithTree, Indexer}; +use light_client::rpc::Rpc; +use light_ctoken_sdk::ctoken::{ + derive_ctoken_ata, CreateAssociatedTokenAccount, CreateCMint, + CreateCMintParams, +}; +use light_ctoken_interface::state::CToken; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_create_cata_client() { + // Step 1: Setup test environment + let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) + .await + .unwrap(); + + let payer = rpc.get_payer().insecure_clone(); + + // Step 2: Create compressed mint (prerequisite) + let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + + // Step 3: Define owner and derive ATA address + let owner = payer.pubkey(); + let (ata_address, _bump) = derive_ctoken_ata(&owner, &mint); + + // Step 4: Build instruction using SDK builder + let instruction = CreateAssociatedTokenAccount::new( + payer.pubkey(), + owner, + mint, + ) + .instruction() + .unwrap(); + + // Step 5: Send transaction (only payer signs, no account keypair needed) + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Step 6: Verify cATA creation + let account_data = rpc.get_account(ata_address).await.unwrap().unwrap(); + let ctoken_state = CToken::deserialize(&mut &account_data.data[..]).unwrap(); + + assert_eq!(ctoken_state.mint, mint.to_bytes(), "Mint should match"); + assert_eq!(ctoken_state.owner, owner.to_bytes(), "Owner should match"); + assert_eq!(ctoken_state.amount, 0, "Initial amount should be 0"); +} +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Derive compression address + let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = + light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: None, + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} diff --git a/c-token/tests/client-create-cmint.rs b/c-token/tests/client-create-cmint.rs new file mode 100644 index 0000000..faaeef0 --- /dev/null +++ b/c-token/tests/client-create-cmint.rs @@ -0,0 +1,96 @@ +// Test for: client-create-cmint.mdx + +use light_client::indexer::{AddressWithTree, Indexer}; +use light_client::rpc::Rpc; +use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams}; +use light_ctoken_interface::instructions::extensions::token_metadata::TokenMetadataInstructionData; +use light_ctoken_interface::instructions::extensions::ExtensionInstructionData; +use light_ctoken_interface::state::AdditionalMetadata; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_create_rent_free_mint_with_metadata() { + let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) + .await + .unwrap(); + + let payer = rpc.get_payer().insecure_clone(); + + // Create c-int with metadata + let (_mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + +} +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Derive address + let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = + light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params with token metadata + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: Some(vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some(payer.pubkey().to_bytes().into()), + name: b"Rent Free Token".to_vec(), + symbol: b"RFT".to_vec(), + uri: b"https://example.com/metadata.json".to_vec(), + additional_metadata: Some(vec![AdditionalMetadata { + key: b"type".to_vec(), + value: b"compressed".to_vec(), + }]), + }, + )]), + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} diff --git a/c-token/tests/client-create-ctoken.rs b/c-token/tests/client-create-ctoken.rs new file mode 100644 index 0000000..5e91822 --- /dev/null +++ b/c-token/tests/client-create-ctoken.rs @@ -0,0 +1,115 @@ +// Test for: client-create-ctoken.mdx + + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_ctoken_sdk::ctoken::CreateCTokenAccount; +use light_ctoken_interface::state::CToken; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use solana_sdk::{signature::Keypair, signer::Signer}; +use light_client::indexer::{AddressWithTree, Indexer}; +use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams}; +use solana_sdk::{pubkey::Pubkey}; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_create_ctoken_account() { + // Create simulated test environment with Light programs + let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) + .await + .unwrap(); + + let payer = rpc.get_payer().insecure_clone(); + + // Create compressed mint first (prerequisite) + let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + + // Step 1: Generate new keypair for the cToken account + let account = Keypair::new(); + let owner = payer.pubkey(); + + // Step 2: Build instruction using SDK builder + let instruction = CreateCTokenAccount::new( + payer.pubkey(), + account.pubkey(), + mint, + owner, + ) + .instruction() + .unwrap(); + + // Step 3: Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer, &account]) + .await + .unwrap(); + + // Step 4: Verify account creation + let account_data = rpc.get_account(account.pubkey()).await.unwrap().unwrap(); + let ctoken_state = CToken::deserialize(&mut &account_data.data[..]).unwrap(); + + assert_eq!(ctoken_state.mint, mint.to_bytes()); + assert_eq!(ctoken_state.owner, owner.to_bytes()); + assert_eq!(ctoken_state.amount, 0); + +} +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Derive compression address + let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = + light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: None, + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} diff --git a/c-token/tests/client-mint-to-ctoken.rs b/c-token/tests/client-mint-to-ctoken.rs new file mode 100644 index 0000000..bed7c1b --- /dev/null +++ b/c-token/tests/client-mint-to-ctoken.rs @@ -0,0 +1,181 @@ +// Test for: client-mint-to-ctoken.mdx + +use borsh::BorshDeserialize; +use light_client::indexer::{AddressWithTree, Indexer}; +use light_client::rpc::Rpc; +use light_ctoken_sdk::ctoken::{ + CreateCMint, CreateCMintParams, CreateCTokenAccount, MintToCToken, + MintToCTokenParams, +}; +use light_ctoken_interface::instructions::mint_action::CompressedMintWithContext; +use light_ctoken_interface::state::{CToken, CompressedMint}; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_mint_to_ctoken_client() { + // Step 1: Setup test environment + let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) + .await + .unwrap(); + + let payer = rpc.get_payer().insecure_clone(); + let mint_authority = payer.pubkey(); + + // Step 2: Create compressed mint (prerequisite) + let (mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + + // Step 3: Create ctoken account (prerequisite) + let ctoken_account = Keypair::new(); + let owner = payer.pubkey(); + let create_account_ix = CreateCTokenAccount::new( + payer.pubkey(), + ctoken_account.pubkey(), + mint, + owner, + ) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[create_account_ix], + &payer.pubkey(), + &[&payer, &ctoken_account], + ) + .await + .unwrap(); + + // Step 4: Get compressed mint account to build CompressedMintWithContext + let compressed_mint_account = rpc + .get_compressed_account(compression_address, None) + .await + .unwrap() + .value + .expect("Compressed mint should exist"); + + // Step 5: Get validity proof for the mint operation + let rpc_result = rpc + .get_validity_proof(vec![compressed_mint_account.hash], vec![], None) + .await + .unwrap() + .value; + + // Step 6: Deserialize compressed mint data + let compressed_mint = CompressedMint::deserialize( + &mut compressed_mint_account.data.unwrap().data.as_slice(), + ) + .unwrap(); + + // Step 7: Build CompressedMintWithContext + let compressed_mint_with_context = CompressedMintWithContext { + address: compression_address, + leaf_index: compressed_mint_account.leaf_index, + prove_by_index: true, + root_index: rpc_result.accounts[0] + .root_index + .root_index() + .unwrap_or_default(), + mint: compressed_mint.try_into().unwrap(), + }; + + let amount = 1_000_000_000u64; // 1 token with 9 decimals + + // Step 8: Build mint params + let params = MintToCTokenParams::new( + compressed_mint_with_context, + amount, + mint_authority, + rpc_result.proof, + ); + + // Step 9: Build instruction using SDK builder + let instruction = MintToCToken::new( + params, + payer.pubkey(), + compressed_mint_account.tree_info.tree, + compressed_mint_account.tree_info.queue, + compressed_mint_account.tree_info.queue, + vec![ctoken_account.pubkey()], + ) + .instruction() + .unwrap(); + + // Step 10: Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Step 11: Verify tokens were minted + let ctoken_account_data = rpc + .get_account(ctoken_account.pubkey()) + .await + .unwrap() + .unwrap(); + + let ctoken_state = CToken::deserialize(&mut &ctoken_account_data.data[..]).unwrap(); + assert_eq!(ctoken_state.amount, amount, "Token amount should match"); + assert_eq!(ctoken_state.mint, mint.to_bytes(), "Mint should match"); + assert_eq!(ctoken_state.owner, owner.to_bytes(), "Owner should match"); +} +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Derive compression address + let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = + light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: None, + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} diff --git a/c-token/tests/client-transfer-interface.rs b/c-token/tests/client-transfer-interface.rs new file mode 100644 index 0000000..93e1377 --- /dev/null +++ b/c-token/tests/client-transfer-interface.rs @@ -0,0 +1,174 @@ +// Test for: transfer-interface.mdx + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_ctoken_sdk::{ + ctoken::{ + derive_ctoken_ata, CreateAssociatedTokenAccount, TransferCtoken, + TransferSplToCtoken, + }, + token_pool::find_token_pool_pda_with_index, +}; +use light_ctoken_interface::state::CToken; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_test_utils::spl::{create_mint_helper, create_token_2022_account, mint_spl_tokens}; +use solana_sdk::{signature::Keypair, signer::Signer}; +use spl_token_2022::state::Account as TokenAccount; +use solana_program::program_pack::Pack; +use anchor_spl; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_client_transfer_spl_to_ctoken_to_ctoken() { + // Step 1: Setup test environment + let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) + .await + .unwrap(); + + let payer = rpc.get_payer().insecure_clone(); + let sender = Keypair::new(); + light_test_utils::airdrop_lamports(&mut rpc, &sender.pubkey(), 1_000_000_000) + .await + .unwrap(); + + // Step 2: Create SPL mint + let mint = create_mint_helper(&mut rpc, &payer).await; + let initial_amount = 10000u64; + let spl_to_ctoken_amount = 7000u64; + let ctoken_transfer_amount = 3000u64; + + // Step 3: Create SPL token account and mint tokens + let spl_token_account = Keypair::new(); + create_token_2022_account(&mut rpc, &mint, &spl_token_account, &sender, false) + .await + .unwrap(); + + mint_spl_tokens( + &mut rpc, + &mint, + &spl_token_account.pubkey(), + &payer.pubkey(), + &payer, + initial_amount, + false, + ) + .await + .unwrap(); + + // Step 4: Create sender cToken ATA + let (sender_ctoken_ata, _) = derive_ctoken_ata(&sender.pubkey(), &mint); + + let create_sender_ata = CreateAssociatedTokenAccount::new( + payer.pubkey(), + sender.pubkey(), + mint, + ) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[create_sender_ata], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Step 5: Convert SPL tokens to cToken (7000 tokens) + let (token_pool_pda, token_pool_pda_bump) = find_token_pool_pda_with_index(&mint, 0); + let spl_token_program = anchor_spl::token::ID; + + let spl_to_ctoken_instruction = TransferSplToCtoken { + amount: spl_to_ctoken_amount, + token_pool_pda_bump, + source_spl_token_account: spl_token_account.pubkey(), + destination_ctoken_account: sender_ctoken_ata, + authority: sender.pubkey(), + mint, + payer: payer.pubkey(), + token_pool_pda, + spl_token_program, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[spl_to_ctoken_instruction], + &payer.pubkey(), + &[&payer, &sender], + ) + .await + .unwrap(); + + // Step 6: Create recipient cToken ATA + let recipient = Keypair::new(); + light_test_utils::airdrop_lamports(&mut rpc, &recipient.pubkey(), 1_000_000_000) + .await + .unwrap(); + + let (recipient_ctoken_ata, _) = derive_ctoken_ata(&recipient.pubkey(), &mint); + + let create_recipient_ata = CreateAssociatedTokenAccount::new( + payer.pubkey(), + recipient.pubkey(), + mint, + ) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[create_recipient_ata], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Step 7: Transfer cToken from sender to recipient (3000 tokens) + let transfer_instruction = TransferCtoken { + source: sender_ctoken_ata, + destination: recipient_ctoken_ata, + amount: ctoken_transfer_amount, + authority: sender.pubkey(), + max_top_up: None, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[transfer_instruction], + &payer.pubkey(), + &[&payer, &sender], + ) + .await + .unwrap(); + + // Step 8: Verify balances + let sender_account_data = rpc.get_account(sender_ctoken_ata).await.unwrap().unwrap(); + let sender_state = CToken::deserialize(&mut &sender_account_data.data[..]).unwrap(); + + let recipient_account_data = rpc + .get_account(recipient_ctoken_ata) + .await + .unwrap() + .unwrap(); + let recipient_state = CToken::deserialize(&mut &recipient_account_data.data[..]).unwrap(); + + // Sender should have: 7000 (converted) - 3000 (transferred) = 4000 + assert_eq!( + sender_state.amount, + spl_to_ctoken_amount - ctoken_transfer_amount, + "Sender cToken balance should be 4000" + ); + + // Recipient should have: 3000 (received) + assert_eq!( + recipient_state.amount, ctoken_transfer_amount, + "Recipient cToken balance should be 3000" + ); + + // Verify SPL account still has remaining tokens: 10000 - 7000 = 3000 + let spl_account_data = rpc + .get_account(spl_token_account.pubkey()) + .await + .unwrap() + .unwrap(); + let spl_account = TokenAccount::unpack(&spl_account_data.data).unwrap(); + assert_eq!( + spl_account.amount, + initial_amount - spl_to_ctoken_amount, + "SPL account should have 3000 remaining" + ); +} diff --git a/ctoken/README.md b/ctoken/README.md deleted file mode 100644 index 89c1a4f..0000000 --- a/ctoken/README.md +++ /dev/null @@ -1 +0,0 @@ -Examples cToken From 9e1d46da68798ae611382813e6984875b792af86 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Sun, 7 Dec 2025 19:39:59 +0000 Subject: [PATCH 03/11] Update README.md Co-authored-by: ananas-block <58553958+ananas-block@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f64787..c1f0e75 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Full compressed account lifecycle (create, increment, decrement, reset, close): - **[zk-id](./zk-id)** - A minimal zk id Solana program that uses zero-knowledge proofs for identity verification with compressed accounts. -### Compressed Token (c-token) Examples +### cToken Examples - **[c-token](./c-token/)** - Client examples for compressed tokens (cToken) including: - Create compressed mint (cMint) with metadata From ccfcfa4ff556caab88cf6f2987fd299f227c6a54 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Mon, 8 Dec 2025 20:29:46 +0000 Subject: [PATCH 04/11] Update c-token examples: refactor tests, add devnet transfer, update deps --- .github/workflows/rust-tests.yml | 8 +- c-token/Cargo.lock | 856 +++----------------- c-token/Cargo.toml | 49 +- c-token/src/close.rs | 75 ++ c-token/src/create_ata2.rs | 100 +++ c-token/src/create_cmint.rs | 262 ++++++ c-token/src/create_token_account.rs | 102 +++ c-token/src/lib.rs | 347 ++++++++ c-token/src/mint_to_ctoken.rs | 167 ++++ c-token/src/transfer.rs | 85 ++ c-token/src/transfer_interface.rs | 124 +++ c-token/src/transfer_spl_ctoken.rs | 198 +++++ c-token/tests/client-close-ctoken.rs | 8 +- c-token/tests/client-create-cata.rs | 8 +- c-token/tests/client-create-cmint.rs | 4 +- c-token/tests/client-create-ctoken.rs | 4 +- c-token/tests/client-mint-to-ctoken.rs | 4 +- c-token/tests/client-transfer-interface.rs | 144 +++- c-token/tests/devnet-spl-ctoken-transfer.rs | 328 ++++++++ cli | 1 + 20 files changed, 2102 insertions(+), 772 deletions(-) create mode 100644 c-token/src/close.rs create mode 100644 c-token/src/create_ata2.rs create mode 100644 c-token/src/create_cmint.rs create mode 100644 c-token/src/create_token_account.rs create mode 100644 c-token/src/lib.rs create mode 100644 c-token/src/mint_to_ctoken.rs create mode 100644 c-token/src/transfer.rs create mode 100644 c-token/src/transfer_interface.rs create mode 100644 c-token/src/transfer_spl_ctoken.rs create mode 100644 c-token/tests/devnet-spl-ctoken-transfer.rs create mode 120000 cli diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 4c95f79..6d3a824 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -30,7 +30,10 @@ jobs: - counter/pinocchio - account-comparison - zk-id + - c-token include: + - example: c-token + test-command: cargo test - example: basic-operations/native package: native-program-burn - example: basic-operations/native @@ -60,8 +63,9 @@ jobs: - name: Build and test working-directory: ${{ matrix.example }} run: | + TEST_CMD="${{ matrix.test-command || 'cargo test-sbf' }}" if [ -n "${{ matrix.package }}" ]; then - cargo test-sbf -p ${{ matrix.package }} + $TEST_CMD -p ${{ matrix.package }} else - cargo test-sbf + $TEST_CMD fi diff --git a/c-token/Cargo.lock b/c-token/Cargo.lock index 8b6a6e5..b4c56c5 100644 --- a/c-token/Cargo.lock +++ b/c-token/Cargo.lock @@ -12,30 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "account-compression" -version = "2.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -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" @@ -150,7 +126,8 @@ dependencies = [ [[package]] name = "aligned-sized" version = "1.1.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48a526ec4434d531d488af59fe866f36b310fe8906691c75dffa664450a3800a" dependencies = [ "proc-macro2", "quote", @@ -254,28 +231,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "anchor-compressed-token" -version = "2.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "account-compression", - "anchor-lang", - "anchor-spl", - "light-compressed-account", - "light-ctoken-interface", - "light-hasher", - "light-heap", - "light-system-program-anchor", - "light-zero-copy", - "pinocchio-pubkey", - "solana-sdk", - "solana-security-txt", - "spl-token 7.0.0", - "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "zerocopy", -] - [[package]] name = "anchor-derive-accounts" version = "0.31.1" @@ -680,9 +635,9 @@ checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" [[package]] name = "async-compression" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e86f6d3dc9dc4352edeea6b8e499e13e3f5dc3b964d7ca5fd411415a3498473" +checksum = "07a926debf178f2d355197f9caddb08e54a9329d44748034bba349c5848cb519" dependencies = [ "compression-codecs", "compression-core", @@ -691,28 +646,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.111", -] - [[package]] name = "async-trait" version = "0.1.89" @@ -771,18 +704,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bb8" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89aabfae550a5c44b43ab941844ffcd2e993cb6900b342debf59e9ea74acdb8" -dependencies = [ - "async-trait", - "futures-util", - "parking_lot", - "tokio", -] - [[package]] name = "bincode" version = "1.3.3" @@ -807,18 +728,6 @@ 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.8.2" @@ -1013,10 +922,13 @@ dependencies = [ "light-ctoken-interface", "light-ctoken-sdk", "light-program-test", - "light-test-utils", + "light-sdk", + "serde_json", "solana-program", "solana-sdk", - "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-pod", + "spl-token 7.0.0", + "spl-token-2022 7.0.0", "tokio", ] @@ -1104,9 +1016,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302266479cb963552d11bd042013a58ef1adc56768016c8b82b4199488f2d4ad" +checksum = "34a3cbbb8b6eca96f3a5c4bf6938d5b27ced3675d69f95bb51948722870bc323" dependencies = [ "brotli", "compression-core", @@ -1193,20 +1105,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "create-address-test-program" -version = "1.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "account-compression", - "anchor-lang", - "light-compressed-account", - "light-hasher", - "light-sdk", - "light-sdk-types", - "light-system-program-anchor", -] - [[package]] name = "crossbeam-channel" version = "0.5.15" @@ -1354,20 +1252,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "dashmap" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "deranged" version = "0.5.5" @@ -1650,9 +1534,9 @@ checksum = "2551bf44bc5f776c15044b9b94153a00198be06743e262afaaa61f11ac7523a5" [[package]] name = "flate2" -version = "1.1.7" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2152dbcb980c05735e2a651d96011320a949eb31a0c8b38b72645ce97dec676" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "miniz_oxide", @@ -1685,40 +1569,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -[[package]] -name = "forester-utils" -version = "2.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "account-compression", - "anchor-lang", - "anyhow", - "async-stream", - "async-trait", - "bb8", - "futures", - "governor", - "light-account-checks", - "light-batched-merkle-tree", - "light-client", - "light-compressed-account", - "light-concurrent-merkle-tree", - "light-hash-set", - "light-hasher", - "light-indexed-merkle-tree", - "light-merkle-tree-metadata", - "light-merkle-tree-reference", - "light-prover-client", - "light-registry", - "light-sdk", - "light-sparse-merkle-tree", - "num-traits", - "solana-sdk", - "thiserror 2.0.17", - "tokio", - "tracing", -] - [[package]] name = "form_urlencoded" version = "1.2.2" @@ -1728,12 +1578,6 @@ 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" @@ -1805,12 +1649,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - [[package]] name = "futures-util" version = "0.3.31" @@ -1889,44 +1727,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "governor" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be93b4ec2e4710b04d9264c0c7350cdd62a8c20e5e4ac732552ebb8f0debe8eb" -dependencies = [ - "cfg-if", - "dashmap", - "futures-sink", - "futures-timer", - "futures-util", - "getrandom 0.3.4", - "no-std-compat", - "nonzero_ext", - "parking_lot", - "portable-atomic", - "quanta", - "rand 0.9.2", - "smallvec", - "spinning_top", - "web-time", -] - -[[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" @@ -1989,12 +1789,6 @@ dependencies = [ "ahash", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hashbrown" version = "0.15.2" @@ -2628,10 +2422,10 @@ dependencies = [ [[package]] name = "light-account-checks" -version = "0.5.1" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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", @@ -2642,48 +2436,13 @@ dependencies = [ [[package]] name = "light-array-map" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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.6.1" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "aligned-sized", - "borsh 0.10.4", - "light-account-checks", - "light-bloom-filter", - "light-compressed-account", - "light-hasher", - "light-macros", - "light-merkle-tree-metadata", - "light-verifier", - "light-zero-copy", - "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 = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -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" @@ -2698,8 +2457,9 @@ dependencies = [ [[package]] name = "light-client" -version = "0.16.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65a2574dca16e7983d8ca0f40cb2969bf24de288dc187bb827beae64008f8ad" dependencies = [ "async-trait", "base64 0.13.1", @@ -2717,7 +2477,7 @@ dependencies = [ "light-sdk", "litesvm", "num-bigint 0.4.6", - "photon-api", + "photon-api 0.53.0", "rand 0.8.5", "solana-account", "solana-account-decoder-client-types", @@ -2745,8 +2505,9 @@ dependencies = [ [[package]] name = "light-compressed-account" -version = "0.6.2" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058df2733fa6a3e4bda6f162a6c5d41f10fc8c6f6ddb992af1de76b60214e4a6" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -2765,62 +2526,11 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "light-compressed-token" -version = "2.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -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-ctoken-interface", - "light-hasher", - "light-heap", - "light-program-profiler", - "light-sdk", - "light-sdk-pinocchio", - "light-sdk-types", - "light-system-program-anchor", - "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 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-token-2022 7.0.0 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", - "tinyvec", - "zerocopy", -] - -[[package]] -name = "light-compressed-token-types" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "borsh 0.10.4", - "light-account-checks", - "light-compressed-account", - "light-macros", - "light-sdk-types", - "solana-msg", - "thiserror 2.0.17", -] - [[package]] name = "light-compressible" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3648e2cd17ed29c72fefd95c099c9673a289e7ce1fd9b76f7f16cc1e5ddaf97" dependencies = [ "aligned-sized", "anchor-lang", @@ -2844,8 +2554,9 @@ dependencies = [ [[package]] name = "light-compressible-client" -version = "0.13.1" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d57f59c916e82fcf262e408e659472ea5a07d7ac492277a4f422f115823282" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -2859,8 +2570,9 @@ dependencies = [ [[package]] name = "light-concurrent-merkle-tree" -version = "4.0.1" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db96f47253a0907aaa46dac15cecb27b5510130e48da0b36690dcd2e99a6d558" dependencies = [ "borsh 0.10.4", "light-bounded-vec", @@ -2872,11 +2584,11 @@ dependencies = [ [[package]] name = "light-ctoken-interface" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b692874fd2d7439225b664375b839c3e8b1538829558f85910bfd853cd91e4df" dependencies = [ "aligned-sized", - "anchor-lang", "borsh 0.10.4", "bytemuck", "light-array-map", @@ -2891,7 +2603,7 @@ dependencies = [ "solana-account-info", "solana-pubkey", "spl-pod", - "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 7.0.0", "thiserror 2.0.17", "tinyvec", "zerocopy", @@ -2899,16 +2611,17 @@ dependencies = [ [[package]] name = "light-ctoken-sdk" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda77f9130dfbbb5800988f41a87bb74b8f59854ab62629565e5b818b0352a6f" dependencies = [ "arrayvec", "borsh 0.10.4", "light-account-checks", "light-compressed-account", - "light-compressed-token-types", "light-compressible", "light-ctoken-interface", + "light-ctoken-types", "light-macros", "light-program-profiler", "light-sdk", @@ -2921,38 +2634,43 @@ dependencies = [ "solana-program-error", "solana-pubkey", "spl-pod", - "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 7.0.0", "thiserror 2.0.17", ] [[package]] -name = "light-event" -version = "0.1.1" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +name = "light-ctoken-types" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d7facfbde56b67693061f12572792ff142e0eef4d20f7153ceb5401934f1aac" dependencies = [ "borsh 0.10.4", + "light-account-checks", "light-compressed-account", - "light-hasher", - "light-zero-copy", + "light-macros", + "light-sdk-types", + "solana-msg", "thiserror 2.0.17", ] [[package]] -name = "light-hash-set" -version = "4.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +name = "light-event" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9032317e17599cfdefac76b8f44563b535afc6401ca1539a752937ea2dd5b63" dependencies = [ + "borsh 0.10.4", + "light-compressed-account", "light-hasher", - "num-bigint 0.4.6", - "num-traits", - "solana-program-error", + "light-zero-copy", "thiserror 2.0.17", ] [[package]] name = "light-hasher" version = "5.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c822662e6e109bac0e132a43fd52a4ef684811245a794e048cf9cda001e934c8" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", @@ -2966,18 +2684,11 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "light-heap" -version = "2.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "anchor-lang", -] - [[package]] name = "light-indexed-array" version = "0.3.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f14f984030d86b6f07bd8f5ae04e2c40fcd0c3bdfcc7a291fff1ed59c9e6554" dependencies = [ "light-hasher", "num-bigint 0.4.6", @@ -2987,8 +2698,9 @@ dependencies = [ [[package]] name = "light-indexed-merkle-tree" -version = "4.0.1" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0824755289075f28de2820fc7d4ec4e6b9e99d404e033c07338b91cce8c71fb8" dependencies = [ "light-bounded-vec", "light-concurrent-merkle-tree", @@ -3003,7 +2715,8 @@ dependencies = [ [[package]] name = "light-macros" version = "2.2.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "179ac51cadc1d0ca047b4d6265a7cc245ca3affc16a20a2749585aa6464d39c2" dependencies = [ "bs58", "proc-macro2", @@ -3014,8 +2727,9 @@ dependencies = [ [[package]] name = "light-merkle-tree-metadata" -version = "0.6.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9780fcd23afe4220857b0d71ef4823afd142ddc50469a8759423f19d81a33437" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -3031,7 +2745,8 @@ dependencies = [ [[package]] name = "light-merkle-tree-reference" version = "4.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d480f62ca32b38a6231bbc5310d693f91d6b5bdcc18bb13c2d9aab7a1c90e8" dependencies = [ "light-hasher", "light-indexed-array", @@ -3086,10 +2801,10 @@ dependencies = [ [[package]] name = "light-program-test" -version = "0.16.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5587287e981f066159a27e6b1a668badba833825aee4d0d2618e3bdd90848df" dependencies = [ - "account-compression", "anchor-lang", "async-trait", "base64 0.22.1", @@ -3097,14 +2812,9 @@ dependencies = [ "bs58", "bytemuck", "chrono", - "light-batched-merkle-tree", "light-client", "light-compressed-account", - "light-compressed-token", - "light-compressible", "light-compressible-client", - "light-concurrent-merkle-tree", - "light-ctoken-interface", "light-ctoken-sdk", "light-event", "light-hasher", @@ -3113,7 +2823,6 @@ dependencies = [ "light-merkle-tree-metadata", "light-merkle-tree-reference", "light-prover-client", - "light-registry", "light-sdk", "light-sdk-types", "light-zero-copy", @@ -3121,7 +2830,7 @@ dependencies = [ "log", "num-bigint 0.4.6", "num-traits", - "photon-api", + "photon-api 0.52.0", "rand 0.8.5", "reqwest 0.12.24", "serde", @@ -3136,15 +2845,16 @@ dependencies = [ "solana-transaction", "solana-transaction-status", "solana-transaction-status-client-types", - "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 7.0.0", "tabled", "tokio", ] [[package]] name = "light-prover-client" -version = "4.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +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", @@ -3152,47 +2862,23 @@ dependencies = [ "light-compressed-account", "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-registry" -version = "2.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "account-compression", - "aligned-sized", - "anchor-lang", - "borsh 0.10.4", - "light-account-checks", - "light-batched-merkle-tree", - "light-compressible", - "light-ctoken-interface", - "light-macros", - "light-merkle-tree-metadata", - "light-program-profiler", - "light-system-program-anchor", - "solana-account-info", - "solana-instruction", - "solana-pubkey", - "solana-sdk", - "solana-security-txt", - "spl-pod", + "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.16.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58d6105c9ca358c0c484d83cae451eb5f12c869e82bd0a70dc1fb79a11051c5e" dependencies = [ "anchor-lang", "bincode", @@ -3221,8 +2907,9 @@ dependencies = [ [[package]] name = "light-sdk-macros" -version = "0.16.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d1574d5e077c0bf4cec6ab82fcd323265b45d0aa4f0493c01d726e8b8863f9" dependencies = [ "light-hasher", "light-sdk-types", @@ -3232,26 +2919,11 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "light-sdk-pinocchio" -version = "0.16.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "borsh 0.10.4", - "light-account-checks", - "light-compressed-account", - "light-hasher", - "light-macros", - "light-sdk-macros", - "light-sdk-types", - "pinocchio", - "thiserror 2.0.17", -] - [[package]] name = "light-sdk-types" -version = "0.16.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d11611baf72ac9f728eb17857b01cc9a80919ff34631965c69be69b8d31c28e" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -3266,121 +2938,31 @@ dependencies = [ [[package]] name = "light-sparse-merkle-tree" version = "0.3.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "light-hasher", - "light-indexed-array", - "num-bigint 0.4.6", - "num-traits", - "thiserror 2.0.17", -] - -[[package]] -name = "light-system-program-anchor" -version = "2.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "account-compression", - "aligned-sized", - "anchor-lang", - "light-compressed-account", - "light-zero-copy", - "zerocopy", -] - -[[package]] -name = "light-test-utils" -version = "1.2.1" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4251e79b6c63f4946572dcfd7623680ad0f9e0efe1a761a944733333c5645063" dependencies = [ - "account-compression", - "anchor-lang", - "anchor-spl", - "base64 0.13.1", - "create-address-test-program", - "forester-utils", - "light-account-checks", - "light-batched-merkle-tree", - "light-client", - "light-compressed-account", - "light-compressed-token", - "light-compressible", - "light-concurrent-merkle-tree", - "light-ctoken-interface", - "light-ctoken-sdk", - "light-event", "light-hasher", "light-indexed-array", - "light-indexed-merkle-tree", - "light-merkle-tree-metadata", - "light-merkle-tree-reference", - "light-program-test", - "light-prover-client", - "light-registry", - "light-sdk", - "light-sparse-merkle-tree", - "light-system-program-anchor", - "light-token-client", - "light-zero-copy", - "log", "num-bigint 0.4.6", "num-traits", - "rand 0.8.5", - "reqwest 0.12.24", - "solana-banks-client", - "solana-sdk", - "spl-token 7.0.0", - "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 2.0.17", -] - -[[package]] -name = "light-token-client" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "borsh 0.10.4", - "light-client", - "light-compressed-account", - "light-compressed-token-types", - "light-ctoken-interface", - "light-ctoken-sdk", - "light-sdk", - "light-zero-copy", - "solana-instruction", - "solana-keypair", - "solana-msg", - "solana-pubkey", - "solana-signature", - "solana-signer", - "spl-pod", - "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "light-verifier" -version = "5.0.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" -dependencies = [ - "groth16-solana", - "light-compressed-account", "thiserror 2.0.17", ] [[package]] name = "light-zero-copy" version = "0.5.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8862f463792fd60ae8f5dc418150c16213e302e19d54fba0694cf8515be5ff" dependencies = [ "light-zero-copy-derive", - "solana-program-error", "zerocopy", ] [[package]] name = "light-zero-copy-derive" version = "0.5.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af086d52100b3cab1f2993b146adc7a69fa6aaa878ae4c19514c77c50304379" dependencies = [ "lazy_static", "proc-macro2", @@ -3574,18 +3156,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - -[[package]] -name = "nonzero_ext" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" - [[package]] name = "num" version = "0.2.1" @@ -3619,7 +3189,6 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", - "rand 0.8.5", "serde", ] @@ -3871,7 +3440,23 @@ dependencies = [ [[package]] name = "photon-api" version = "0.52.0" -source = "git+https://github.com/Lightprotocol/light-protocol?rev=3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1#3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "503b549aede7d9f35752046b9a32d8dfc1c7acec3c304a012c8b3134d5b98e37" +dependencies = [ + "reqwest 0.12.24", + "serde", + "serde_derive", + "serde_json", + "serde_with", + "url", + "uuid", +] + +[[package]] +name = "photon-api" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5286d477f39ef56635e3175cd22030233c76f1ced2d6dec632d105c54cc94543" dependencies = [ "reqwest 0.12.24", "serde", @@ -3920,12 +3505,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" @@ -3937,35 +3516,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=38d8634353e5eeb8c015d364df0eaa39f5c48b05#38d8634353e5eeb8c015d364df0eaa39f5c48b05" -dependencies = [ - "pinocchio", - "pinocchio-pubkey", -] - -[[package]] -name = "pinocchio-token-program" -version = "0.1.0" -source = "git+https://github.com/Lightprotocol/token?rev=38d8634353e5eeb8c015d364df0eaa39f5c48b05#38d8634353e5eeb8c015d364df0eaa39f5c48b05" -dependencies = [ - "pinocchio", - "pinocchio-log", - "pinocchio-token-interface", -] - [[package]] name = "pkg-config" version = "0.3.32" @@ -4083,21 +3633,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "quanta" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi 0.11.1+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - [[package]] name = "quinn" version = "0.11.9" @@ -4168,12 +3703,6 @@ 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" @@ -4274,15 +3803,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "raw-cpuid" -version = "11.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" -dependencies = [ - "bitflags 2.10.0", -] - [[package]] name = "rayon" version = "1.11.0" @@ -4869,9 +4389,9 @@ checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" [[package]] name = "siphasher" @@ -5879,15 +5399,6 @@ dependencies = [ "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" @@ -7169,15 +6680,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "spinning_top" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" -dependencies = [ - "lock_api", -] - [[package]] name = "spl-associated-token-account" version = "6.0.0" @@ -7266,19 +6768,7 @@ dependencies = [ "solana-program", "solana-zk-sdk", "spl-pod", - "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "spl-elgamal-registry" -version = "0.1.1" -source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" -dependencies = [ - "bytemuck", - "solana-program", - "solana-zk-sdk", - "spl-pod", - "spl-token-confidential-transfer-proof-extraction 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "spl-token-confidential-transfer-proof-extraction 0.2.1", ] [[package]] @@ -7501,12 +6991,12 @@ dependencies = [ "solana-program", "solana-security-txt", "solana-zk-sdk", - "spl-elgamal-registry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-elgamal-registry 0.1.1", "spl-memo", "spl-pod", "spl-token 7.0.0", - "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "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", @@ -7529,40 +7019,13 @@ dependencies = [ "solana-program", "solana-security-txt", "solana-zk-sdk", - "spl-elgamal-registry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-memo", - "spl-pod", - "spl-token 7.0.0", - "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "spl-token-confidential-transfer-proof-generation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "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 = "7.0.0" -source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive", - "num-traits", - "num_enum", - "solana-program", - "solana-security-txt", - "solana-zk-sdk", - "spl-elgamal-registry 0.1.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "spl-elgamal-registry 0.1.1", "spl-memo", "spl-pod", "spl-token 7.0.0", - "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", - "spl-token-confidential-transfer-proof-extraction 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", - "spl-token-confidential-transfer-proof-generation 0.3.0 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "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", @@ -7626,17 +7089,6 @@ dependencies = [ "solana-zk-sdk", ] -[[package]] -name = "spl-token-confidential-transfer-ciphertext-arithmetic" -version = "0.2.1" -source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" -dependencies = [ - "base64 0.22.1", - "bytemuck", - "solana-curve25519", - "solana-zk-sdk", -] - [[package]] name = "spl-token-confidential-transfer-ciphertext-arithmetic" version = "0.3.1" @@ -7663,19 +7115,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "spl-token-confidential-transfer-proof-extraction" -version = "0.2.1" -source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" -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" @@ -7718,16 +7157,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "spl-token-confidential-transfer-proof-generation" -version = "0.3.0" -source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" -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" @@ -8043,12 +7472,6 @@ dependencies = [ "syn 2.0.111", ] -[[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" @@ -8419,9 +7842,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf146f99d442e8e68e585f5d798ccd3cad9a7835b917e09728880a862706456" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "bitflags 2.10.0", "bytes", @@ -9115,15 +8538,6 @@ 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" diff --git a/c-token/Cargo.toml b/c-token/Cargo.toml index efcbdef..578b6ed 100644 --- a/c-token/Cargo.toml +++ b/c-token/Cargo.toml @@ -6,7 +6,10 @@ repository = "https://github.com/Lightprotocol/program-examples" license = "Apache-2.0" edition = "2021" -# No lib - this is a test-only crate +[lib] +crate-type = ["cdylib", "lib"] +name = "c_token_examples" + [[test]] name = "client-create-cmint" path = "tests/client-create-cmint.rs" @@ -23,35 +26,49 @@ path = "tests/client-create-cata.rs" name = "client-mint-to-ctoken" path = "tests/client-mint-to-ctoken.rs" +[[test]] +name = "client-close-ctoken" +path = "tests/client-close-ctoken.rs" + [[test]] name = "client-transfer-interface" path = "tests/client-transfer-interface.rs" [[test]] -name = "client-close-ctoken" -path = "tests/client-close-ctoken.rs" +name = "devnet-spl-ctoken-transfer" +path = "tests/devnet-spl-ctoken-transfer.rs" -[dev-dependencies] -# Light Protocol dependencies (pinned to specific commit) -light-ctoken-sdk = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" } -light-ctoken-interface = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" } -light-client = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1" } -light-program-test = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1", features = ["devenv"] } -light-test-utils = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3b811efce9b1fe2a34e9fb4332bb65cf39dc4df1", features = ["devenv"] } +[dependencies] +# Light Protocol SDK dependencies +light-ctoken-sdk = "0.2.1" +light-ctoken-interface = "0.1.1" +light-sdk = { version = "0.17.1", features = ["v2"] } # Solana dependencies -solana-sdk = "2.2" solana-program = "2.2" -# SPL dependencies -anchor-spl = "0.31.1" -spl-token-2022 = { version = "7.0.0", features = ["no-entrypoint"] } - # Serialization borsh = "0.10.4" +[dev-dependencies] +# Light Protocol test dependencies +light-program-test = { version = "0.17.1", features = ["v2"] } +light-client = "0.17.2" + +# Solana dependencies +solana-sdk = "2.2" + +# SPL dependencies +spl-token = "7" +spl-token-2022 = "7" +spl-pod = "0.5" +anchor-spl = "0.31" + # Async runtime -tokio = { version = "1.36.0", features = ["full"] } +tokio = { version = "1.36", features = ["full"] } + +# Serialization +serde_json = "1" [lints.rust.unexpected_cfgs] level = "allow" diff --git a/c-token/src/close.rs b/c-token/src/close.rs new file mode 100644 index 0000000..33b4d9c --- /dev/null +++ b/c-token/src/close.rs @@ -0,0 +1,75 @@ +use light_ctoken_sdk::ctoken::CloseCTokenAccountCpi; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::{ID, TOKEN_ACCOUNT_SEED}; + +/// Handler for closing a compressed token account (invoke) +/// +/// Account order: +/// - accounts[0]: token_program (ctoken program) +/// - accounts[1]: account to close (writable) +/// - accounts[2]: destination for lamports (writable) +/// - accounts[3]: owner/authority (signer) +/// - accounts[4]: rent_sponsor (optional, writable) +pub fn process_close_account_invoke(accounts: &[AccountInfo]) -> Result<(), ProgramError> { + if accounts.len() < 4 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + let rent_sponsor = if accounts.len() > 4 { + Some(accounts[4].clone()) + } else { + None + }; + + CloseCTokenAccountCpi { + token_program: accounts[0].clone(), + account: accounts[1].clone(), + destination: accounts[2].clone(), + owner: accounts[3].clone(), + rent_sponsor, + } + .invoke()?; + + Ok(()) +} + +/// Handler for closing a PDA-owned compressed token account (invoke_signed) +/// +/// Account order: +/// - accounts[0]: token_program (ctoken program) +/// - accounts[1]: account to close (writable) +/// - accounts[2]: destination for lamports (writable) +/// - accounts[3]: PDA owner/authority (not signer, program signs) +/// - accounts[4]: rent_sponsor (optional, writable) +pub fn process_close_account_invoke_signed(accounts: &[AccountInfo]) -> Result<(), ProgramError> { + if accounts.len() < 4 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the authority + let (pda, bump) = Pubkey::find_program_address(&[TOKEN_ACCOUNT_SEED], &ID); + + // Verify the authority account is the PDA we expect + if &pda != accounts[3].key { + return Err(ProgramError::InvalidSeeds); + } + + let rent_sponsor = if accounts.len() > 4 { + Some(accounts[4].clone()) + } else { + None + }; + + let signer_seeds: &[&[u8]] = &[TOKEN_ACCOUNT_SEED, &[bump]]; + CloseCTokenAccountCpi { + token_program: accounts[0].clone(), + account: accounts[1].clone(), + destination: accounts[2].clone(), + owner: accounts[3].clone(), + rent_sponsor, + } + .invoke_signed(&[signer_seeds])?; + + Ok(()) +} diff --git a/c-token/src/create_ata2.rs b/c-token/src/create_ata2.rs new file mode 100644 index 0000000..4c599be --- /dev/null +++ b/c-token/src/create_ata2.rs @@ -0,0 +1,100 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use light_ctoken_sdk::ctoken::{CompressibleParamsCpi, CreateAssociatedCTokenAccountCpi}; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::{ATA_SEED, ID}; + +/// Instruction data for create ATA V2 (owner/mint as accounts) +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateAta2Data { + pub bump: u8, + pub pre_pay_num_epochs: u8, + pub lamports_per_write: u32, +} + +/// Handler for creating ATA using V2 variant (invoke) +/// +/// Account order: +/// - accounts[0]: owner (readonly) +/// - accounts[1]: mint (readonly) +/// - accounts[2]: payer (signer, writable) +/// - accounts[3]: associated_token_account (writable) +/// - accounts[4]: system_program +/// - accounts[5]: compressible_config +/// - accounts[6]: rent_sponsor (writable) +pub fn process_create_ata2_invoke( + accounts: &[AccountInfo], + data: CreateAta2Data, +) -> Result<(), ProgramError> { + if accounts.len() < 7 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + let compressible_params = CompressibleParamsCpi::new( + accounts[5].clone(), + accounts[6].clone(), + accounts[4].clone(), + ); + + CreateAssociatedCTokenAccountCpi { + owner: accounts[0].clone(), + mint: accounts[1].clone(), + payer: accounts[2].clone(), + associated_token_account: accounts[3].clone(), + system_program: accounts[4].clone(), + bump: data.bump, + compressible: Some(compressible_params), + idempotent: false, + } + .invoke()?; + + Ok(()) +} + +/// Handler for creating ATA using V2 variant with PDA ownership (invoke_signed) +/// +/// Account order: +/// - accounts[0]: owner (PDA, readonly) +/// - accounts[1]: mint (readonly) +/// - accounts[2]: payer (PDA, writable, not signer - program signs) +/// - accounts[3]: associated_token_account (writable) +/// - accounts[4]: system_program +/// - accounts[5]: compressible_config +/// - accounts[6]: rent_sponsor (writable) +pub fn process_create_ata2_invoke_signed( + accounts: &[AccountInfo], + data: CreateAta2Data, +) -> Result<(), ProgramError> { + if accounts.len() < 7 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA that will act as payer + let (pda, bump) = Pubkey::find_program_address(&[ATA_SEED], &ID); + + // Verify the payer is the PDA + if &pda != accounts[2].key { + return Err(ProgramError::InvalidSeeds); + } + + let compressible_params = CompressibleParamsCpi::new( + accounts[5].clone(), + accounts[6].clone(), + accounts[4].clone(), + ); + + let signer_seeds: &[&[u8]] = &[ATA_SEED, &[bump]]; + CreateAssociatedCTokenAccountCpi { + owner: accounts[0].clone(), + mint: accounts[1].clone(), + payer: accounts[2].clone(), // PDA + associated_token_account: accounts[3].clone(), + system_program: accounts[4].clone(), + bump: data.bump, + compressible: Some(compressible_params), + idempotent: false, + } + .invoke_signed(&[signer_seeds])?; + + Ok(()) +} diff --git a/c-token/src/create_cmint.rs b/c-token/src/create_cmint.rs new file mode 100644 index 0000000..8d0a753 --- /dev/null +++ b/c-token/src/create_cmint.rs @@ -0,0 +1,262 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use light_ctoken_sdk::{ + ctoken::{ + CreateCMintCpi, CreateCMintParams, ExtensionInstructionData, SystemAccountInfos, + }, + CompressedProof, +}; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::ID; + +/// PDA seed for mint signer in invoke_signed variant +pub const MINT_SIGNER_SEED: &[u8] = b"mint_signer"; + +/// Instruction data for create compressed mint +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateCmintData { + pub decimals: u8, + pub address_merkle_tree_root_index: u16, + pub mint_authority: Pubkey, + pub proof: CompressedProof, + pub compression_address: [u8; 32], + pub mint: Pubkey, + pub freeze_authority: Option, + pub extensions: Option>, +} + +/// Handler for creating a compressed mint (invoke) +/// +/// Uses the CreateCMintAccountInfos builder pattern. This demonstrates how to: +/// 1. Build the CreateCMintParams struct from instruction data +/// 2. Build the CreateCMintAccountInfos with accounts +/// 3. Call invoke() which handles instruction building and CPI +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: light_system_program +/// - accounts[2]: mint_signer (signer) +/// - accounts[3]: payer (signer, also authority) +/// - accounts[4]: payer again (fee_payer in SDK) +/// - accounts[5]: cpi_authority_pda +/// - accounts[6]: registered_program_pda +/// - accounts[7]: account_compression_authority +/// - accounts[8]: account_compression_program +/// - accounts[9]: system_program +/// - accounts[10]: output_queue +/// - accounts[11]: address_tree +/// - accounts[12] (optional): cpi_context_account +pub fn process_create_cmint( + accounts: &[AccountInfo], + data: CreateCmintData, +) -> Result<(), ProgramError> { + if accounts.len() < 12 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Build the params + let params = CreateCMintParams { + decimals: data.decimals, + address_merkle_tree_root_index: data.address_merkle_tree_root_index, + mint_authority: data.mint_authority, + proof: data.proof, + compression_address: data.compression_address, + mint: data.mint, + freeze_authority: data.freeze_authority, + extensions: data.extensions, + }; + + // Build system accounts struct + let system_accounts = SystemAccountInfos { + light_system_program: accounts[1].clone(), + cpi_authority_pda: accounts[5].clone(), + registered_program_pda: accounts[6].clone(), + account_compression_authority: accounts[7].clone(), + account_compression_program: accounts[8].clone(), + system_program: accounts[9].clone(), + }; + + // Build the account infos struct + // In this case, payer == authority (accounts[3]) + CreateCMintCpi { + mint_seed: accounts[2].clone(), + authority: accounts[3].clone(), + payer: accounts[3].clone(), + address_tree: accounts[11].clone(), + output_queue: accounts[10].clone(), + system_accounts, + cpi_context: None, + cpi_context_account: None, + params, + } + .invoke()?; + + Ok(()) +} + +/// Handler for creating a compressed mint with PDA mint signer (invoke_signed) +/// +/// Uses the CreateCMintAccountInfos builder pattern with invoke_signed. +/// The mint_signer is a PDA derived from this program. +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: light_system_program +/// - accounts[2]: mint_signer (PDA, not signer - program signs) +/// - accounts[3]: payer (signer, also authority) +/// - accounts[4]: payer again (fee_payer in SDK) +/// - accounts[5]: cpi_authority_pda +/// - accounts[6]: registered_program_pda +/// - accounts[7]: account_compression_authority +/// - accounts[8]: account_compression_program +/// - accounts[9]: system_program +/// - accounts[10]: output_queue +/// - accounts[11]: address_tree +/// - accounts[12] (optional): cpi_context_account +pub fn process_create_cmint_invoke_signed( + accounts: &[AccountInfo], + data: CreateCmintData, +) -> Result<(), ProgramError> { + if accounts.len() < 12 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the mint signer + let (pda, bump) = Pubkey::find_program_address(&[MINT_SIGNER_SEED], &ID); + + // Verify the mint_signer account is the PDA we expect + if &pda != accounts[2].key { + return Err(ProgramError::InvalidSeeds); + } + + // Build the params + let params = CreateCMintParams { + decimals: data.decimals, + address_merkle_tree_root_index: data.address_merkle_tree_root_index, + mint_authority: data.mint_authority, + proof: data.proof, + compression_address: data.compression_address, + mint: data.mint, + freeze_authority: data.freeze_authority, + extensions: data.extensions, + }; + + // Build system accounts struct + let system_accounts = SystemAccountInfos { + light_system_program: accounts[1].clone(), + cpi_authority_pda: accounts[5].clone(), + registered_program_pda: accounts[6].clone(), + account_compression_authority: accounts[7].clone(), + account_compression_program: accounts[8].clone(), + system_program: accounts[9].clone(), + }; + + // Build the account infos struct + // In this case, payer == authority (accounts[3]) + let account_infos = CreateCMintCpi { + mint_seed: accounts[2].clone(), + authority: accounts[3].clone(), + payer: accounts[3].clone(), + address_tree: accounts[11].clone(), + output_queue: accounts[10].clone(), + system_accounts, + cpi_context: None, + cpi_context_account: None, + params, + }; + + // Invoke with PDA signing + let signer_seeds: &[&[u8]] = &[MINT_SIGNER_SEED, &[bump]]; + account_infos.invoke_signed(&[signer_seeds])?; + + Ok(()) +} + +/// Handler for creating a compressed mint with PDA mint signer AND PDA authority (invoke_signed) +/// +/// Uses the SDK's CreateCMintAccountInfos with separate authority and payer accounts. +/// Both mint_signer and authority are PDAs signed by this program. +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: light_system_program +/// - accounts[2]: mint_signer (PDA from MINT_SIGNER_SEED, not signer - program signs) +/// - accounts[3]: authority (PDA from MINT_AUTHORITY_SEED, not signer - program signs) +/// - accounts[4]: fee_payer (signer) +/// - accounts[5]: cpi_authority_pda +/// - accounts[6]: registered_program_pda +/// - accounts[7]: account_compression_authority +/// - accounts[8]: account_compression_program +/// - accounts[9]: system_program +/// - accounts[10]: output_queue +/// - accounts[11]: address_tree +/// - accounts[12] (optional): cpi_context_account +pub fn process_create_cmint_with_pda_authority( + accounts: &[AccountInfo], + data: CreateCmintData, +) -> Result<(), ProgramError> { + use crate::mint_to_ctoken::MINT_AUTHORITY_SEED; + + if accounts.len() < 12 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the mint signer + let (mint_signer_pda, mint_signer_bump) = + Pubkey::find_program_address(&[MINT_SIGNER_SEED], &ID); + + // Derive the PDA for the authority + let (authority_pda, authority_bump) = Pubkey::find_program_address(&[MINT_AUTHORITY_SEED], &ID); + + // Verify the mint_signer account is the PDA we expect + if &mint_signer_pda != accounts[2].key { + return Err(ProgramError::InvalidSeeds); + } + + // Verify the authority account is the PDA we expect + if &authority_pda != accounts[3].key { + return Err(ProgramError::InvalidSeeds); + } + + // Build the params - authority is the PDA + let params = CreateCMintParams { + decimals: data.decimals, + address_merkle_tree_root_index: data.address_merkle_tree_root_index, + mint_authority: authority_pda, // Use the derived PDA as authority + proof: data.proof, + compression_address: data.compression_address, + mint: data.mint, + freeze_authority: data.freeze_authority, + extensions: data.extensions, + }; + + // Build system accounts struct + let system_accounts = SystemAccountInfos { + light_system_program: accounts[1].clone(), + cpi_authority_pda: accounts[5].clone(), + registered_program_pda: accounts[6].clone(), + account_compression_authority: accounts[7].clone(), + account_compression_program: accounts[8].clone(), + system_program: accounts[9].clone(), + }; + + // Build the account infos struct using SDK + let account_infos = CreateCMintCpi { + mint_seed: accounts[2].clone(), + authority: accounts[3].clone(), + payer: accounts[4].clone(), + address_tree: accounts[11].clone(), + output_queue: accounts[10].clone(), + system_accounts, + cpi_context: None, + cpi_context_account: None, + params, + }; + + // Invoke with both PDAs signing + let mint_signer_seeds: &[&[u8]] = &[MINT_SIGNER_SEED, &[mint_signer_bump]]; + let authority_seeds: &[&[u8]] = &[MINT_AUTHORITY_SEED, &[authority_bump]]; + account_infos.invoke_signed(&[mint_signer_seeds, authority_seeds])?; + + Ok(()) +} diff --git a/c-token/src/create_token_account.rs b/c-token/src/create_token_account.rs new file mode 100644 index 0000000..b0e2231 --- /dev/null +++ b/c-token/src/create_token_account.rs @@ -0,0 +1,102 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use light_ctoken_sdk::ctoken::{CompressibleParamsCpi, CreateCTokenAccountCpi}; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::{ID, TOKEN_ACCOUNT_SEED}; + +/// Instruction data for create token account +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct CreateTokenAccountData { + pub owner: Pubkey, + pub pre_pay_num_epochs: u8, + pub lamports_per_write: u32, +} + +/// Handler for creating a compressible token account (invoke) +/// +/// Uses the builder pattern from the ctoken module. This demonstrates how to: +/// 1. Build the account infos struct with compressible params +/// 2. Call the invoke() method which handles instruction building and CPI +/// +/// Account order: +/// - accounts[0]: payer (signer) +/// - accounts[1]: account to create (signer) +/// - accounts[2]: mint +/// - accounts[3]: compressible_config +/// - accounts[4]: system_program +/// - accounts[5]: rent_sponsor +pub fn process_create_token_account_invoke( + accounts: &[AccountInfo], + data: CreateTokenAccountData, +) -> Result<(), ProgramError> { + if accounts.len() < 6 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Build the compressible params using constructor + let compressible_params = CompressibleParamsCpi::new( + accounts[3].clone(), + accounts[5].clone(), + accounts[4].clone(), + ); + + // Build the account infos struct + CreateCTokenAccountCpi { + payer: accounts[0].clone(), + account: accounts[1].clone(), + mint: accounts[2].clone(), + owner: data.owner, + compressible: Some(compressible_params), + } + .invoke()?; + + Ok(()) +} + +/// Handler for creating a compressible token account with PDA ownership (invoke_signed) +/// +/// Account order: +/// - accounts[0]: payer (signer) +/// - accounts[1]: account to create (PDA, will be derived and verified) +/// - accounts[2]: mint +/// - accounts[3]: compressible_config +/// - accounts[4]: system_program +/// - accounts[5]: rent_sponsor +pub fn process_create_token_account_invoke_signed( + accounts: &[AccountInfo], + data: CreateTokenAccountData, +) -> Result<(), ProgramError> { + if accounts.len() < 6 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the token account + let (pda, bump) = Pubkey::find_program_address(&[TOKEN_ACCOUNT_SEED], &ID); + + // Verify the account to create is the PDA + if &pda != accounts[1].key { + return Err(ProgramError::InvalidSeeds); + } + + // Build the compressible params using constructor + let compressible_params = CompressibleParamsCpi::new( + accounts[3].clone(), + accounts[5].clone(), + accounts[4].clone(), + ); + + // Build the account infos struct + let account_infos = CreateCTokenAccountCpi { + payer: accounts[0].clone(), + account: accounts[1].clone(), + mint: accounts[2].clone(), + owner: data.owner, + compressible: Some(compressible_params), + }; + + // Invoke with PDA signing + let signer_seeds: &[&[u8]] = &[TOKEN_ACCOUNT_SEED, &[bump]]; + account_infos.invoke_signed(&[signer_seeds])?; + + Ok(()) +} diff --git a/c-token/src/lib.rs b/c-token/src/lib.rs new file mode 100644 index 0000000..3e072c7 --- /dev/null +++ b/c-token/src/lib.rs @@ -0,0 +1,347 @@ +#![allow(unexpected_cfgs)] + +mod close; +mod create_ata2; +mod create_cmint; +mod create_token_account; +mod mint_to_ctoken; +mod transfer; +mod transfer_interface; +mod transfer_spl_ctoken; + +// Re-export all instruction data types +pub use close::{process_close_account_invoke, process_close_account_invoke_signed}; +pub use create_ata2::{ + process_create_ata2_invoke, process_create_ata2_invoke_signed, CreateAta2Data, +}; +pub use create_cmint::{ + process_create_cmint, process_create_cmint_invoke_signed, + process_create_cmint_with_pda_authority, CreateCmintData, MINT_SIGNER_SEED, +}; +pub use create_token_account::{ + process_create_token_account_invoke, process_create_token_account_invoke_signed, + CreateTokenAccountData, +}; +pub use mint_to_ctoken::{ + process_mint_to_ctoken, process_mint_to_ctoken_invoke_signed, MintToCTokenData, + MINT_AUTHORITY_SEED, +}; +use solana_program::{ + account_info::AccountInfo, entrypoint, program_error::ProgramError, pubkey, pubkey::Pubkey, +}; +pub use transfer::{process_transfer_invoke, process_transfer_invoke_signed, TransferData}; +pub use transfer_interface::{ + process_transfer_interface_invoke, process_transfer_interface_invoke_signed, + TransferInterfaceData, TRANSFER_INTERFACE_AUTHORITY_SEED, +}; +pub use transfer_spl_ctoken::{ + process_ctoken_to_spl_invoke, process_ctoken_to_spl_invoke_signed, + process_spl_to_ctoken_invoke, process_spl_to_ctoken_invoke_signed, TransferCtokenToSplData, + TransferSplToCtokenData, TRANSFER_AUTHORITY_SEED, +}; + +/// Program ID - replace with actual program ID after deployment +pub const ID: Pubkey = pubkey!("CToknNtvExmp1eProgram11111111111111111111112"); + +/// PDA seeds for invoke_signed instructions +pub const TOKEN_ACCOUNT_SEED: &[u8] = b"token_account"; +pub const ATA_SEED: &[u8] = b"ata"; + +entrypoint!(process_instruction); + +/// Instruction discriminators +#[repr(u8)] +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum InstructionType { + /// Create a compressed mint + CreateCmint = 0, + /// Mint tokens to compressed accounts + MintToCtoken = 1, + /// Create compressible token account (invoke) + CreateTokenAccountInvoke = 2, + /// Create compressible token account with PDA ownership (invoke_signed) + CreateTokenAccountInvokeSigned = 3, + // Note: CreateAtaInvoke (4) and CreateAtaInvokeSigned (5) removed - use CreateAta2 variants instead + /// Transfer compressed tokens CToken->CToken (invoke) + CTokenTransferInvoke = 6, + /// Transfer compressed tokens CToken->CToken from PDA-owned account (invoke_signed) + CTokenTransferInvokeSigned = 7, + /// Close compressed token account (invoke) + CloseAccountInvoke = 8, + /// Close PDA-owned compressed token account (invoke_signed) + CloseAccountInvokeSigned = 9, + /// Create ATA using V2 variant (invoke) + CreateAta2Invoke = 10, + /// Create ATA using V2 variant with PDA ownership (invoke_signed) + CreateAta2InvokeSigned = 11, + /// Create a compressed mint with PDA mint signer (invoke_signed) + CreateCmintInvokeSigned = 12, + /// Mint tokens with PDA mint authority (invoke_signed) + MintToCtokenInvokeSigned = 13, + /// Create a compressed mint with PDA mint signer AND PDA authority (invoke_signed) + CreateCmintWithPdaAuthority = 14, + /// Transfer SPL tokens to CToken account (invoke) + SplToCtokenInvoke = 15, + /// Transfer SPL tokens to CToken account with PDA authority (invoke_signed) + SplToCtokenInvokeSigned = 16, + /// Transfer CToken to SPL token account (invoke) + CtokenToSplInvoke = 17, + /// Transfer CToken to SPL token account with PDA authority (invoke_signed) + CtokenToSplInvokeSigned = 18, + /// Unified transfer interface - auto-detects account types (invoke) + TransferInterfaceInvoke = 19, + /// Unified transfer interface with PDA authority (invoke_signed) + TransferInterfaceInvokeSigned = 20, +} + +impl TryFrom for InstructionType { + type Error = ProgramError; + + fn try_from(value: u8) -> Result { + match value { + 0 => Ok(InstructionType::CreateCmint), + 1 => Ok(InstructionType::MintToCtoken), + 2 => Ok(InstructionType::CreateTokenAccountInvoke), + 3 => Ok(InstructionType::CreateTokenAccountInvokeSigned), + // 4 and 5 removed - use CreateAta2 variants (10, 11) instead + 6 => Ok(InstructionType::CTokenTransferInvoke), + 7 => Ok(InstructionType::CTokenTransferInvokeSigned), + 8 => Ok(InstructionType::CloseAccountInvoke), + 9 => Ok(InstructionType::CloseAccountInvokeSigned), + 10 => Ok(InstructionType::CreateAta2Invoke), + 11 => Ok(InstructionType::CreateAta2InvokeSigned), + 12 => Ok(InstructionType::CreateCmintInvokeSigned), + 13 => Ok(InstructionType::MintToCtokenInvokeSigned), + 14 => Ok(InstructionType::CreateCmintWithPdaAuthority), + 15 => Ok(InstructionType::SplToCtokenInvoke), + 16 => Ok(InstructionType::SplToCtokenInvokeSigned), + 17 => Ok(InstructionType::CtokenToSplInvoke), + 18 => Ok(InstructionType::CtokenToSplInvokeSigned), + 19 => Ok(InstructionType::TransferInterfaceInvoke), + 20 => Ok(InstructionType::TransferInterfaceInvokeSigned), + _ => Err(ProgramError::InvalidInstructionData), + } + } +} + +/// Main program entrypoint +pub fn process_instruction( + program_id: &Pubkey, + accounts: &[AccountInfo], + instruction_data: &[u8], +) -> Result<(), ProgramError> { + use borsh::BorshDeserialize; + + if program_id != &ID { + return Err(ProgramError::IncorrectProgramId); + } + + if instruction_data.is_empty() { + return Err(ProgramError::InvalidInstructionData); + } + + let discriminator = InstructionType::try_from(instruction_data[0])?; + + match discriminator { + InstructionType::CreateCmint => { + let data = CreateCmintData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_create_cmint(accounts, data) + } + InstructionType::MintToCtoken => { + let data = MintToCTokenData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_mint_to_ctoken(accounts, data) + } + InstructionType::CreateTokenAccountInvoke => { + let data = CreateTokenAccountData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_create_token_account_invoke(accounts, data) + } + InstructionType::CreateTokenAccountInvokeSigned => { + let data = CreateTokenAccountData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_create_token_account_invoke_signed(accounts, data) + } + InstructionType::CTokenTransferInvoke => { + let data = TransferData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_transfer_invoke(accounts, data) + } + InstructionType::CTokenTransferInvokeSigned => { + let data = TransferData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_transfer_invoke_signed(accounts, data) + } + InstructionType::CloseAccountInvoke => process_close_account_invoke(accounts), + InstructionType::CloseAccountInvokeSigned => process_close_account_invoke_signed(accounts), + InstructionType::CreateAta2Invoke => { + let data = CreateAta2Data::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_create_ata2_invoke(accounts, data) + } + InstructionType::CreateAta2InvokeSigned => { + let data = CreateAta2Data::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_create_ata2_invoke_signed(accounts, data) + } + InstructionType::CreateCmintInvokeSigned => { + let data = CreateCmintData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_create_cmint_invoke_signed(accounts, data) + } + InstructionType::MintToCtokenInvokeSigned => { + let data = MintToCTokenData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_mint_to_ctoken_invoke_signed(accounts, data) + } + InstructionType::CreateCmintWithPdaAuthority => { + let data = CreateCmintData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_create_cmint_with_pda_authority(accounts, data) + } + InstructionType::SplToCtokenInvoke => { + let data = TransferSplToCtokenData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_spl_to_ctoken_invoke(accounts, data) + } + InstructionType::SplToCtokenInvokeSigned => { + let data = TransferSplToCtokenData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_spl_to_ctoken_invoke_signed(accounts, data) + } + InstructionType::CtokenToSplInvoke => { + let data = TransferCtokenToSplData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_ctoken_to_spl_invoke(accounts, data) + } + InstructionType::CtokenToSplInvokeSigned => { + let data = TransferCtokenToSplData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_ctoken_to_spl_invoke_signed(accounts, data) + } + InstructionType::TransferInterfaceInvoke => { + let data = TransferInterfaceData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_transfer_interface_invoke(accounts, data) + } + InstructionType::TransferInterfaceInvokeSigned => { + let data = TransferInterfaceData::try_from_slice(&instruction_data[1..]) + .map_err(|_| ProgramError::InvalidInstructionData)?; + process_transfer_interface_invoke_signed(accounts, data) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_instruction_discriminators() { + assert_eq!(InstructionType::CreateCmint as u8, 0); + assert_eq!(InstructionType::MintToCtoken as u8, 1); + assert_eq!(InstructionType::CreateTokenAccountInvoke as u8, 2); + assert_eq!(InstructionType::CreateTokenAccountInvokeSigned as u8, 3); + // CreateAtaInvoke (4) and CreateAtaInvokeSigned (5) removed + assert_eq!(InstructionType::CTokenTransferInvoke as u8, 6); + assert_eq!(InstructionType::CTokenTransferInvokeSigned as u8, 7); + assert_eq!(InstructionType::CloseAccountInvoke as u8, 8); + assert_eq!(InstructionType::CloseAccountInvokeSigned as u8, 9); + assert_eq!(InstructionType::CreateAta2Invoke as u8, 10); + assert_eq!(InstructionType::CreateAta2InvokeSigned as u8, 11); + assert_eq!(InstructionType::CreateCmintInvokeSigned as u8, 12); + assert_eq!(InstructionType::MintToCtokenInvokeSigned as u8, 13); + assert_eq!(InstructionType::CreateCmintWithPdaAuthority as u8, 14); + assert_eq!(InstructionType::SplToCtokenInvoke as u8, 15); + assert_eq!(InstructionType::SplToCtokenInvokeSigned as u8, 16); + assert_eq!(InstructionType::CtokenToSplInvoke as u8, 17); + assert_eq!(InstructionType::CtokenToSplInvokeSigned as u8, 18); + assert_eq!(InstructionType::TransferInterfaceInvoke as u8, 19); + assert_eq!(InstructionType::TransferInterfaceInvokeSigned as u8, 20); + } + + #[test] + fn test_instruction_type_conversion() { + assert_eq!( + InstructionType::try_from(0).unwrap(), + InstructionType::CreateCmint + ); + assert_eq!( + InstructionType::try_from(1).unwrap(), + InstructionType::MintToCtoken + ); + assert_eq!( + InstructionType::try_from(2).unwrap(), + InstructionType::CreateTokenAccountInvoke + ); + assert_eq!( + InstructionType::try_from(3).unwrap(), + InstructionType::CreateTokenAccountInvokeSigned + ); + // 4 and 5 removed - now return errors + assert!(InstructionType::try_from(4).is_err()); + assert!(InstructionType::try_from(5).is_err()); + assert_eq!( + InstructionType::try_from(6).unwrap(), + InstructionType::CTokenTransferInvoke + ); + assert_eq!( + InstructionType::try_from(7).unwrap(), + InstructionType::CTokenTransferInvokeSigned + ); + assert_eq!( + InstructionType::try_from(8).unwrap(), + InstructionType::CloseAccountInvoke + ); + assert_eq!( + InstructionType::try_from(9).unwrap(), + InstructionType::CloseAccountInvokeSigned + ); + assert_eq!( + InstructionType::try_from(10).unwrap(), + InstructionType::CreateAta2Invoke + ); + assert_eq!( + InstructionType::try_from(11).unwrap(), + InstructionType::CreateAta2InvokeSigned + ); + assert_eq!( + InstructionType::try_from(12).unwrap(), + InstructionType::CreateCmintInvokeSigned + ); + assert_eq!( + InstructionType::try_from(13).unwrap(), + InstructionType::MintToCtokenInvokeSigned + ); + assert_eq!( + InstructionType::try_from(14).unwrap(), + InstructionType::CreateCmintWithPdaAuthority + ); + assert_eq!( + InstructionType::try_from(15).unwrap(), + InstructionType::SplToCtokenInvoke + ); + assert_eq!( + InstructionType::try_from(16).unwrap(), + InstructionType::SplToCtokenInvokeSigned + ); + assert_eq!( + InstructionType::try_from(17).unwrap(), + InstructionType::CtokenToSplInvoke + ); + assert_eq!( + InstructionType::try_from(18).unwrap(), + InstructionType::CtokenToSplInvokeSigned + ); + assert_eq!( + InstructionType::try_from(19).unwrap(), + InstructionType::TransferInterfaceInvoke + ); + assert_eq!( + InstructionType::try_from(20).unwrap(), + InstructionType::TransferInterfaceInvokeSigned + ); + assert!(InstructionType::try_from(21).is_err()); + } +} diff --git a/c-token/src/mint_to_ctoken.rs b/c-token/src/mint_to_ctoken.rs new file mode 100644 index 0000000..cf58318 --- /dev/null +++ b/c-token/src/mint_to_ctoken.rs @@ -0,0 +1,167 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use light_ctoken_interface::instructions::mint_action::CompressedMintWithContext; +use light_ctoken_sdk::ctoken::{MintToCTokenCpi, MintToCTokenParams, SystemAccountInfos}; +use light_sdk::instruction::ValidityProof; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::ID; + +/// PDA seed for mint authority in invoke_signed variant +pub const MINT_AUTHORITY_SEED: &[u8] = b"mint_authority"; + +/// Instruction data for mint_to_ctoken operations +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct MintToCTokenData { + pub compressed_mint_inputs: CompressedMintWithContext, + pub amount: u64, + pub mint_authority: Pubkey, + pub proof: ValidityProof, +} + +/// Handler for minting tokens to compressed token accounts +/// +/// Uses the MintToCTokenInfos builder pattern. This demonstrates how to: +/// 1. Build MintToCTokenParams using the constructor +/// 2. Build MintToCTokenInfos with accounts and params +/// 3. Call invoke() which handles instruction building and CPI +/// +/// Account order (all accounts from SDK-generated instruction): +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: light_system_program +/// - accounts[2]: authority (mint_authority) +/// - accounts[3]: fee_payer +/// - accounts[4]: cpi_authority_pda +/// - accounts[5]: registered_program_pda +/// - accounts[6]: account_compression_authority +/// - accounts[7]: account_compression_program +/// - accounts[8]: system_program +/// - accounts[9]: output_queue +/// - accounts[10]: state_tree +/// - accounts[11]: input_queue +/// - accounts[12..]: ctoken_accounts (variable length - destination accounts) +pub fn process_mint_to_ctoken( + accounts: &[AccountInfo], + data: MintToCTokenData, +) -> Result<(), ProgramError> { + if accounts.len() < 13 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Build params using the constructor + let params = MintToCTokenParams::new( + data.compressed_mint_inputs, + data.amount, + data.mint_authority, + data.proof, + ); + + // Build system accounts struct + let system_accounts = SystemAccountInfos { + light_system_program: accounts[1].clone(), + cpi_authority_pda: accounts[4].clone(), + registered_program_pda: accounts[5].clone(), + account_compression_authority: accounts[6].clone(), + account_compression_program: accounts[7].clone(), + system_program: accounts[8].clone(), + }; + + // Collect ctoken accounts from remaining accounts (index 12 onwards) + let ctoken_accounts: Vec = accounts[12..].to_vec(); + + // Build the account infos struct and invoke + // SDK account order: output_queue (9), tree (10), input_queue (11), ctoken_accounts (12+) + // In this case, payer == authority (accounts[3]) + MintToCTokenCpi { + authority: accounts[2].clone(), // authority from SDK accounts + payer: accounts[3].clone(), // fee_payer from SDK accounts + state_tree: accounts[10].clone(), // tree at index 10 + input_queue: accounts[11].clone(), // input_queue at index 11 + output_queue: accounts[9].clone(), // output_queue at index 9 + ctoken_accounts, + system_accounts, + cpi_context: None, + cpi_context_account: None, + params, + } + .invoke()?; + + Ok(()) +} + +/// Handler for minting tokens with PDA mint authority (invoke_signed) +/// +/// Uses the MintToCTokenInfos builder pattern with invoke_signed. +/// The mint authority is a PDA derived from this program. +/// +/// Account order (all accounts from SDK-generated instruction): +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: light_system_program +/// - accounts[2]: authority (PDA mint_authority, not signer - program signs) +/// - accounts[3]: fee_payer +/// - accounts[4]: cpi_authority_pda +/// - accounts[5]: registered_program_pda +/// - accounts[6]: account_compression_authority +/// - accounts[7]: account_compression_program +/// - accounts[8]: system_program +/// - accounts[9]: output_queue +/// - accounts[10]: state_tree +/// - accounts[11]: input_queue +/// - accounts[12..]: ctoken_accounts (variable length - destination accounts) +pub fn process_mint_to_ctoken_invoke_signed( + accounts: &[AccountInfo], + data: MintToCTokenData, +) -> Result<(), ProgramError> { + if accounts.len() < 13 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the mint authority + let (pda, bump) = Pubkey::find_program_address(&[MINT_AUTHORITY_SEED], &ID); + + // Verify the authority account is the PDA we expect + if &pda != accounts[2].key { + return Err(ProgramError::InvalidSeeds); + } + + // Build params using the constructor + let params = MintToCTokenParams::new( + data.compressed_mint_inputs, + data.amount, + data.mint_authority, + data.proof, + ); + + // Build system accounts struct + let system_accounts = SystemAccountInfos { + light_system_program: accounts[1].clone(), + cpi_authority_pda: accounts[4].clone(), + registered_program_pda: accounts[5].clone(), + account_compression_authority: accounts[6].clone(), + account_compression_program: accounts[7].clone(), + system_program: accounts[8].clone(), + }; + + // Collect ctoken accounts from remaining accounts (index 12 onwards) + let ctoken_accounts: Vec = accounts[12..].to_vec(); + + // Build the account infos struct + // authority is the PDA (accounts[2]) + let account_infos = MintToCTokenCpi { + authority: accounts[2].clone(), // authority PDA + payer: accounts[3].clone(), // fee_payer from SDK accounts + state_tree: accounts[10].clone(), // tree at index 10 + input_queue: accounts[11].clone(), // input_queue at index 11 + output_queue: accounts[9].clone(), // output_queue at index 9 + ctoken_accounts, + system_accounts, + cpi_context: None, + cpi_context_account: None, + params, + }; + + // Invoke with PDA signing + let signer_seeds: &[&[u8]] = &[MINT_AUTHORITY_SEED, &[bump]]; + account_infos.invoke_signed(&[signer_seeds])?; + + Ok(()) +} diff --git a/c-token/src/transfer.rs b/c-token/src/transfer.rs new file mode 100644 index 0000000..1e21cfa --- /dev/null +++ b/c-token/src/transfer.rs @@ -0,0 +1,85 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use light_ctoken_sdk::ctoken::TransferCTokenCpi; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::{ID, TOKEN_ACCOUNT_SEED}; + +/// Instruction data for transfer operations +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct TransferData { + pub amount: u64, +} + +/// Handler for transferring compressed tokens (invoke) +/// +/// Uses the builder pattern from the ctoken module. This demonstrates how to: +/// 1. Build the account infos struct +/// 2. Call the invoke() method which handles instruction building and CPI +/// +/// Account order: +/// - accounts[0]: source ctoken account +/// - accounts[1]: destination ctoken account +/// - accounts[2]: authority (signer) +pub fn process_transfer_invoke( + accounts: &[AccountInfo], + data: TransferData, +) -> Result<(), ProgramError> { + if accounts.len() < 3 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Build the account infos struct using the builder pattern + TransferCTokenCpi { + source: accounts[0].clone(), + destination: accounts[1].clone(), + amount: data.amount, + authority: accounts[2].clone(), + max_top_up: None, + } + .invoke()?; + + Ok(()) +} + +/// Handler for transferring compressed tokens from PDA-owned account (invoke_signed) +/// +/// Uses the builder pattern with invoke_signed. This demonstrates how to: +/// 1. Build the account infos struct +/// 2. Derive PDA seeds +/// 3. Call invoke_signed() method with the signer seeds +/// +/// Account order: +/// - accounts[0]: source ctoken account (PDA-owned) +/// - accounts[1]: destination ctoken account +/// - accounts[2]: authority (PDA) +pub fn process_transfer_invoke_signed( + accounts: &[AccountInfo], + data: TransferData, +) -> Result<(), ProgramError> { + if accounts.len() < 3 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the authority + let (pda, bump) = Pubkey::find_program_address(&[TOKEN_ACCOUNT_SEED], &ID); + + // Verify the authority account is the PDA we expect + if &pda != accounts[2].key { + return Err(ProgramError::InvalidSeeds); + } + + // Build the account infos struct + let transfer_accounts = TransferCTokenCpi { + source: accounts[0].clone(), + destination: accounts[1].clone(), + amount: data.amount, + authority: accounts[2].clone(), + max_top_up: None, + }; + + // Invoke with PDA signing - the builder handles instruction creation and invoke_signed CPI + let signer_seeds: &[&[u8]] = &[TOKEN_ACCOUNT_SEED, &[bump]]; + transfer_accounts.invoke_signed(&[signer_seeds])?; + + Ok(()) +} diff --git a/c-token/src/transfer_interface.rs b/c-token/src/transfer_interface.rs new file mode 100644 index 0000000..2e60ecc --- /dev/null +++ b/c-token/src/transfer_interface.rs @@ -0,0 +1,124 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use light_ctoken_sdk::ctoken::TransferInterfaceCpi; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::ID; + +/// PDA seed for authority in invoke_signed variants +pub const TRANSFER_INTERFACE_AUTHORITY_SEED: &[u8] = b"transfer_interface_authority"; + +/// Instruction data for TransferInterface +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct TransferInterfaceData { + pub amount: u64, + /// Required for SPL<->CToken transfers, None for CToken->CToken + pub token_pool_pda_bump: Option, +} + +/// Handler for TransferInterface (invoke) +/// +/// This unified interface automatically detects account types and routes to: +/// - CToken -> CToken transfer +/// - CToken -> SPL transfer +/// - SPL -> CToken transfer +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: source_account (SPL or CToken) +/// - accounts[2]: destination_account (SPL or CToken) +/// - accounts[3]: authority (signer) +/// - accounts[4]: payer (signer) +/// - accounts[5]: compressed_token_program_authority +/// For SPL bridge (optional, required for SPL<->CToken): +/// - accounts[6]: mint +/// - accounts[7]: token_pool_pda +/// - accounts[8]: spl_token_program +pub fn process_transfer_interface_invoke( + accounts: &[AccountInfo], + data: TransferInterfaceData, +) -> Result<(), ProgramError> { + if accounts.len() < 6 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + let mut transfer = TransferInterfaceCpi::new( + data.amount, + accounts[1].clone(), // source_account + accounts[2].clone(), // destination_account + accounts[3].clone(), // authority + accounts[4].clone(), // payer + accounts[5].clone(), // compressed_token_program_authority + ); + + // Add SPL bridge config if provided + if accounts.len() >= 9 && data.token_pool_pda_bump.is_some() { + transfer = transfer.with_spl_interface( + Some(accounts[6].clone()), // mint + Some(accounts[8].clone()), // spl_token_program + Some(accounts[7].clone()), // token_pool_pda + data.token_pool_pda_bump, + )?; + } + + transfer.invoke()?; + + Ok(()) +} + +/// Handler for TransferInterface with PDA authority (invoke_signed) +/// +/// The authority is a PDA derived from TRANSFER_INTERFACE_AUTHORITY_SEED. +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: source_account (SPL or CToken) +/// - accounts[2]: destination_account (SPL or CToken) +/// - accounts[3]: authority (PDA, not signer - program signs) +/// - accounts[4]: payer (signer) +/// - accounts[5]: compressed_token_program_authority +/// For SPL bridge (optional, required for SPL<->CToken): +/// - accounts[6]: mint +/// - accounts[7]: token_pool_pda +/// - accounts[8]: spl_token_program +pub fn process_transfer_interface_invoke_signed( + accounts: &[AccountInfo], + data: TransferInterfaceData, +) -> Result<(), ProgramError> { + if accounts.len() < 6 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the authority + let (authority_pda, authority_bump) = + Pubkey::find_program_address(&[TRANSFER_INTERFACE_AUTHORITY_SEED], &ID); + + // Verify the authority account is the PDA we expect + if &authority_pda != accounts[3].key { + return Err(ProgramError::InvalidSeeds); + } + + let mut transfer = TransferInterfaceCpi::new( + data.amount, + accounts[1].clone(), // source_account + accounts[2].clone(), // destination_account + accounts[3].clone(), // authority (PDA) + accounts[4].clone(), // payer + accounts[5].clone(), // compressed_token_program_authority + ); + + // Add SPL bridge config if provided + if accounts.len() >= 9 && data.token_pool_pda_bump.is_some() { + transfer = transfer.with_spl_interface( + Some(accounts[6].clone()), // mint + Some(accounts[8].clone()), // spl_token_program + Some(accounts[7].clone()), // token_pool_pda + data.token_pool_pda_bump, + )?; + } + + // Invoke with PDA signing + let authority_seeds: &[&[u8]] = &[TRANSFER_INTERFACE_AUTHORITY_SEED, &[authority_bump]]; + transfer.invoke_signed(&[authority_seeds])?; + + Ok(()) +} diff --git a/c-token/src/transfer_spl_ctoken.rs b/c-token/src/transfer_spl_ctoken.rs new file mode 100644 index 0000000..3e3ff78 --- /dev/null +++ b/c-token/src/transfer_spl_ctoken.rs @@ -0,0 +1,198 @@ +use borsh::{BorshDeserialize, BorshSerialize}; +use light_ctoken_sdk::ctoken::{TransferCTokenToSplCpi, TransferSplToCtokenCpi}; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; + +use crate::ID; + +/// PDA seed for authority in invoke_signed variants +pub const TRANSFER_AUTHORITY_SEED: &[u8] = b"transfer_authority"; + +/// Instruction data for SPL to CToken transfer +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct TransferSplToCtokenData { + pub amount: u64, + pub token_pool_pda_bump: u8, +} + +/// Instruction data for CToken to SPL transfer +#[derive(BorshSerialize, BorshDeserialize, Debug)] +pub struct TransferCtokenToSplData { + pub amount: u64, + pub token_pool_pda_bump: u8, +} + +/// Handler for transferring SPL tokens to CToken (invoke) +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: source_spl_token_account +/// - accounts[2]: destination_ctoken_account (writable) +/// - accounts[3]: authority (signer) +/// - accounts[4]: mint +/// - accounts[5]: payer (signer) +/// - accounts[6]: token_pool_pda +/// - accounts[7]: spl_token_program +/// - accounts[8]: compressed_token_program_authority +pub fn process_spl_to_ctoken_invoke( + accounts: &[AccountInfo], + data: TransferSplToCtokenData, +) -> Result<(), ProgramError> { + if accounts.len() < 9 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + TransferSplToCtokenCpi { + source_spl_token_account: accounts[1].clone(), + destination_ctoken_account: accounts[2].clone(), + amount: data.amount, + authority: accounts[3].clone(), + mint: accounts[4].clone(), + payer: accounts[5].clone(), + spl_interface_pda: accounts[6].clone(), + spl_interface_pda_bump: data.token_pool_pda_bump, + spl_token_program: accounts[7].clone(), + compressed_token_program_authority: accounts[8].clone(), + } + .invoke()?; + + Ok(()) +} + +/// Handler for transferring SPL tokens to CToken with PDA authority (invoke_signed) +/// +/// The authority is a PDA derived from TRANSFER_AUTHORITY_SEED. +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: source_spl_token_account +/// - accounts[2]: destination_ctoken_account (writable) +/// - accounts[3]: authority (PDA, not signer - program signs) +/// - accounts[4]: mint +/// - accounts[5]: payer (signer) +/// - accounts[6]: token_pool_pda +/// - accounts[7]: spl_token_program +/// - accounts[8]: compressed_token_program_authority +pub fn process_spl_to_ctoken_invoke_signed( + accounts: &[AccountInfo], + data: TransferSplToCtokenData, +) -> Result<(), ProgramError> { + if accounts.len() < 9 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the authority + let (authority_pda, authority_bump) = + Pubkey::find_program_address(&[TRANSFER_AUTHORITY_SEED], &ID); + + // Verify the authority account is the PDA we expect + if &authority_pda != accounts[3].key { + return Err(ProgramError::InvalidSeeds); + } + + let account_infos = TransferSplToCtokenCpi { + source_spl_token_account: accounts[1].clone(), + destination_ctoken_account: accounts[2].clone(), + amount: data.amount, + authority: accounts[3].clone(), + mint: accounts[4].clone(), + payer: accounts[5].clone(), + spl_interface_pda: accounts[6].clone(), + spl_interface_pda_bump: data.token_pool_pda_bump, + spl_token_program: accounts[7].clone(), + compressed_token_program_authority: accounts[8].clone(), + }; + + // Invoke with PDA signing + let authority_seeds: &[&[u8]] = &[TRANSFER_AUTHORITY_SEED, &[authority_bump]]; + account_infos.invoke_signed(&[authority_seeds])?; + + Ok(()) +} + +/// Handler for transferring CToken to SPL tokens (invoke) +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: source_ctoken_account +/// - accounts[2]: destination_spl_token_account +/// - accounts[3]: authority (signer) +/// - accounts[4]: mint +/// - accounts[5]: payer (signer) +/// - accounts[6]: token_pool_pda +/// - accounts[7]: spl_token_program +/// - accounts[8]: compressed_token_program_authority +pub fn process_ctoken_to_spl_invoke( + accounts: &[AccountInfo], + data: TransferCtokenToSplData, +) -> Result<(), ProgramError> { + if accounts.len() < 9 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + TransferCTokenToSplCpi { + source_ctoken_account: accounts[1].clone(), + destination_spl_token_account: accounts[2].clone(), + amount: data.amount, + authority: accounts[3].clone(), + mint: accounts[4].clone(), + payer: accounts[5].clone(), + spl_interface_pda: accounts[6].clone(), + spl_interface_pda_bump: data.token_pool_pda_bump, + spl_token_program: accounts[7].clone(), + compressed_token_program_authority: accounts[8].clone(), + } + .invoke()?; + + Ok(()) +} + +/// Handler for transferring CToken to SPL tokens with PDA authority (invoke_signed) +/// +/// The authority is a PDA derived from TRANSFER_AUTHORITY_SEED. +/// +/// Account order: +/// - accounts[0]: compressed_token_program (for CPI) +/// - accounts[1]: source_ctoken_account +/// - accounts[2]: destination_spl_token_account +/// - accounts[3]: authority (PDA, not signer - program signs) +/// - accounts[4]: mint +/// - accounts[5]: payer (signer) +/// - accounts[6]: token_pool_pda +/// - accounts[7]: spl_token_program +/// - accounts[8]: compressed_token_program_authority +pub fn process_ctoken_to_spl_invoke_signed( + accounts: &[AccountInfo], + data: TransferCtokenToSplData, +) -> Result<(), ProgramError> { + if accounts.len() < 9 { + return Err(ProgramError::NotEnoughAccountKeys); + } + + // Derive the PDA for the authority + let (authority_pda, authority_bump) = + Pubkey::find_program_address(&[TRANSFER_AUTHORITY_SEED], &ID); + + // Verify the authority account is the PDA we expect + if &authority_pda != accounts[3].key { + return Err(ProgramError::InvalidSeeds); + } + + let account_infos = TransferCTokenToSplCpi { + source_ctoken_account: accounts[1].clone(), + destination_spl_token_account: accounts[2].clone(), + amount: data.amount, + authority: accounts[3].clone(), + mint: accounts[4].clone(), + payer: accounts[5].clone(), + spl_interface_pda: accounts[6].clone(), + spl_interface_pda_bump: data.token_pool_pda_bump, + spl_token_program: accounts[7].clone(), + compressed_token_program_authority: accounts[8].clone(), + }; + + // Invoke with PDA signing + let authority_seeds: &[&[u8]] = &[TRANSFER_AUTHORITY_SEED, &[authority_bump]]; + account_infos.invoke_signed(&[authority_seeds])?; + + Ok(()) +} diff --git a/c-token/tests/client-close-ctoken.rs b/c-token/tests/client-close-ctoken.rs index 5fd525f..f5e7d6d 100644 --- a/c-token/tests/client-close-ctoken.rs +++ b/c-token/tests/client-close-ctoken.rs @@ -4,7 +4,7 @@ use borsh::BorshDeserialize; use light_client::indexer::{AddressWithTree, Indexer}; use light_client::rpc::Rpc; use light_ctoken_sdk::ctoken::{ - CloseAccount, CreateCMint, CreateCMintParams, CreateCTokenAccount, + CloseCTokenAccount, CreateCMint, CreateCMintParams, CreateCTokenAccount, CTOKEN_PROGRAM_ID, }; use light_ctoken_interface::state::CToken; @@ -56,7 +56,7 @@ async fn test_close_ctoken_account() { assert_eq!(ctoken_state.amount, 0, "Account balance must be 0 to close"); // Step 5: Build close instruction using SDK builder - let close_instruction = CloseAccount::new( + let close_instruction = CloseCTokenAccount::new( CTOKEN_PROGRAM_ID, account.pubkey(), payer.pubkey(), // Destination for remaining lamports @@ -87,13 +87,13 @@ pub async fn create_compressed_mint( let output_queue = rpc.get_random_state_tree_info().unwrap().queue; // Derive compression address - let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( &mint_signer.pubkey(), &address_tree.tree, ); let mint_pda = - light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc diff --git a/c-token/tests/client-create-cata.rs b/c-token/tests/client-create-cata.rs index 75e83e0..86e6c52 100644 --- a/c-token/tests/client-create-cata.rs +++ b/c-token/tests/client-create-cata.rs @@ -4,7 +4,7 @@ use borsh::BorshDeserialize; use light_client::indexer::{AddressWithTree, Indexer}; use light_client::rpc::Rpc; use light_ctoken_sdk::ctoken::{ - derive_ctoken_ata, CreateAssociatedTokenAccount, CreateCMint, + derive_ctoken_ata, CreateAssociatedCTokenAccount, CreateCMint, CreateCMintParams, }; use light_ctoken_interface::state::CToken; @@ -29,7 +29,7 @@ async fn test_create_cata_client() { let (ata_address, _bump) = derive_ctoken_ata(&owner, &mint); // Step 4: Build instruction using SDK builder - let instruction = CreateAssociatedTokenAccount::new( + let instruction = CreateAssociatedCTokenAccount::new( payer.pubkey(), owner, mint, @@ -60,13 +60,13 @@ pub async fn create_compressed_mint( let output_queue = rpc.get_random_state_tree_info().unwrap().queue; // Derive compression address - let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( &mint_signer.pubkey(), &address_tree.tree, ); let mint_pda = - light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc diff --git a/c-token/tests/client-create-cmint.rs b/c-token/tests/client-create-cmint.rs index faaeef0..acee3ed 100644 --- a/c-token/tests/client-create-cmint.rs +++ b/c-token/tests/client-create-cmint.rs @@ -32,13 +32,13 @@ pub async fn create_compressed_mint( let output_queue = rpc.get_random_state_tree_info().unwrap().queue; // Derive address - let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( &mint_signer.pubkey(), &address_tree.tree, ); let mint_pda = - light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc diff --git a/c-token/tests/client-create-ctoken.rs b/c-token/tests/client-create-ctoken.rs index 5e91822..3bd58a3 100644 --- a/c-token/tests/client-create-ctoken.rs +++ b/c-token/tests/client-create-ctoken.rs @@ -62,13 +62,13 @@ pub async fn create_compressed_mint( let output_queue = rpc.get_random_state_tree_info().unwrap().queue; // Derive compression address - let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( &mint_signer.pubkey(), &address_tree.tree, ); let mint_pda = - light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc diff --git a/c-token/tests/client-mint-to-ctoken.rs b/c-token/tests/client-mint-to-ctoken.rs index bed7c1b..ca3b6dd 100644 --- a/c-token/tests/client-mint-to-ctoken.rs +++ b/c-token/tests/client-mint-to-ctoken.rs @@ -128,13 +128,13 @@ pub async fn create_compressed_mint( let output_queue = rpc.get_random_state_tree_info().unwrap().queue; // Derive compression address - let compression_address = light_ctoken_sdk::ctoken::derive_compressed_mint_address( + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( &mint_signer.pubkey(), &address_tree.tree, ); let mint_pda = - light_ctoken_sdk::ctoken::find_spl_mint_address(&mint_signer.pubkey()).0; + light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc diff --git a/c-token/tests/client-transfer-interface.rs b/c-token/tests/client-transfer-interface.rs index 93e1377..28f5408 100644 --- a/c-token/tests/client-transfer-interface.rs +++ b/c-token/tests/client-transfer-interface.rs @@ -2,17 +2,13 @@ use borsh::BorshDeserialize; use light_client::rpc::Rpc; -use light_ctoken_sdk::{ - ctoken::{ - derive_ctoken_ata, CreateAssociatedTokenAccount, TransferCtoken, - TransferSplToCtoken, - }, - token_pool::find_token_pool_pda_with_index, +use light_ctoken_sdk::ctoken::{ + derive_ctoken_ata, CreateAssociatedCTokenAccount, TransferCToken, + TransferSplToCtoken, }; use light_ctoken_interface::state::CToken; use light_program_test::{LightProgramTest, ProgramTestConfig}; -use light_test_utils::spl::{create_mint_helper, create_token_2022_account, mint_spl_tokens}; -use solana_sdk::{signature::Keypair, signer::Signer}; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; use spl_token_2022::state::Account as TokenAccount; use solana_program::program_pack::Pack; use anchor_spl; @@ -27,7 +23,7 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { let payer = rpc.get_payer().insecure_clone(); let sender = Keypair::new(); - light_test_utils::airdrop_lamports(&mut rpc, &sender.pubkey(), 1_000_000_000) + airdrop_lamports(&mut rpc, &sender.pubkey(), 1_000_000_000) .await .unwrap(); @@ -39,7 +35,7 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { // Step 3: Create SPL token account and mint tokens let spl_token_account = Keypair::new(); - create_token_2022_account(&mut rpc, &mint, &spl_token_account, &sender, false) + create_token_account(&mut rpc, &mint, &spl_token_account, &sender) .await .unwrap(); @@ -47,10 +43,8 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { &mut rpc, &mint, &spl_token_account.pubkey(), - &payer.pubkey(), &payer, initial_amount, - false, ) .await .unwrap(); @@ -58,7 +52,7 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { // Step 4: Create sender cToken ATA let (sender_ctoken_ata, _) = derive_ctoken_ata(&sender.pubkey(), &mint); - let create_sender_ata = CreateAssociatedTokenAccount::new( + let create_sender_ata = CreateAssociatedCTokenAccount::new( payer.pubkey(), sender.pubkey(), mint, @@ -71,18 +65,19 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { .unwrap(); // Step 5: Convert SPL tokens to cToken (7000 tokens) - let (token_pool_pda, token_pool_pda_bump) = find_token_pool_pda_with_index(&mint, 0); + let (spl_interface_pda, spl_interface_pda_bump) = + light_ctoken_sdk::ctoken::get_spl_interface_pda_and_bump(&mint); let spl_token_program = anchor_spl::token::ID; let spl_to_ctoken_instruction = TransferSplToCtoken { amount: spl_to_ctoken_amount, - token_pool_pda_bump, + spl_interface_pda_bump, source_spl_token_account: spl_token_account.pubkey(), destination_ctoken_account: sender_ctoken_ata, authority: sender.pubkey(), mint, payer: payer.pubkey(), - token_pool_pda, + spl_interface_pda, spl_token_program, } .instruction() @@ -98,13 +93,13 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { // Step 6: Create recipient cToken ATA let recipient = Keypair::new(); - light_test_utils::airdrop_lamports(&mut rpc, &recipient.pubkey(), 1_000_000_000) + airdrop_lamports(&mut rpc, &recipient.pubkey(), 1_000_000_000) .await .unwrap(); let (recipient_ctoken_ata, _) = derive_ctoken_ata(&recipient.pubkey(), &mint); - let create_recipient_ata = CreateAssociatedTokenAccount::new( + let create_recipient_ata = CreateAssociatedCTokenAccount::new( payer.pubkey(), recipient.pubkey(), mint, @@ -117,7 +112,7 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { .unwrap(); // Step 7: Transfer cToken from sender to recipient (3000 tokens) - let transfer_instruction = TransferCtoken { + let transfer_instruction = TransferCToken { source: sender_ctoken_ata, destination: recipient_ctoken_ata, amount: ctoken_transfer_amount, @@ -172,3 +167,114 @@ async fn test_client_transfer_spl_to_ctoken_to_ctoken() { "SPL account should have 3000 remaining" ); } + +// Helper functions inlined from light_test_utils (not available on crates.io) + +async fn airdrop_lamports( + rpc: &mut R, + destination_pubkey: &Pubkey, + lamports: u64, +) -> Result<(), light_client::rpc::errors::RpcError> { + let payer = rpc.get_payer().insecure_clone(); + let transfer_ix = solana_sdk::system_instruction::transfer( + &payer.pubkey(), + destination_pubkey, + lamports, + ); + rpc.create_and_send_transaction(&[transfer_ix], &payer.pubkey(), &[&payer]) + .await + .map(|_| ()) +} + +async fn create_mint_helper(rpc: &mut R, payer: &Keypair) -> Pubkey { + let mint = Keypair::new(); + let rent = rpc + .get_minimum_balance_for_rent_exemption(anchor_spl::token::Mint::LEN) + .await + .unwrap(); + + let create_account_ix = solana_sdk::system_instruction::create_account( + &payer.pubkey(), + &mint.pubkey(), + rent, + anchor_spl::token::Mint::LEN as u64, + &spl_token::ID, + ); + + let init_mint_ix = spl_token::instruction::initialize_mint( + &spl_token::ID, + &mint.pubkey(), + &payer.pubkey(), + Some(&payer.pubkey()), + 2, + ) + .unwrap(); + + rpc.create_and_send_transaction( + &[create_account_ix, init_mint_ix], + &payer.pubkey(), + &[payer, &mint], + ) + .await + .unwrap(); + + mint.pubkey() +} + +async fn create_token_account( + rpc: &mut R, + mint: &Pubkey, + account_keypair: &Keypair, + owner: &Keypair, +) -> Result<(), light_client::rpc::errors::RpcError> { + let rent = rpc + .get_minimum_balance_for_rent_exemption(spl_token::state::Account::LEN) + .await + .unwrap(); + + let create_account_ix = solana_sdk::system_instruction::create_account( + &owner.pubkey(), + &account_keypair.pubkey(), + rent, + spl_token::state::Account::LEN as u64, + &spl_token::ID, + ); + + let init_account_ix = spl_token::instruction::initialize_account( + &spl_token::ID, + &account_keypair.pubkey(), + mint, + &owner.pubkey(), + ) + .unwrap(); + + rpc.create_and_send_transaction( + &[create_account_ix, init_account_ix], + &owner.pubkey(), + &[account_keypair, owner], + ) + .await + .map(|_| ()) +} + +async fn mint_spl_tokens( + rpc: &mut R, + mint: &Pubkey, + token_account: &Pubkey, + mint_authority: &Keypair, + amount: u64, +) -> Result<(), light_client::rpc::errors::RpcError> { + let mint_to_ix = spl_token::instruction::mint_to( + &spl_token::ID, + mint, + token_account, + &mint_authority.pubkey(), + &[&mint_authority.pubkey()], + amount, + ) + .unwrap(); + + rpc.create_and_send_transaction(&[mint_to_ix], &mint_authority.pubkey(), &[mint_authority]) + .await + .map(|_| ()) +} diff --git a/c-token/tests/devnet-spl-ctoken-transfer.rs b/c-token/tests/devnet-spl-ctoken-transfer.rs new file mode 100644 index 0000000..d525440 --- /dev/null +++ b/c-token/tests/devnet-spl-ctoken-transfer.rs @@ -0,0 +1,328 @@ +// Devnet example: SPL token → cToken → cToken transfer +// +// This example demonstrates the full flow on devnet: +// 1. Create SPL mint +// 2. Mint SPL tokens +// 3. Transfer SPL tokens to cToken +// 4. Transfer cToken to another cToken account +// +// Run with: +// cargo test devnet_spl_to_ctoken --release -- --ignored --nocapture +// +// Requires: +// - KEYPAIR_PATH env var (default: ~/.config/solana/id.json) +// - PHOTON_URL env var (default: https://photon-devnet.helius.dev) +// - Devnet SOL in the keypair + +use borsh::BorshDeserialize; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; +use light_ctoken_sdk::ctoken::{ + derive_ctoken_ata, CreateAssociatedCTokenAccount, TransferCToken, TransferSplToCtoken, +}; +use light_ctoken_interface::state::CToken; +use solana_program::program_pack::Pack; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; +use spl_token_2022::state::Account as TokenAccount; +use std::env; + +#[tokio::test(flavor = "multi_thread")] +#[ignore] // Requires devnet SOL and indexer - run with --ignored flag +async fn test_devnet_spl_to_ctoken_to_ctoken() { + // Step 1: Setup devnet connection + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + println!("Using payer: {}", payer.pubkey()); + + let photon_url = env::var("PHOTON_URL") + .unwrap_or_else(|_| "https://photon-devnet.helius.dev".to_string()); + + let config = LightClientConfig::devnet(Some(photon_url), None); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to connect to devnet"); + + println!("Connected to devnet"); + + // Step 2: Create SPL mint + let mint = create_mint_helper(&mut rpc, &payer).await; + println!("Created SPL mint: {}", mint); + + let initial_amount = 10000u64; + let spl_to_ctoken_amount = 7000u64; + let ctoken_transfer_amount = 3000u64; + + // Step 3: Create SPL token account and mint tokens + let spl_token_account = Keypair::new(); + create_token_account(&mut rpc, &mint, &spl_token_account, &payer) + .await + .expect("Failed to create token account"); + println!("Created SPL token account: {}", spl_token_account.pubkey()); + + mint_spl_tokens( + &mut rpc, + &mint, + &spl_token_account.pubkey(), + &payer, + initial_amount, + ) + .await + .expect("Failed to mint SPL tokens"); + println!("Minted {} SPL tokens", initial_amount); + + // Step 4: Create sender cToken ATA + let sender = Keypair::new(); + let (sender_ctoken_ata, _) = derive_ctoken_ata(&sender.pubkey(), &mint); + + let create_sender_ata = CreateAssociatedCTokenAccount::new( + payer.pubkey(), + sender.pubkey(), + mint, + ) + .instruction() + .expect("Failed to create sender ATA instruction"); + + rpc.create_and_send_transaction(&[create_sender_ata], &payer.pubkey(), &[&payer]) + .await + .expect("Failed to create sender cToken ATA"); + println!("Created sender cToken ATA: {}", sender_ctoken_ata); + + // Step 5: Convert SPL tokens to cToken (7000 tokens) + let (spl_interface_pda, spl_interface_pda_bump) = + light_ctoken_sdk::ctoken::get_spl_interface_pda_and_bump(&mint); + let spl_token_program = anchor_spl::token::ID; + + let spl_to_ctoken_instruction = TransferSplToCtoken { + amount: spl_to_ctoken_amount, + spl_interface_pda_bump, + source_spl_token_account: spl_token_account.pubkey(), + destination_ctoken_account: sender_ctoken_ata, + authority: payer.pubkey(), // payer owns the SPL token account + mint, + payer: payer.pubkey(), + spl_interface_pda, + spl_token_program, + } + .instruction() + .expect("Failed to create SPL to cToken instruction"); + + rpc.create_and_send_transaction( + &[spl_to_ctoken_instruction], + &payer.pubkey(), + &[&payer], + ) + .await + .expect("Failed to transfer SPL to cToken"); + println!( + "Transferred {} SPL tokens to cToken", + spl_to_ctoken_amount + ); + + // Step 6: Create recipient cToken ATA + let recipient = Keypair::new(); + let (recipient_ctoken_ata, _) = derive_ctoken_ata(&recipient.pubkey(), &mint); + + let create_recipient_ata = CreateAssociatedCTokenAccount::new( + payer.pubkey(), + recipient.pubkey(), + mint, + ) + .instruction() + .expect("Failed to create recipient ATA instruction"); + + rpc.create_and_send_transaction(&[create_recipient_ata], &payer.pubkey(), &[&payer]) + .await + .expect("Failed to create recipient cToken ATA"); + println!("Created recipient cToken ATA: {}", recipient_ctoken_ata); + + // Step 7: Transfer cToken from sender to recipient (3000 tokens) + let transfer_instruction = TransferCToken { + source: sender_ctoken_ata, + destination: recipient_ctoken_ata, + amount: ctoken_transfer_amount, + authority: sender.pubkey(), + max_top_up: None, + } + .instruction() + .expect("Failed to create cToken transfer instruction"); + + rpc.create_and_send_transaction( + &[transfer_instruction], + &payer.pubkey(), + &[&payer, &sender], + ) + .await + .expect("Failed to transfer cToken"); + println!( + "Transferred {} cTokens from sender to recipient", + ctoken_transfer_amount + ); + + // Step 8: Verify balances + let sender_account_data = rpc + .get_account(sender_ctoken_ata) + .await + .expect("Failed to get sender account") + .expect("Sender account not found"); + let sender_state = CToken::deserialize(&mut &sender_account_data.data[..]) + .expect("Failed to deserialize sender cToken"); + + let recipient_account_data = rpc + .get_account(recipient_ctoken_ata) + .await + .expect("Failed to get recipient account") + .expect("Recipient account not found"); + let recipient_state = CToken::deserialize(&mut &recipient_account_data.data[..]) + .expect("Failed to deserialize recipient cToken"); + + // Sender should have: 7000 (converted) - 3000 (transferred) = 4000 + assert_eq!( + sender_state.amount, + spl_to_ctoken_amount - ctoken_transfer_amount, + "Sender cToken balance should be 4000" + ); + println!( + "Sender cToken balance: {} (expected: {})", + sender_state.amount, + spl_to_ctoken_amount - ctoken_transfer_amount + ); + + // Recipient should have: 3000 (received) + assert_eq!( + recipient_state.amount, ctoken_transfer_amount, + "Recipient cToken balance should be 3000" + ); + println!( + "Recipient cToken balance: {} (expected: {})", + recipient_state.amount, ctoken_transfer_amount + ); + + // Verify SPL account still has remaining tokens: 10000 - 7000 = 3000 + let spl_account_data = rpc + .get_account(spl_token_account.pubkey()) + .await + .expect("Failed to get SPL account") + .expect("SPL account not found"); + let spl_account = TokenAccount::unpack(&spl_account_data.data) + .expect("Failed to unpack SPL account"); + assert_eq!( + spl_account.amount, + initial_amount - spl_to_ctoken_amount, + "SPL account should have 3000 remaining" + ); + println!( + "SPL account balance: {} (expected: {})", + spl_account.amount, + initial_amount - spl_to_ctoken_amount + ); + + println!("\nAll assertions passed!"); +} + +// Helper: Load keypair from file +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = std::fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::from_bytes(&bytes)?) +} + +// Helper: Create SPL mint +async fn create_mint_helper(rpc: &mut R, payer: &Keypair) -> Pubkey { + let mint = Keypair::new(); + let rent = rpc + .get_minimum_balance_for_rent_exemption(anchor_spl::token::Mint::LEN) + .await + .expect("Failed to get rent"); + + let create_account_ix = solana_sdk::system_instruction::create_account( + &payer.pubkey(), + &mint.pubkey(), + rent, + anchor_spl::token::Mint::LEN as u64, + &spl_token::ID, + ); + + let init_mint_ix = spl_token::instruction::initialize_mint( + &spl_token::ID, + &mint.pubkey(), + &payer.pubkey(), + Some(&payer.pubkey()), + 2, // decimals + ) + .expect("Failed to create init mint instruction"); + + rpc.create_and_send_transaction( + &[create_account_ix, init_mint_ix], + &payer.pubkey(), + &[payer, &mint], + ) + .await + .expect("Failed to create mint"); + + mint.pubkey() +} + +// Helper: Create SPL token account +async fn create_token_account( + rpc: &mut R, + mint: &Pubkey, + account_keypair: &Keypair, + owner: &Keypair, +) -> Result<(), light_client::rpc::errors::RpcError> { + let rent = rpc + .get_minimum_balance_for_rent_exemption(spl_token::state::Account::LEN) + .await?; + + let create_account_ix = solana_sdk::system_instruction::create_account( + &owner.pubkey(), + &account_keypair.pubkey(), + rent, + spl_token::state::Account::LEN as u64, + &spl_token::ID, + ); + + let init_account_ix = spl_token::instruction::initialize_account( + &spl_token::ID, + &account_keypair.pubkey(), + mint, + &owner.pubkey(), + ) + .expect("Failed to create init account instruction"); + + rpc.create_and_send_transaction( + &[create_account_ix, init_account_ix], + &owner.pubkey(), + &[account_keypair, owner], + ) + .await + .map(|_| ()) +} + +// Helper: Mint SPL tokens +async fn mint_spl_tokens( + rpc: &mut R, + mint: &Pubkey, + token_account: &Pubkey, + mint_authority: &Keypair, + amount: u64, +) -> Result<(), light_client::rpc::errors::RpcError> { + let mint_to_ix = spl_token::instruction::mint_to( + &spl_token::ID, + mint, + token_account, + &mint_authority.pubkey(), + &[&mint_authority.pubkey()], + amount, + ) + .expect("Failed to create mint_to instruction"); + + rpc.create_and_send_transaction(&[mint_to_ix], &mint_authority.pubkey(), &[mint_authority]) + .await + .map(|_| ()) +} diff --git a/cli b/cli new file mode 120000 index 0000000..937e903 --- /dev/null +++ b/cli @@ -0,0 +1 @@ +/home/tilo/Workspace/light-protocol/cli \ No newline at end of file From 12a9d5294b577308817ee1f273137d423f97aace Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Tue, 9 Dec 2025 10:33:23 +0000 Subject: [PATCH 05/11] Refactor devnet tests: move API keys to environment variables - Add dotenvy dependency for .env file support - Create .gitignore to exclude .env files from version control - Update devnet-client-create-cmint.rs to load HELIUS_API_KEY from env - Add debug output to client-close-ctoken.rs - Fix function names in client-create-cmint.rs (derive_cmint_compressed_address) --- c-token/.gitignore | 5 + c-token/Cargo.lock | 389 +++++++++++++------- c-token/Cargo.toml | 5 +- c-token/tests/client-close-ctoken.rs | 11 +- c-token/tests/client-create-cmint.rs | 2 +- c-token/tests/devnet-client-create-cmint.rs | 148 ++++++++ 6 files changed, 433 insertions(+), 127 deletions(-) create mode 100644 c-token/.gitignore create mode 100644 c-token/tests/devnet-client-create-cmint.rs diff --git a/c-token/.gitignore b/c-token/.gitignore new file mode 100644 index 0000000..5ce6136 --- /dev/null +++ b/c-token/.gitignore @@ -0,0 +1,5 @@ +# Ignore local environment and secrets +.env +.env* +# Ignore build artifacts +/target/ diff --git a/c-token/Cargo.lock b/c-token/Cargo.lock index b4c56c5..2be67ae 100644 --- a/c-token/Cargo.lock +++ b/c-token/Cargo.lock @@ -281,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", @@ -299,7 +298,6 @@ dependencies = [ "anchor-lang-idl-spec", "anyhow", "heck 0.3.3", - "regex", "serde", "serde_json", "sha2 0.10.9", @@ -338,7 +336,6 @@ checksum = "5dc7a6d90cc643df0ed2744862cdf180587d1e5d28936538c18fc8908489ed67" dependencies = [ "anyhow", "bs58", - "cargo_toml", "heck 0.3.3", "proc-macro2", "quote", @@ -918,11 +915,12 @@ version = "0.1.0" dependencies = [ "anchor-spl", "borsh 0.10.4", - "light-client", + "dotenvy", + "light-client 0.17.2", "light-ctoken-interface", "light-ctoken-sdk", "light-program-test", - "light-sdk", + "light-sdk 0.17.1", "serde_json", "solana-program", "solana-sdk", @@ -932,16 +930,6 @@ dependencies = [ "tokio", ] -[[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.49" @@ -1310,6 +1298,12 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "dyn-clone" version = "1.0.20" @@ -2420,6 +2414,20 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "light-account-checks" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e70bd1a384bff312860d4b60a0ccd814c36b88ce91966192dd88a35e595f7a2" +dependencies = [ + "solana-account-info", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sysvar", + "thiserror 2.0.17", +] + [[package]] name = "light-account-checks" version = "0.6.0" @@ -2455,6 +2463,55 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "light-client" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e90cacf890dd9e27be63334f1fa4495eaa0feb7f212133833d472ee39102bd62" +dependencies = [ + "async-trait", + "base64 0.13.1", + "borsh 0.10.4", + "bs58", + "bytemuck", + "lazy_static", + "light-compressed-account 0.6.2", + "light-concurrent-merkle-tree 4.0.1", + "light-event 0.1.1", + "light-hasher", + "light-indexed-merkle-tree 4.0.1", + "light-merkle-tree-metadata 0.6.0", + "light-prover-client 4.0.0", + "light-sdk 0.16.0", + "litesvm", + "num-bigint 0.4.6", + "num-traits", + "photon-api 0.52.0", + "rand 0.8.5", + "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-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-program-error", + "solana-pubkey", + "solana-rpc-client", + "solana-rpc-client-api", + "solana-signature", + "solana-transaction", + "solana-transaction-error", + "solana-transaction-status-client-types", + "thiserror 2.0.17", + "tokio", + "tracing", +] + [[package]] name = "light-client" version = "0.17.2" @@ -2466,23 +2523,21 @@ dependencies = [ "borsh 0.10.4", "bs58", "lazy_static", - "light-compressed-account", - "light-concurrent-merkle-tree", + "light-compressed-account 0.7.0", + "light-concurrent-merkle-tree 5.0.0", "light-ctoken-sdk", - "light-event", + "light-event 0.2.1", "light-hasher", - "light-indexed-merkle-tree", - "light-merkle-tree-metadata", - "light-prover-client", - "light-sdk", - "litesvm", + "light-indexed-merkle-tree 5.0.0", + "light-merkle-tree-metadata 0.7.0", + "light-prover-client 5.0.1", + "light-sdk 0.17.1", "num-bigint 0.4.6", "photon-api 0.53.0", "rand 0.8.5", "solana-account", "solana-account-decoder-client-types", "solana-address-lookup-table-interface", - "solana-banks-client", "solana-clock", "solana-commitment-config", "solana-compute-budget-interface", @@ -2503,13 +2558,34 @@ dependencies = [ "tracing", ] +[[package]] +name = "light-compressed-account" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9cecda1680283ecba0f8ef64073d36998f057ac5aa96569dc8e74d6a37a3a2" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-hasher", + "light-macros", + "light-poseidon 0.3.0", + "light-program-profiler", + "light-zero-copy", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "thiserror 2.0.17", + "tinyvec", + "zerocopy", +] + [[package]] name = "light-compressed-account" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058df2733fa6a3e4bda6f162a6c5d41f10fc8c6f6ddb992af1de76b60214e4a6" dependencies = [ - "anchor-lang", "borsh 0.10.4", "bytemuck", "light-hasher", @@ -2533,11 +2609,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3648e2cd17ed29c72fefd95c099c9673a289e7ce1fd9b76f7f16cc1e5ddaf97" dependencies = [ "aligned-sized", - "anchor-lang", "borsh 0.10.4", "bytemuck", - "light-account-checks", - "light-compressed-account", + "light-account-checks 0.6.0", + "light-compressed-account 0.7.0", "light-hasher", "light-macros", "light-program-profiler", @@ -2553,18 +2628,16 @@ dependencies = [ ] [[package]] -name = "light-compressible-client" -version = "0.17.1" +name = "light-concurrent-merkle-tree" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d57f59c916e82fcf262e408e659472ea5a07d7ac492277a4f422f115823282" +checksum = "0123e37a6796ca82cca864f00f160cf73652deac17a3e625007f184f7e95e62b" dependencies = [ - "anchor-lang", "borsh 0.10.4", - "light-client", - "light-sdk", - "solana-account", - "solana-instruction", - "solana-pubkey", + "light-bounded-vec", + "light-hasher", + "memoffset", + "solana-program-error", "thiserror 2.0.17", ] @@ -2592,7 +2665,7 @@ dependencies = [ "borsh 0.10.4", "bytemuck", "light-array-map", - "light-compressed-account", + "light-compressed-account 0.7.0", "light-compressible", "light-hasher", "light-macros", @@ -2617,15 +2690,15 @@ checksum = "eda77f9130dfbbb5800988f41a87bb74b8f59854ab62629565e5b818b0352a6f" dependencies = [ "arrayvec", "borsh 0.10.4", - "light-account-checks", - "light-compressed-account", + "light-account-checks 0.6.0", + "light-compressed-account 0.7.0", "light-compressible", "light-ctoken-interface", "light-ctoken-types", "light-macros", "light-program-profiler", - "light-sdk", - "light-sdk-types", + "light-sdk 0.17.1", + "light-sdk-types 0.17.1", "light-zero-copy", "solana-account-info", "solana-cpi", @@ -2645,14 +2718,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d7facfbde56b67693061f12572792ff142e0eef4d20f7153ceb5401934f1aac" dependencies = [ "borsh 0.10.4", - "light-account-checks", - "light-compressed-account", + "light-account-checks 0.6.0", + "light-compressed-account 0.7.0", "light-macros", - "light-sdk-types", + "light-sdk-types 0.17.1", "solana-msg", "thiserror 2.0.17", ] +[[package]] +name = "light-event" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "554228ce821d9c3b789f1c675f79663fe3872c77a3527e1e20e5f2f268eeb02d" +dependencies = [ + "borsh 0.10.4", + "light-compressed-account 0.6.2", + "light-hasher", + "light-zero-copy", + "thiserror 2.0.17", +] + [[package]] name = "light-event" version = "0.2.1" @@ -2660,7 +2746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9032317e17599cfdefac76b8f44563b535afc6401ca1539a752937ea2dd5b63" dependencies = [ "borsh 0.10.4", - "light-compressed-account", + "light-compressed-account 0.7.0", "light-hasher", "light-zero-copy", "thiserror 2.0.17", @@ -2696,6 +2782,22 @@ dependencies = [ "thiserror 2.0.17", ] +[[package]] +name = "light-indexed-merkle-tree" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b717eb0e72d96490c294f05fa9fbcc9a83253a1a0f8932de2fcad1aaae0502c" +dependencies = [ + "light-bounded-vec", + "light-concurrent-merkle-tree 4.0.1", + "light-hasher", + "light-merkle-tree-reference", + "num-bigint 0.4.6", + "num-traits", + "solana-program-error", + "thiserror 2.0.17", +] + [[package]] name = "light-indexed-merkle-tree" version = "5.0.0" @@ -2703,7 +2805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0824755289075f28de2820fc7d4ec4e6b9e99d404e033c07338b91cce8c71fb8" dependencies = [ "light-bounded-vec", - "light-concurrent-merkle-tree", + "light-concurrent-merkle-tree 5.0.0", "light-hasher", "light-merkle-tree-reference", "num-bigint 0.4.6", @@ -2725,16 +2827,32 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "light-merkle-tree-metadata" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6474045d3358e952f11a6cec44b9280ae127446a2b8246b3fdb29b83fda4e6b7" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "bytemuck", + "light-compressed-account 0.6.2", + "solana-msg", + "solana-program-error", + "solana-sysvar", + "thiserror 2.0.17", + "zerocopy", +] + [[package]] name = "light-merkle-tree-metadata" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9780fcd23afe4220857b0d71ef4823afd142ddc50469a8759423f19d81a33437" dependencies = [ - "anchor-lang", "borsh 0.10.4", "bytemuck", - "light-compressed-account", + "light-compressed-account 0.7.0", "solana-msg", "solana-program-error", "solana-sysvar", @@ -2801,9 +2919,9 @@ dependencies = [ [[package]] name = "light-program-test" -version = "0.17.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5587287e981f066159a27e6b1a668badba833825aee4d0d2618e3bdd90848df" +checksum = "4f15976055a0568499ef16d88a227fb6658bb87d08dfea030c352f7e2bf19fd7" dependencies = [ "anchor-lang", "async-trait", @@ -2812,19 +2930,17 @@ dependencies = [ "bs58", "bytemuck", "chrono", - "light-client", - "light-compressed-account", - "light-compressible-client", - "light-ctoken-sdk", - "light-event", + "light-client 0.16.0", + "light-compressed-account 0.6.2", + "light-event 0.1.1", "light-hasher", "light-indexed-array", - "light-indexed-merkle-tree", - "light-merkle-tree-metadata", + "light-indexed-merkle-tree 4.0.1", + "light-merkle-tree-metadata 0.6.0", "light-merkle-tree-reference", - "light-prover-client", - "light-sdk", - "light-sdk-types", + "light-prover-client 4.0.0", + "light-sdk 0.16.0", + "light-sdk-types 0.16.0", "light-zero-copy", "litesvm", "log", @@ -2850,6 +2966,29 @@ dependencies = [ "tokio", ] +[[package]] +name = "light-prover-client" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a48fb4f7f600b5afc8901d6de8a7ec1ad8ebcd3006d7c942aa1ecbf6fd8f9ffa" +dependencies = [ + "ark-bn254 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.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-prover-client" version = "5.0.1" @@ -2859,7 +2998,7 @@ dependencies = [ "ark-bn254 0.5.0", "ark-serialize 0.5.0", "ark-std 0.5.0", - "light-compressed-account", + "light-compressed-account 0.7.0", "light-hasher", "light-indexed-array", "light-sparse-merkle-tree", @@ -2874,22 +3013,46 @@ dependencies = [ "tracing", ] +[[package]] +name = "light-sdk" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f107abeb7d50496386dae58ed7c5760ff5be23dbfbd0e79fc0394ac257138cad" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "light-account-checks 0.5.1", + "light-compressed-account 0.6.2", + "light-hasher", + "light-macros", + "light-sdk-macros 0.16.0", + "light-sdk-types 0.16.0", + "light-zero-copy", + "num-bigint 0.4.6", + "solana-account-info", + "solana-cpi", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "thiserror 2.0.17", +] + [[package]] name = "light-sdk" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58d6105c9ca358c0c484d83cae451eb5f12c869e82bd0a70dc1fb79a11051c5e" dependencies = [ - "anchor-lang", "bincode", "borsh 0.10.4", - "light-account-checks", - "light-compressed-account", + "light-account-checks 0.6.0", + "light-compressed-account 0.7.0", "light-compressible", "light-hasher", "light-macros", - "light-sdk-macros", - "light-sdk-types", + "light-sdk-macros 0.17.1", + "light-sdk-types 0.17.1", "light-zero-copy", "num-bigint 0.4.6", "solana-account-info", @@ -2905,6 +3068,19 @@ dependencies = [ "thiserror 2.0.17", ] +[[package]] +name = "light-sdk-macros" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "369c561f47e6581a167f5c84a78c68711d9d45d9ad9d5de179423f4af3e3b1ea" +dependencies = [ + "light-hasher", + "proc-macro2", + "quote", + "solana-pubkey", + "syn 2.0.111", +] + [[package]] name = "light-sdk-macros" version = "0.17.1" @@ -2912,23 +3088,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d1574d5e077c0bf4cec6ab82fcd323265b45d0aa4f0493c01d726e8b8863f9" dependencies = [ "light-hasher", - "light-sdk-types", + "light-sdk-types 0.17.1", "proc-macro2", "quote", "solana-pubkey", "syn 2.0.111", ] +[[package]] +name = "light-sdk-types" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c524399f8d16e8833583ab9879f0cc7fa474424f261f1e54716e4a34dbfab5" +dependencies = [ + "anchor-lang", + "borsh 0.10.4", + "light-account-checks 0.5.1", + "light-compressed-account 0.6.2", + "light-hasher", + "light-macros", + "solana-msg", + "thiserror 2.0.17", +] + [[package]] name = "light-sdk-types" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d11611baf72ac9f728eb17857b01cc9a80919ff34631965c69be69b8d31c28e" dependencies = [ - "anchor-lang", "borsh 0.10.4", - "light-account-checks", - "light-compressed-account", + "light-account-checks 0.6.0", + "light-compressed-account 0.7.0", "light-hasher", "light-macros", "solana-msg", @@ -3570,7 +3761,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml 0.5.11", + "toml", ] [[package]] @@ -3579,7 +3770,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.23.9", + "toml_edit", ] [[package]] @@ -4255,15 +4446,6 @@ dependencies = [ "serde_core", ] -[[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" @@ -7754,27 +7936,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.3" @@ -7784,20 +7945,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.12.1", - "serde", - "serde_spanned", - "toml_datetime 0.6.11", - "toml_write", - "winnow", -] - [[package]] name = "toml_edit" version = "0.23.9" @@ -7805,7 +7952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" dependencies = [ "indexmap 2.12.1", - "toml_datetime 0.7.3", + "toml_datetime", "toml_parser", "winnow", ] @@ -7819,12 +7966,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.2" diff --git a/c-token/Cargo.toml b/c-token/Cargo.toml index 578b6ed..4dcba0a 100644 --- a/c-token/Cargo.toml +++ b/c-token/Cargo.toml @@ -52,7 +52,7 @@ borsh = "0.10.4" [dev-dependencies] # Light Protocol test dependencies -light-program-test = { version = "0.17.1", features = ["v2"] } +light-program-test = { version = "0.16.0", features = ["v2"] } light-client = "0.17.2" # Solana dependencies @@ -70,6 +70,9 @@ tokio = { version = "1.36", features = ["full"] } # Serialization serde_json = "1" +# Environment variables +dotenvy = "0.15" + [lints.rust.unexpected_cfgs] level = "allow" check-cfg = [ diff --git a/c-token/tests/client-close-ctoken.rs b/c-token/tests/client-close-ctoken.rs index f5e7d6d..da51993 100644 --- a/c-token/tests/client-close-ctoken.rs +++ b/c-token/tests/client-close-ctoken.rs @@ -24,10 +24,12 @@ async fn test_close_ctoken_account() { // Step 2: Create compressed mint (prerequisite) let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + // Step 3: Create cToken account with 0 balance let account = Keypair::new(); let owner = payer.pubkey(); + let create_instruction = CreateCTokenAccount::new( payer.pubkey(), account.pubkey(), @@ -45,6 +47,7 @@ async fn test_close_ctoken_account() { .await .unwrap(); + // Step 4: Verify account exists before closing let account_before_close = rpc.get_account(account.pubkey()).await.unwrap(); assert!( @@ -53,6 +56,10 @@ async fn test_close_ctoken_account() { ); let ctoken_state = CToken::deserialize(&mut &account_before_close.unwrap().data[..]).unwrap(); + println!("\ncToken account state before closing:"); + println!(" Mint: {:?}", ctoken_state.mint); + println!(" Owner: {:?}", ctoken_state.owner); + println!(" Amount: {}", ctoken_state.amount); assert_eq!(ctoken_state.amount, 0, "Account balance must be 0 to close"); // Step 5: Build close instruction using SDK builder @@ -66,10 +73,12 @@ async fn test_close_ctoken_account() { .unwrap(); // Step 6: Send close transaction - rpc.create_and_send_transaction(&[close_instruction], &payer.pubkey(), &[&payer]) + let close_tx_sig = rpc.create_and_send_transaction(&[close_instruction], &payer.pubkey(), &[&payer]) .await .unwrap(); + println!("\nClose transaction: {}", close_tx_sig); + // Step 7: Verify account is closed let account_after_close = rpc.get_account(account.pubkey()).await.unwrap(); assert!( diff --git a/c-token/tests/client-create-cmint.rs b/c-token/tests/client-create-cmint.rs index acee3ed..540e0ae 100644 --- a/c-token/tests/client-create-cmint.rs +++ b/c-token/tests/client-create-cmint.rs @@ -18,7 +18,7 @@ async fn test_create_rent_free_mint_with_metadata() { let payer = rpc.get_payer().insecure_clone(); - // Create c-int with metadata + // Create c-mint with metadata let (_mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; } diff --git a/c-token/tests/devnet-client-create-cmint.rs b/c-token/tests/devnet-client-create-cmint.rs new file mode 100644 index 0000000..c2f4272 --- /dev/null +++ b/c-token/tests/devnet-client-create-cmint.rs @@ -0,0 +1,148 @@ +// Test for: client-create-cmint.mdx + +use light_client::indexer::{AddressWithTree, Indexer}; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; +use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams}; +use light_ctoken_interface::instructions::extensions::token_metadata::TokenMetadataInstructionData; +use light_ctoken_interface::instructions::extensions::ExtensionInstructionData; +use light_ctoken_interface::state::AdditionalMetadata; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; +use std::env; +use std::fs; +use serde_json; +use std::convert::TryFrom; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_create_rent_free_mint_with_metadata() { + // Load environment variables from .env file + dotenvy::dotenv().ok(); + + // Initialize LightClient on devnet with Photon indexer + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + + // Get Helius API key from environment + let helius_api_key = env::var("HELIUS_API_KEY") + .expect("HELIUS_API_KEY environment variable must be set. Create a .env file or set it in your environment."); + + let photon_base = "https://devnet.helius-rpc.com".to_string(); + let config = LightClientConfig::devnet(Some(photon_base), Some(helius_api_key)); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to initialize LightClient"); + + // Create c-mint with metadata + let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + + println!("Created compressed mint: {}", mint); + +} +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + // Ensure state trees are fetched, then pick a valid one via helper + let _ = rpc.get_latest_active_state_trees().await; + let output_pubkey = match rpc + .get_random_state_tree_info() + .ok() + .or_else(|| rpc.get_random_state_tree_info_v1().ok()) + { + Some(info) => info + .get_output_pubkey() + .expect("Invalid state tree type for output"), + None => { + let queues = rpc + .indexer_mut() + .expect("IndexerNotInitialized") + .get_queue_info(None) + .await + .expect("Failed to fetch queue info") + .value + .queues; + queues + .get(0) + .map(|q| q.queue) + .expect("NoStateTreesAvailable: no active state trees returned") + } + }; + + // Derive address + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = + light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params with token metadata + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: Some(vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some(payer.pubkey().to_bytes().into()), + name: b"Rent Free Token".to_vec(), + symbol: b"RFT".to_vec(), + uri: b"https://example.com/metadata.json".to_vec(), + additional_metadata: Some(vec![AdditionalMetadata { + key: b"type".to_vec(), + value: b"compressed".to_vec(), + }]), + }, + )]), + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_pubkey, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} + +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::try_from(&bytes[..])?) +} From 4d57e7a3f21d43f17f4c704310060055076092d5 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Thu, 11 Dec 2025 19:50:28 +0000 Subject: [PATCH 06/11] Rename c-token to light-token directory --- {c-token => light-token}/.gitignore | 0 {c-token => light-token}/Cargo.lock | 765 +++-- {c-token => light-token}/Cargo.toml | 28 +- {c-token => light-token}/README.md | 0 light-token/package-lock.json | 2529 +++++++++++++++++ light-token/package.json | 28 + .../programs}/src/close.rs | 0 .../programs}/src/create_ata2.rs | 0 .../programs}/src/create_cmint.rs | 0 .../programs}/src/create_token_account.rs | 0 {c-token => light-token/programs}/src/lib.rs | 0 .../programs}/src/mint_to_ctoken.rs | 0 .../programs}/src/transfer.rs | 0 .../programs}/src/transfer_interface.rs | 0 .../programs}/src/transfer_spl_ctoken.rs | 0 .../programs}/tests/client-close-ctoken.rs | 0 .../programs}/tests/client-create-cata.rs | 0 .../programs}/tests/client-create-cmint.rs | 0 .../programs}/tests/client-create-ctoken.rs | 0 .../programs}/tests/client-mint-to-ctoken.rs | 0 .../tests/client-transfer-interface.rs | 0 .../tests/devnet-client-create-mint.rs | 23 +- .../tests/devnet-client-mint-to-ctoken.rs | 278 ++ .../tests/devnet-spl-ctoken-transfer.rs | 0 .../tests/create-ata-interface.test.ts | 674 +++++ light-token/tests/create-mint.test.ts | 112 + light-token/tests/mint-to.test.ts | 214 ++ light-token/tests/transfer-interface.test.ts | 527 ++++ light-token/tsconfig.json | 15 + light-token/vitest.config.ts | 10 + 30 files changed, 4886 insertions(+), 317 deletions(-) rename {c-token => light-token}/.gitignore (100%) rename {c-token => light-token}/Cargo.lock (95%) rename {c-token => light-token}/Cargo.toml (59%) rename {c-token => light-token}/README.md (100%) create mode 100644 light-token/package-lock.json create mode 100644 light-token/package.json rename {c-token => light-token/programs}/src/close.rs (100%) rename {c-token => light-token/programs}/src/create_ata2.rs (100%) rename {c-token => light-token/programs}/src/create_cmint.rs (100%) rename {c-token => light-token/programs}/src/create_token_account.rs (100%) rename {c-token => light-token/programs}/src/lib.rs (100%) rename {c-token => light-token/programs}/src/mint_to_ctoken.rs (100%) rename {c-token => light-token/programs}/src/transfer.rs (100%) rename {c-token => light-token/programs}/src/transfer_interface.rs (100%) rename {c-token => light-token/programs}/src/transfer_spl_ctoken.rs (100%) rename {c-token => light-token/programs}/tests/client-close-ctoken.rs (100%) rename {c-token => light-token/programs}/tests/client-create-cata.rs (100%) rename {c-token => light-token/programs}/tests/client-create-cmint.rs (100%) rename {c-token => light-token/programs}/tests/client-create-ctoken.rs (100%) rename {c-token => light-token/programs}/tests/client-mint-to-ctoken.rs (100%) rename {c-token => light-token/programs}/tests/client-transfer-interface.rs (100%) rename c-token/tests/devnet-client-create-cmint.rs => light-token/programs/tests/devnet-client-create-mint.rs (88%) create mode 100644 light-token/programs/tests/devnet-client-mint-to-ctoken.rs rename {c-token => light-token/programs}/tests/devnet-spl-ctoken-transfer.rs (100%) create mode 100644 light-token/tests/create-ata-interface.test.ts create mode 100644 light-token/tests/create-mint.test.ts create mode 100644 light-token/tests/mint-to.test.ts create mode 100644 light-token/tests/transfer-interface.test.ts create mode 100644 light-token/tsconfig.json create mode 100644 light-token/vitest.config.ts diff --git a/c-token/.gitignore b/light-token/.gitignore similarity index 100% rename from c-token/.gitignore rename to light-token/.gitignore diff --git a/c-token/Cargo.lock b/light-token/Cargo.lock similarity index 95% rename from c-token/Cargo.lock rename to light-token/Cargo.lock index 2be67ae..0f5c4c4 100644 --- a/c-token/Cargo.lock +++ b/light-token/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-ctoken-interface", + "light-hasher", + "light-heap", + "light-system-program-anchor", + "light-zero-copy", + "pinocchio-pubkey", + "solana-sdk", + "solana-security-txt", + "spl-token 7.0.0", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "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", @@ -725,6 +770,18 @@ 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.8.2" @@ -916,20 +973,30 @@ dependencies = [ "anchor-spl", "borsh 0.10.4", "dotenvy", - "light-client 0.17.2", + "light-client", "light-ctoken-interface", "light-ctoken-sdk", "light-program-test", - "light-sdk 0.17.1", + "light-sdk", "serde_json", "solana-program", "solana-sdk", "spl-pod", "spl-token 7.0.0", - "spl-token-2022 7.0.0", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio", ] +[[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.49" @@ -1572,6 +1639,12 @@ 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" @@ -1721,6 +1794,21 @@ dependencies = [ "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" @@ -2416,10 +2504,9 @@ dependencies = [ [[package]] name = "light-account-checks" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e70bd1a384bff312860d4b60a0ccd814c36b88ce91966192dd88a35e595f7a2" +version = "0.6.0" dependencies = [ + "pinocchio", "solana-account-info", "solana-msg", "solana-program-error", @@ -2429,26 +2516,44 @@ dependencies = [ ] [[package]] -name = "light-account-checks" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0785da22cd4a7667583141ca56c790a5c8afa2b22ad2a08204d78881035524e8" +name = "light-array-map" +version = "0.1.1" dependencies = [ + "tinyvec", +] + +[[package]] +name = "light-batched-merkle-tree" +version = "0.7.0" +dependencies = [ + "aligned-sized", + "borsh 0.10.4", + "light-account-checks", + "light-bloom-filter", + "light-compressed-account", + "light-hasher", + "light-macros", + "light-merkle-tree-metadata", + "light-verifier", + "light-zero-copy", "solana-account-info", "solana-msg", "solana-program-error", "solana-pubkey", "solana-sysvar", "thiserror 2.0.17", + "zerocopy", ] [[package]] -name = "light-array-map" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859dc5b406a8bf0b114f686e6f2e36d0e939bad6f579492a520d309b52fde1f8" +name = "light-bloom-filter" +version = "0.5.0" dependencies = [ - "tinyvec", + "bitvec", + "num-bigint 0.4.6", + "solana-nostd-keccak", + "solana-program-error", + "thiserror 2.0.17", ] [[package]] @@ -2463,81 +2568,32 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "light-client" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cacf890dd9e27be63334f1fa4495eaa0feb7f212133833d472ee39102bd62" -dependencies = [ - "async-trait", - "base64 0.13.1", - "borsh 0.10.4", - "bs58", - "bytemuck", - "lazy_static", - "light-compressed-account 0.6.2", - "light-concurrent-merkle-tree 4.0.1", - "light-event 0.1.1", - "light-hasher", - "light-indexed-merkle-tree 4.0.1", - "light-merkle-tree-metadata 0.6.0", - "light-prover-client 4.0.0", - "light-sdk 0.16.0", - "litesvm", - "num-bigint 0.4.6", - "num-traits", - "photon-api 0.52.0", - "rand 0.8.5", - "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-epoch-info", - "solana-hash", - "solana-instruction", - "solana-keypair", - "solana-program-error", - "solana-pubkey", - "solana-rpc-client", - "solana-rpc-client-api", - "solana-signature", - "solana-transaction", - "solana-transaction-error", - "solana-transaction-status-client-types", - "thiserror 2.0.17", - "tokio", - "tracing", -] - [[package]] name = "light-client" version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65a2574dca16e7983d8ca0f40cb2969bf24de288dc187bb827beae64008f8ad" dependencies = [ "async-trait", "base64 0.13.1", "borsh 0.10.4", "bs58", "lazy_static", - "light-compressed-account 0.7.0", - "light-concurrent-merkle-tree 5.0.0", + "light-compressed-account", + "light-concurrent-merkle-tree", "light-ctoken-sdk", - "light-event 0.2.1", + "light-event", "light-hasher", - "light-indexed-merkle-tree 5.0.0", - "light-merkle-tree-metadata 0.7.0", - "light-prover-client 5.0.1", - "light-sdk 0.17.1", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", + "light-prover-client", + "light-sdk", + "litesvm", "num-bigint 0.4.6", - "photon-api 0.53.0", + "photon-api", "rand 0.8.5", "solana-account", "solana-account-decoder-client-types", "solana-address-lookup-table-interface", + "solana-banks-client", "solana-clock", "solana-commitment-config", "solana-compute-budget-interface", @@ -2560,9 +2616,7 @@ dependencies = [ [[package]] name = "light-compressed-account" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9cecda1680283ecba0f8ef64073d36998f057ac5aa96569dc8e74d6a37a3a2" +version = "0.7.0" dependencies = [ "anchor-lang", "borsh 0.10.4", @@ -2572,6 +2626,7 @@ dependencies = [ "light-poseidon 0.3.0", "light-program-profiler", "light-zero-copy", + "pinocchio", "solana-msg", "solana-program-error", "solana-pubkey", @@ -2581,23 +2636,38 @@ dependencies = [ ] [[package]] -name = "light-compressed-account" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058df2733fa6a3e4bda6f162a6c5d41f10fc8c6f6ddb992af1de76b60214e4a6" +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-ctoken-interface", "light-hasher", - "light-macros", - "light-poseidon 0.3.0", + "light-heap", "light-program-profiler", + "light-sdk", + "light-sdk-pinocchio", + "light-sdk-types", + "light-system-program-anchor", "light-zero-copy", "pinocchio", - "solana-msg", - "solana-program-error", + "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 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-2022 7.0.0 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", "tinyvec", "zerocopy", ] @@ -2605,14 +2675,13 @@ dependencies = [ [[package]] name = "light-compressible" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3648e2cd17ed29c72fefd95c099c9673a289e7ce1fd9b76f7f16cc1e5ddaf97" dependencies = [ "aligned-sized", + "anchor-lang", "borsh 0.10.4", "bytemuck", - "light-account-checks 0.6.0", - "light-compressed-account 0.7.0", + "light-account-checks", + "light-compressed-account", "light-hasher", "light-macros", "light-program-profiler", @@ -2628,24 +2697,22 @@ dependencies = [ ] [[package]] -name = "light-concurrent-merkle-tree" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0123e37a6796ca82cca864f00f160cf73652deac17a3e625007f184f7e95e62b" +name = "light-compressible-client" +version = "0.17.1" dependencies = [ + "anchor-lang", "borsh 0.10.4", - "light-bounded-vec", - "light-hasher", - "memoffset", - "solana-program-error", + "light-client", + "light-sdk", + "solana-account", + "solana-instruction", + "solana-pubkey", "thiserror 2.0.17", ] [[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", @@ -2658,14 +2725,13 @@ dependencies = [ [[package]] name = "light-ctoken-interface" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b692874fd2d7439225b664375b839c3e8b1538829558f85910bfd853cd91e4df" dependencies = [ "aligned-sized", + "anchor-lang", "borsh 0.10.4", "bytemuck", "light-array-map", - "light-compressed-account 0.7.0", + "light-compressed-account", "light-compressible", "light-hasher", "light-macros", @@ -2676,7 +2742,7 @@ dependencies = [ "solana-account-info", "solana-pubkey", "spl-pod", - "spl-token-2022 7.0.0", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 2.0.17", "tinyvec", "zerocopy", @@ -2685,20 +2751,18 @@ dependencies = [ [[package]] name = "light-ctoken-sdk" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda77f9130dfbbb5800988f41a87bb74b8f59854ab62629565e5b818b0352a6f" dependencies = [ "arrayvec", "borsh 0.10.4", - "light-account-checks 0.6.0", - "light-compressed-account 0.7.0", + "light-account-checks", + "light-compressed-account", "light-compressible", "light-ctoken-interface", "light-ctoken-types", "light-macros", "light-program-profiler", - "light-sdk 0.17.1", - "light-sdk-types 0.17.1", + "light-sdk", + "light-sdk-types", "light-zero-copy", "solana-account-info", "solana-cpi", @@ -2707,56 +2771,48 @@ dependencies = [ "solana-program-error", "solana-pubkey", "spl-pod", - "spl-token-2022 7.0.0", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 2.0.17", ] [[package]] name = "light-ctoken-types" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d7facfbde56b67693061f12572792ff142e0eef4d20f7153ceb5401934f1aac" dependencies = [ "borsh 0.10.4", - "light-account-checks 0.6.0", - "light-compressed-account 0.7.0", + "light-account-checks", + "light-compressed-account", "light-macros", - "light-sdk-types 0.17.1", + "light-sdk-types", "solana-msg", "thiserror 2.0.17", ] [[package]] name = "light-event" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "554228ce821d9c3b789f1c675f79663fe3872c77a3527e1e20e5f2f268eeb02d" +version = "0.2.1" dependencies = [ "borsh 0.10.4", - "light-compressed-account 0.6.2", + "light-compressed-account", "light-hasher", "light-zero-copy", "thiserror 2.0.17", ] [[package]] -name = "light-event" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9032317e17599cfdefac76b8f44563b535afc6401ca1539a752937ea2dd5b63" +name = "light-hash-set" +version = "4.0.0" dependencies = [ - "borsh 0.10.4", - "light-compressed-account 0.7.0", "light-hasher", - "light-zero-copy", + "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", @@ -2771,41 +2827,28 @@ dependencies = [ ] [[package]] -name = "light-indexed-array" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f14f984030d86b6f07bd8f5ae04e2c40fcd0c3bdfcc7a291fff1ed59c9e6554" +name = "light-heap" +version = "2.0.0" dependencies = [ - "light-hasher", - "num-bigint 0.4.6", - "num-traits", - "thiserror 2.0.17", + "anchor-lang", ] [[package]] -name = "light-indexed-merkle-tree" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b717eb0e72d96490c294f05fa9fbcc9a83253a1a0f8932de2fcad1aaae0502c" +name = "light-indexed-array" +version = "0.3.0" dependencies = [ - "light-bounded-vec", - "light-concurrent-merkle-tree 4.0.1", "light-hasher", - "light-merkle-tree-reference", "num-bigint 0.4.6", "num-traits", - "solana-program-error", "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 5.0.0", + "light-concurrent-merkle-tree", "light-hasher", "light-merkle-tree-reference", "num-bigint 0.4.6", @@ -2817,8 +2860,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", @@ -2827,32 +2868,14 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "light-merkle-tree-metadata" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6474045d3358e952f11a6cec44b9280ae127446a2b8246b3fdb29b83fda4e6b7" -dependencies = [ - "anchor-lang", - "borsh 0.10.4", - "bytemuck", - "light-compressed-account 0.6.2", - "solana-msg", - "solana-program-error", - "solana-sysvar", - "thiserror 2.0.17", - "zerocopy", -] - [[package]] name = "light-merkle-tree-metadata" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9780fcd23afe4220857b0d71ef4823afd142ddc50469a8759423f19d81a33437" dependencies = [ + "anchor-lang", "borsh 0.10.4", "bytemuck", - "light-compressed-account 0.7.0", + "light-compressed-account", "solana-msg", "solana-program-error", "solana-sysvar", @@ -2863,8 +2886,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", @@ -2919,10 +2940,9 @@ dependencies = [ [[package]] name = "light-program-test" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f15976055a0568499ef16d88a227fb6658bb87d08dfea030c352f7e2bf19fd7" +version = "0.17.1" dependencies = [ + "account-compression", "anchor-lang", "async-trait", "base64 0.22.1", @@ -2930,23 +2950,31 @@ dependencies = [ "bs58", "bytemuck", "chrono", - "light-client 0.16.0", - "light-compressed-account 0.6.2", - "light-event 0.1.1", + "light-batched-merkle-tree", + "light-client", + "light-compressed-account", + "light-compressed-token", + "light-compressible", + "light-compressible-client", + "light-concurrent-merkle-tree", + "light-ctoken-interface", + "light-ctoken-sdk", + "light-event", "light-hasher", "light-indexed-array", - "light-indexed-merkle-tree 4.0.1", - "light-merkle-tree-metadata 0.6.0", + "light-indexed-merkle-tree", + "light-merkle-tree-metadata", "light-merkle-tree-reference", - "light-prover-client 4.0.0", - "light-sdk 0.16.0", - "light-sdk-types 0.16.0", + "light-prover-client", + "light-registry", + "light-sdk", + "light-sdk-types", "light-zero-copy", "litesvm", "log", "num-bigint 0.4.6", "num-traits", - "photon-api 0.52.0", + "photon-api", "rand 0.8.5", "reqwest 0.12.24", "serde", @@ -2961,44 +2989,19 @@ dependencies = [ "solana-transaction", "solana-transaction-status", "solana-transaction-status-client-types", - "spl-token-2022 7.0.0", + "spl-token-2022 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tabled", "tokio", ] -[[package]] -name = "light-prover-client" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a48fb4f7f600b5afc8901d6de8a7ec1ad8ebcd3006d7c942aa1ecbf6fd8f9ffa" -dependencies = [ - "ark-bn254 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.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-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", @@ -3014,45 +3017,43 @@ dependencies = [ ] [[package]] -name = "light-sdk" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f107abeb7d50496386dae58ed7c5760ff5be23dbfbd0e79fc0394ac257138cad" +name = "light-registry" +version = "2.1.0" dependencies = [ + "account-compression", + "aligned-sized", "anchor-lang", "borsh 0.10.4", - "light-account-checks 0.5.1", - "light-compressed-account 0.6.2", - "light-hasher", + "light-account-checks", + "light-batched-merkle-tree", + "light-compressible", + "light-ctoken-interface", "light-macros", - "light-sdk-macros 0.16.0", - "light-sdk-types 0.16.0", - "light-zero-copy", - "num-bigint 0.4.6", + "light-merkle-tree-metadata", + "light-program-profiler", + "light-system-program-anchor", "solana-account-info", - "solana-cpi", "solana-instruction", - "solana-msg", - "solana-program-error", "solana-pubkey", - "thiserror 2.0.17", + "solana-sdk", + "solana-security-txt", + "spl-pod", ] [[package]] name = "light-sdk" version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d6105c9ca358c0c484d83cae451eb5f12c869e82bd0a70dc1fb79a11051c5e" dependencies = [ + "anchor-lang", "bincode", "borsh 0.10.4", - "light-account-checks 0.6.0", - "light-compressed-account 0.7.0", + "light-account-checks", + "light-compressed-account", "light-compressible", "light-hasher", "light-macros", - "light-sdk-macros 0.17.1", - "light-sdk-types 0.17.1", + "light-sdk-macros", + "light-sdk-types", "light-zero-copy", "num-bigint 0.4.6", "solana-account-info", @@ -3068,27 +3069,12 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "light-sdk-macros" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "369c561f47e6581a167f5c84a78c68711d9d45d9ad9d5de179423f4af3e3b1ea" -dependencies = [ - "light-hasher", - "proc-macro2", - "quote", - "solana-pubkey", - "syn 2.0.111", -] - [[package]] name = "light-sdk-macros" version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d1574d5e077c0bf4cec6ab82fcd323265b45d0aa4f0493c01d726e8b8863f9" dependencies = [ "light-hasher", - "light-sdk-types 0.17.1", + "light-sdk-types", "proc-macro2", "quote", "solana-pubkey", @@ -3096,30 +3082,28 @@ dependencies = [ ] [[package]] -name = "light-sdk-types" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c524399f8d16e8833583ab9879f0cc7fa474424f261f1e54716e4a34dbfab5" +name = "light-sdk-pinocchio" +version = "0.17.1" dependencies = [ - "anchor-lang", "borsh 0.10.4", - "light-account-checks 0.5.1", - "light-compressed-account 0.6.2", + "light-account-checks", + "light-compressed-account", "light-hasher", "light-macros", - "solana-msg", + "light-sdk-macros", + "light-sdk-types", + "pinocchio", "thiserror 2.0.17", ] [[package]] name = "light-sdk-types" version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d11611baf72ac9f728eb17857b01cc9a80919ff34631965c69be69b8d31c28e" dependencies = [ + "anchor-lang", "borsh 0.10.4", - "light-account-checks 0.6.0", - "light-compressed-account 0.7.0", + "light-account-checks", + "light-compressed-account", "light-hasher", "light-macros", "solana-msg", @@ -3129,8 +3113,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", @@ -3139,21 +3121,39 @@ 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-verifier" +version = "6.0.0" +dependencies = [ + "groth16-solana", + "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", + "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", @@ -3628,26 +3628,9 @@ dependencies = [ "num", ] -[[package]] -name = "photon-api" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503b549aede7d9f35752046b9a32d8dfc1c7acec3c304a012c8b3134d5b98e37" -dependencies = [ - "reqwest 0.12.24", - "serde", - "serde_derive", - "serde_json", - "serde_with", - "url", - "uuid", -] - [[package]] name = "photon-api" version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5286d477f39ef56635e3175cd22030233c76f1ced2d6dec632d105c54cc94543" dependencies = [ "reqwest 0.12.24", "serde", @@ -3696,6 +3679,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" @@ -3707,6 +3696,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=38d8634353e5eeb8c015d364df0eaa39f5c48b05#38d8634353e5eeb8c015d364df0eaa39f5c48b05" +dependencies = [ + "pinocchio", + "pinocchio-pubkey", +] + +[[package]] +name = "pinocchio-token-program" +version = "0.1.0" +source = "git+https://github.com/Lightprotocol/token?rev=38d8634353e5eeb8c015d364df0eaa39f5c48b05#38d8634353e5eeb8c015d364df0eaa39f5c48b05" +dependencies = [ + "pinocchio", + "pinocchio-log", + "pinocchio-token-interface", +] + [[package]] name = "pkg-config" version = "0.3.32" @@ -3761,7 +3779,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml", + "toml 0.5.11", ] [[package]] @@ -3770,7 +3788,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit", + "toml_edit 0.23.9", ] [[package]] @@ -3894,6 +3912,12 @@ 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" @@ -4446,6 +4470,15 @@ dependencies = [ "serde_core", ] +[[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" @@ -5581,6 +5614,15 @@ dependencies = [ "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" @@ -6950,7 +6992,19 @@ dependencies = [ "solana-program", "solana-zk-sdk", "spl-pod", - "spl-token-confidential-transfer-proof-extraction 0.2.1", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spl-elgamal-registry" +version = "0.1.1" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +dependencies = [ + "bytemuck", + "solana-program", + "solana-zk-sdk", + "spl-pod", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", ] [[package]] @@ -7173,12 +7227,12 @@ dependencies = [ "solana-program", "solana-security-txt", "solana-zk-sdk", - "spl-elgamal-registry 0.1.1", + "spl-elgamal-registry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "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-ciphertext-arithmetic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "spl-token-confidential-transfer-proof-generation 0.2.0", "spl-token-group-interface 0.5.0", "spl-token-metadata-interface 0.6.0", @@ -7201,13 +7255,40 @@ dependencies = [ "solana-program", "solana-security-txt", "solana-zk-sdk", - "spl-elgamal-registry 0.1.1", + "spl-elgamal-registry 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-memo", + "spl-pod", + "spl-token 7.0.0", + "spl-token-confidential-transfer-ciphertext-arithmetic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spl-token-confidential-transfer-proof-generation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "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 = "7.0.0" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-program", + "solana-security-txt", + "solana-zk-sdk", + "spl-elgamal-registry 0.1.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", "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-confidential-transfer-ciphertext-arithmetic 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "spl-token-confidential-transfer-proof-extraction 0.2.1 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", + "spl-token-confidential-transfer-proof-generation 0.3.0 (git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf)", "spl-token-group-interface 0.5.0", "spl-token-metadata-interface 0.6.0", "spl-transfer-hook-interface 0.9.0", @@ -7271,6 +7352,17 @@ dependencies = [ "solana-zk-sdk", ] +[[package]] +name = "spl-token-confidential-transfer-ciphertext-arithmetic" +version = "0.2.1" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +dependencies = [ + "base64 0.22.1", + "bytemuck", + "solana-curve25519", + "solana-zk-sdk", +] + [[package]] name = "spl-token-confidential-transfer-ciphertext-arithmetic" version = "0.3.1" @@ -7297,6 +7389,19 @@ dependencies = [ "thiserror 2.0.17", ] +[[package]] +name = "spl-token-confidential-transfer-proof-extraction" +version = "0.2.1" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +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" @@ -7339,6 +7444,16 @@ dependencies = [ "thiserror 2.0.17", ] +[[package]] +name = "spl-token-confidential-transfer-proof-generation" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/token-2022?rev=06d12f50a06db25d73857d253b9a82857d6f4cdf#06d12f50a06db25d73857d253b9a82857d6f4cdf" +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" @@ -7654,6 +7769,12 @@ dependencies = [ "syn 2.0.111", ] +[[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" @@ -7936,6 +8057,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.3" @@ -7945,6 +8087,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.12.1", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + [[package]] name = "toml_edit" version = "0.23.9" @@ -7952,7 +8108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" dependencies = [ "indexmap 2.12.1", - "toml_datetime", + "toml_datetime 0.7.3", "toml_parser", "winnow", ] @@ -7966,6 +8122,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.2" @@ -8679,6 +8841,15 @@ 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" diff --git a/c-token/Cargo.toml b/light-token/Cargo.toml similarity index 59% rename from c-token/Cargo.toml rename to light-token/Cargo.toml index 4dcba0a..cdc9f87 100644 --- a/c-token/Cargo.toml +++ b/light-token/Cargo.toml @@ -9,34 +9,39 @@ edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "c_token_examples" +path = "programs/src/lib.rs" [[test]] name = "client-create-cmint" -path = "tests/client-create-cmint.rs" +path = "programs/tests/client-create-cmint.rs" [[test]] name = "client-create-ctoken" -path = "tests/client-create-ctoken.rs" +path = "programs/tests/client-create-ctoken.rs" [[test]] name = "client-create-cata" -path = "tests/client-create-cata.rs" +path = "programs/tests/client-create-cata.rs" [[test]] name = "client-mint-to-ctoken" -path = "tests/client-mint-to-ctoken.rs" +path = "programs/tests/client-mint-to-ctoken.rs" [[test]] name = "client-close-ctoken" -path = "tests/client-close-ctoken.rs" +path = "programs/tests/client-close-ctoken.rs" [[test]] name = "client-transfer-interface" -path = "tests/client-transfer-interface.rs" +path = "programs/tests/client-transfer-interface.rs" [[test]] name = "devnet-spl-ctoken-transfer" -path = "tests/devnet-spl-ctoken-transfer.rs" +path = "programs/tests/devnet-spl-ctoken-transfer.rs" + +[[test]] +name = "devnet-client-create-mint" +path = "programs/tests/devnet-client-create-mint.rs" [dependencies] # Light Protocol SDK dependencies @@ -52,7 +57,7 @@ borsh = "0.10.4" [dev-dependencies] # Light Protocol test dependencies -light-program-test = { version = "0.16.0", features = ["v2"] } +light-program-test = { version = "0.17.1", features = ["v2", "devenv"] } light-client = "0.17.2" # Solana dependencies @@ -79,3 +84,10 @@ check-cfg = [ 'cfg(target_os, values("solana"))', 'cfg(feature, values("frozen-abi", "no-entrypoint"))', ] + +[patch.crates-io] +light-ctoken-sdk = { path = "../../light-protocol/sdk-libs/ctoken-sdk" } +light-ctoken-interface = { path = "../../light-protocol/program-libs/ctoken-interface" } +light-sdk = { path = "../../light-protocol/sdk-libs/sdk" } +light-program-test = { path = "../../light-protocol/sdk-libs/program-test" } +light-client = { path = "../../light-protocol/sdk-libs/client" } diff --git a/c-token/README.md b/light-token/README.md similarity index 100% rename from c-token/README.md rename to light-token/README.md diff --git a/light-token/package-lock.json b/light-token/package-lock.json new file mode 100644 index 0000000..9b097c7 --- /dev/null +++ b/light-token/package-lock.json @@ -0,0 +1,2529 @@ +{ + "name": "c-token-tests", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "c-token-tests", + "version": "1.0.0", + "dependencies": { + "@lightprotocol/compressed-token": "file:../../light-protocol/js/compressed-token", + "@lightprotocol/hasher.rs": "file:../../light-protocol/js/hasher.rs", + "@lightprotocol/stateless.js": "file:../../light-protocol/js/stateless.js", + "@solana/spl-token": "0.4.8", + "@solana/web3.js": "1.98.4" + }, + "devDependencies": { + "@coral-xyz/borsh": "^0.29.0", + "@types/bn.js": "^5.1.5", + "@types/node": "^22.5.5", + "bn.js": "^5.2.1", + "typescript": "^5.6.2", + "vitest": "^2.1.1" + } + }, + "../../light-protocol/js/compressed-token": { + "name": "@lightprotocol/compressed-token", + "version": "0.22.1-alpha.2", + "license": "Apache-2.0", + "dependencies": { + "@solana/buffer-layout": "^4.0.1", + "@solana/buffer-layout-utils": "^0.2.0", + "bn.js": "^5.2.1", + "buffer": "6.0.3" + }, + "devDependencies": { + "@coral-xyz/anchor": "^0.29.0", + "@esbuild-plugins/node-globals-polyfill": "^0.2.3", + "@eslint/js": "9.36.0", + "@lightprotocol/hasher.rs": "0.2.1", + "@rollup/plugin-alias": "^5.1.0", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-commonjs": "^26.0.1", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.7", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^11.1.6", + "@solana/spl-token": "0.4.8", + "@solana/web3.js": "1.98.4", + "@types/bn.js": "^5.1.5", + "@types/node": "^22.5.5", + "@typescript-eslint/eslint-plugin": "^8.44.0", + "@typescript-eslint/parser": "^8.44.0", + "add": "^2.0.6", + "crypto-browserify": "^3.12.0", + "eslint": "^9.36.0", + "eslint-plugin-import": "^2.30.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-promise": "^7.1.0", + "eslint-plugin-vitest": "^0.5.4", + "prettier": "^3.3.3", + "rimraf": "^6.0.1", + "rollup": "^4.21.3", + "rollup-plugin-copy": "^3.5.0", + "rollup-plugin-dts": "^6.1.1", + "rollup-plugin-polyfill-node": "^0.13.0", + "rollup-plugin-visualizer": "^5.12.0", + "ts-node": "^10.9.2", + "tslib": "^2.7.0", + "typescript": "^5.6.2", + "vitest": "^2.1.1" + }, + "peerDependencies": { + "@coral-xyz/borsh": "^0.29.0", + "@lightprotocol/stateless.js": "workspace:*", + "@solana/spl-token": ">=0.3.9", + "@solana/web3.js": ">=1.73.5" + } + }, + "../../light-protocol/js/hasher.rs": {}, + "../../light-protocol/js/stateless.js": { + "name": "@lightprotocol/stateless.js", + "version": "0.22.1-alpha.1", + "license": "Apache-2.0", + "dependencies": { + "@coral-xyz/borsh": "^0.29.0", + "@noble/hashes": "1.5.0", + "bn.js": "^5.2.1", + "bs58": "^6.0.0", + "buffer": "6.0.3", + "buffer-layout": "^1.2.2", + "camelcase": "^8.0.0", + "camelcase-keys": "^9.1.3", + "superstruct": "2.0.2" + }, + "devDependencies": { + "@coral-xyz/anchor": "^0.29.0", + "@coral-xyz/borsh": "^0.29.0", + "@esbuild-plugins/node-globals-polyfill": "^0.2.3", + "@eslint/js": "9.36.0", + "@lightprotocol/hasher.rs": "0.2.1", + "@playwright/test": "^1.47.1", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-commonjs": "^26.0.1", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-replace": "^5.0.7", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^11.1.6", + "@solana/web3.js": "1.98.4", + "@types/bn.js": "^5.1.5", + "@types/node": "^22.5.5", + "@typescript-eslint/eslint-plugin": "^8.44.0", + "@typescript-eslint/parser": "^8.44.0", + "eslint": "^9.36.0", + "eslint-plugin-n": "^17.10.2", + "eslint-plugin-promise": "^7.1.0", + "eslint-plugin-vitest": "^0.5.4", + "http-server": "^14.1.1", + "playwright": "^1.47.1", + "prettier": "^3.3.3", + "rimraf": "^6.0.1", + "rollup": "^4.21.3", + "rollup-plugin-dts": "^6.1.1", + "rollup-plugin-polyfill-node": "^0.13.0", + "ts-node": "^10.9.2", + "tslib": "^2.7.0", + "tweetnacl": "1.0.3", + "typescript": "^5.6.2", + "vitest": "^2.1.1" + }, + "peerDependencies": { + "@solana/web3.js": ">=1.73.5" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@coral-xyz/borsh": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.29.0.tgz", + "integrity": "sha512-s7VFVa3a0oqpkuRloWVPdCK7hMbAMY270geZOGfCnaqexrP5dTIpbEHL33req6IYPPJ0hYa71cdvJ1h6V55/oQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bn.js": "^5.1.2", + "buffer-layout": "^1.2.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@solana/web3.js": "^1.68.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@lightprotocol/compressed-token": { + "resolved": "../../light-protocol/js/compressed-token", + "link": true + }, + "node_modules/@lightprotocol/hasher.rs": { + "resolved": "../../light-protocol/js/hasher.rs", + "link": true + }, + "node_modules/@lightprotocol/stateless.js": { + "resolved": "../../light-protocol/js/stateless.js", + "link": true + }, + "node_modules/@noble/curves": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz", + "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.3.tgz", + "integrity": "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.3.tgz", + "integrity": "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.3.tgz", + "integrity": "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.3.tgz", + "integrity": "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.3.tgz", + "integrity": "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.3.tgz", + "integrity": "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.3.tgz", + "integrity": "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.3.tgz", + "integrity": "sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.3.tgz", + "integrity": "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.3.tgz", + "integrity": "sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.3.tgz", + "integrity": "sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.3.tgz", + "integrity": "sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.3.tgz", + "integrity": "sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.3.tgz", + "integrity": "sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.3.tgz", + "integrity": "sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", + "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.3.tgz", + "integrity": "sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.3.tgz", + "integrity": "sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.3.tgz", + "integrity": "sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.3.tgz", + "integrity": "sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.3.tgz", + "integrity": "sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.3.tgz", + "integrity": "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@solana/buffer-layout": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", + "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", + "license": "MIT", + "dependencies": { + "buffer": "~6.0.3" + }, + "engines": { + "node": ">=5.10" + } + }, + "node_modules/@solana/buffer-layout-utils": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz", + "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==", + "license": "Apache-2.0", + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/web3.js": "^1.32.0", + "bigint-buffer": "^1.1.5", + "bignumber.js": "^9.0.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@solana/codecs": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-preview.4.tgz", + "integrity": "sha512-gLMupqI4i+G4uPi2SGF/Tc1aXcviZF2ybC81x7Q/fARamNSgNOCUUoSCg9nWu1Gid6+UhA7LH80sWI8XjKaRog==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-data-structures": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/codecs-strings": "2.0.0-preview.4", + "@solana/options": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-core": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-preview.4.tgz", + "integrity": "sha512-A0VVuDDA5kNKZUinOqHxJQK32aKTucaVbvn31YenGzHX1gPqq+SOnFwgaEY6pq4XEopSmaK16w938ZQS8IvCnw==", + "license": "MIT", + "dependencies": { + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-data-structures": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.4.tgz", + "integrity": "sha512-nt2k2eTeyzlI/ccutPcG36M/J8NAYfxBPI9h/nQjgJ+M+IgOKi31JV8StDDlG/1XvY0zyqugV3I0r3KAbZRJpA==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-numbers": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.4.tgz", + "integrity": "sha512-Q061rLtMadsO7uxpguT+Z7G4UHnjQ6moVIxAQxR58nLxDPCC7MB1Pk106/Z7NDhDLHTcd18uO6DZ7ajHZEn2XQ==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/codecs-strings": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.4.tgz", + "integrity": "sha512-YDbsQePRWm+xnrfS64losSGRg8Wb76cjK1K6qfR8LPmdwIC3787x9uW5/E4icl/k+9nwgbIRXZ65lpF+ucZUnw==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "fastestsmallesttextencoderdecoder": "^1.0.22", + "typescript": ">=5" + } + }, + "node_modules/@solana/errors": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-preview.4.tgz", + "integrity": "sha512-kadtlbRv2LCWr8A9V22On15Us7Nn8BvqNaOB4hXsTB3O0fU40D1ru2l+cReqLcRPij4znqlRzW9Xi0m6J5DIhA==", + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "commander": "^12.1.0" + }, + "bin": { + "errors": "bin/cli.mjs" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/options": { + "version": "2.0.0-preview.4", + "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-preview.4.tgz", + "integrity": "sha512-tv2O/Frxql/wSe3jbzi5nVicIWIus/BftH+5ZR+r9r3FO0/htEllZS5Q9XdbmSboHu+St87584JXeDx3xm4jaA==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-preview.4", + "@solana/codecs-data-structures": "2.0.0-preview.4", + "@solana/codecs-numbers": "2.0.0-preview.4", + "@solana/codecs-strings": "2.0.0-preview.4", + "@solana/errors": "2.0.0-preview.4" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.8.tgz", + "integrity": "sha512-RO0JD9vPRi4LsAbMUdNbDJ5/cv2z11MGhtAvFeRzT4+hAGE/FUzRi0tkkWtuCfSIU3twC6CtmAihRp/+XXjWsA==", + "license": "Apache-2.0", + "dependencies": { + "@solana/buffer-layout": "^4.0.0", + "@solana/buffer-layout-utils": "^0.2.0", + "@solana/spl-token-group": "^0.0.5", + "@solana/spl-token-metadata": "^0.1.3", + "buffer": "^6.0.3" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.94.0" + } + }, + "node_modules/@solana/spl-token-group": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@solana/spl-token-group/-/spl-token-group-0.0.5.tgz", + "integrity": "sha512-CLJnWEcdoUBpQJfx9WEbX3h6nTdNiUzswfFdkABUik7HVwSNA98u5AYvBVK2H93d9PGMOHAak2lHW9xr+zAJGQ==", + "license": "Apache-2.0", + "dependencies": { + "@solana/codecs": "2.0.0-preview.4", + "@solana/spl-type-length-value": "0.1.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.94.0" + } + }, + "node_modules/@solana/spl-token-metadata": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz", + "integrity": "sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==", + "license": "Apache-2.0", + "dependencies": { + "@solana/codecs": "2.0.0-rc.1" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.95.3" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-rc.1.tgz", + "integrity": "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-rc.1", + "@solana/codecs-data-structures": "2.0.0-rc.1", + "@solana/codecs-numbers": "2.0.0-rc.1", + "@solana/codecs-strings": "2.0.0-rc.1", + "@solana/options": "2.0.0-rc.1" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-core": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz", + "integrity": "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==", + "license": "MIT", + "dependencies": { + "@solana/errors": "2.0.0-rc.1" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-data-structures": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz", + "integrity": "sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-rc.1", + "@solana/codecs-numbers": "2.0.0-rc.1", + "@solana/errors": "2.0.0-rc.1" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-numbers": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz", + "integrity": "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-rc.1", + "@solana/errors": "2.0.0-rc.1" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/codecs-strings": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz", + "integrity": "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-rc.1", + "@solana/codecs-numbers": "2.0.0-rc.1", + "@solana/errors": "2.0.0-rc.1" + }, + "peerDependencies": { + "fastestsmallesttextencoderdecoder": "^1.0.22", + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/errors": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-rc.1.tgz", + "integrity": "sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==", + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "commander": "^12.1.0" + }, + "bin": { + "errors": "bin/cli.mjs" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-token-metadata/node_modules/@solana/options": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-rc.1.tgz", + "integrity": "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.0.0-rc.1", + "@solana/codecs-data-structures": "2.0.0-rc.1", + "@solana/codecs-numbers": "2.0.0-rc.1", + "@solana/codecs-strings": "2.0.0-rc.1", + "@solana/errors": "2.0.0-rc.1" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/@solana/spl-type-length-value": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz", + "integrity": "sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==", + "license": "Apache-2.0", + "dependencies": { + "buffer": "^6.0.3" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/web3.js": { + "version": "1.98.4", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.4.tgz", + "integrity": "sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.25.0", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0", + "@solana/buffer-layout": "^4.0.1", + "@solana/codecs-numbers": "^2.1.0", + "agentkeepalive": "^4.5.0", + "bn.js": "^5.2.1", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.3", + "fast-stable-stringify": "^1.0.0", + "jayson": "^4.1.1", + "node-fetch": "^2.7.0", + "rpc-websockets": "^9.0.2", + "superstruct": "^2.0.2" + } + }, + "node_modules/@solana/web3.js/node_modules/@solana/codecs-core": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.3.0.tgz", + "integrity": "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==", + "license": "MIT", + "dependencies": { + "@solana/errors": "2.3.0" + }, + "engines": { + "node": ">=20.18.0" + }, + "peerDependencies": { + "typescript": ">=5.3.3" + } + }, + "node_modules/@solana/web3.js/node_modules/@solana/codecs-numbers": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.3.0.tgz", + "integrity": "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==", + "license": "MIT", + "dependencies": { + "@solana/codecs-core": "2.3.0", + "@solana/errors": "2.3.0" + }, + "engines": { + "node": ">=20.18.0" + }, + "peerDependencies": { + "typescript": ">=5.3.3" + } + }, + "node_modules/@solana/web3.js/node_modules/@solana/errors": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.3.0.tgz", + "integrity": "sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==", + "license": "MIT", + "dependencies": { + "chalk": "^5.4.1", + "commander": "^14.0.0" + }, + "bin": { + "errors": "bin/cli.mjs" + }, + "engines": { + "node": ">=20.18.0" + }, + "peerDependencies": { + "typescript": ">=5.3.3" + } + }, + "node_modules/@solana/web3.js/node_modules/commander": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/@swc/helpers": { + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", + "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@types/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-DLbJ1BPqxvQhIGbeu8VbUC1DiAiahHtAYvA0ZEAa4P31F7IaArc8z3C3BRQdWX4mtLQuABG4yzp76ZrS02Ui1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.19.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.2.tgz", + "integrity": "sha512-LPM2G3Syo1GLzXLGJAKdqoU35XvrWzGJ21/7sgZTUpbkBaOasTj8tjwn6w+hCkqaa1TfJ/w67rJSwYItlJ2mYw==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/base-x": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz", + "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "bindings": "^1.3.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bn.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", + "license": "MIT" + }, + "node_modules/borsh": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", + "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", + "license": "Apache-2.0", + "dependencies": { + "bn.js": "^5.2.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "license": "MIT", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-layout": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", + "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.5" + } + }, + "node_modules/bufferutil": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.9.tgz", + "integrity": "sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "license": "MIT" + }, + "node_modules/es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "license": "MIT", + "dependencies": { + "es6-promise": "^4.0.3" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", + "engines": { + "node": "> 0.1.90" + } + }, + "node_modules/fast-stable-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", + "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==", + "license": "MIT" + }, + "node_modules/fastestsmallesttextencoderdecoder": { + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz", + "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==", + "license": "CC0-1.0", + "peer": true + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/jayson": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.2.0.tgz", + "integrity": "sha512-VfJ9t1YLwacIubLhONk0KFeosUBwstRWQ0IRT1KDjEjnVnSOVHC3uwugyV7L0c7R9lpVyrUGT2XWiBA1UTtpyg==", + "license": "MIT", + "dependencies": { + "@types/connect": "^3.4.33", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "stream-json": "^1.9.1", + "uuid": "^8.3.2", + "ws": "^7.5.10" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "license": "MIT" + }, + "node_modules/jayson/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "license": "MIT", + "optional": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.53.3.tgz", + "integrity": "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.53.3", + "@rollup/rollup-android-arm64": "4.53.3", + "@rollup/rollup-darwin-arm64": "4.53.3", + "@rollup/rollup-darwin-x64": "4.53.3", + "@rollup/rollup-freebsd-arm64": "4.53.3", + "@rollup/rollup-freebsd-x64": "4.53.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", + "@rollup/rollup-linux-arm-musleabihf": "4.53.3", + "@rollup/rollup-linux-arm64-gnu": "4.53.3", + "@rollup/rollup-linux-arm64-musl": "4.53.3", + "@rollup/rollup-linux-loong64-gnu": "4.53.3", + "@rollup/rollup-linux-ppc64-gnu": "4.53.3", + "@rollup/rollup-linux-riscv64-gnu": "4.53.3", + "@rollup/rollup-linux-riscv64-musl": "4.53.3", + "@rollup/rollup-linux-s390x-gnu": "4.53.3", + "@rollup/rollup-linux-x64-gnu": "4.53.3", + "@rollup/rollup-linux-x64-musl": "4.53.3", + "@rollup/rollup-openharmony-arm64": "4.53.3", + "@rollup/rollup-win32-arm64-msvc": "4.53.3", + "@rollup/rollup-win32-ia32-msvc": "4.53.3", + "@rollup/rollup-win32-x64-gnu": "4.53.3", + "@rollup/rollup-win32-x64-msvc": "4.53.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/rpc-websockets": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.2.tgz", + "integrity": "sha512-VuW2xJDnl1k8n8kjbdRSWawPRkwaVqUQNjE1TdeTawf0y0abGhtVJFTXCLfgpgGDBkO/Fj6kny8Dc/nvOW78MA==", + "license": "LGPL-3.0-only", + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/uuid": "^8.3.4", + "@types/ws": "^8.2.2", + "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/rpc-websockets/node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/rpc-websockets/node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/stream-chain": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz", + "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==", + "license": "BSD-3-Clause" + }, + "node_modules/stream-json": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz", + "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==", + "license": "BSD-3-Clause", + "dependencies": { + "stream-chain": "^2.2.5" + } + }, + "node_modules/superstruct": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz", + "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/utf-8-validate": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/light-token/package.json b/light-token/package.json new file mode 100644 index 0000000..a795ef7 --- /dev/null +++ b/light-token/package.json @@ -0,0 +1,28 @@ +{ + "name": "c-token-tests", + "version": "1.0.0", + "description": "TypeScript tests for c-token SDK examples", + "type": "module", + "scripts": { + "test": "vitest run --reporter=verbose", + "test:create-mint": "vitest run tests/create-mint.test.ts --reporter=verbose", + "test:mint-to": "vitest run tests/mint-to.test.ts --reporter=verbose", + "test:create-ata": "vitest run tests/create-ata-interface.test.ts --reporter=verbose", + "test:transfer": "vitest run tests/transfer-interface.test.ts --reporter=verbose" + }, + "dependencies": { + "@lightprotocol/compressed-token": "file:../../light-protocol/js/compressed-token", + "@lightprotocol/hasher.rs": "file:../../light-protocol/js/hasher.rs", + "@lightprotocol/stateless.js": "file:../../light-protocol/js/stateless.js", + "@solana/spl-token": "0.4.8", + "@solana/web3.js": "1.98.4" + }, + "devDependencies": { + "@coral-xyz/borsh": "^0.29.0", + "@types/bn.js": "^5.1.5", + "@types/node": "^22.5.5", + "bn.js": "^5.2.1", + "typescript": "^5.6.2", + "vitest": "^2.1.1" + } +} diff --git a/c-token/src/close.rs b/light-token/programs/src/close.rs similarity index 100% rename from c-token/src/close.rs rename to light-token/programs/src/close.rs diff --git a/c-token/src/create_ata2.rs b/light-token/programs/src/create_ata2.rs similarity index 100% rename from c-token/src/create_ata2.rs rename to light-token/programs/src/create_ata2.rs diff --git a/c-token/src/create_cmint.rs b/light-token/programs/src/create_cmint.rs similarity index 100% rename from c-token/src/create_cmint.rs rename to light-token/programs/src/create_cmint.rs diff --git a/c-token/src/create_token_account.rs b/light-token/programs/src/create_token_account.rs similarity index 100% rename from c-token/src/create_token_account.rs rename to light-token/programs/src/create_token_account.rs diff --git a/c-token/src/lib.rs b/light-token/programs/src/lib.rs similarity index 100% rename from c-token/src/lib.rs rename to light-token/programs/src/lib.rs diff --git a/c-token/src/mint_to_ctoken.rs b/light-token/programs/src/mint_to_ctoken.rs similarity index 100% rename from c-token/src/mint_to_ctoken.rs rename to light-token/programs/src/mint_to_ctoken.rs diff --git a/c-token/src/transfer.rs b/light-token/programs/src/transfer.rs similarity index 100% rename from c-token/src/transfer.rs rename to light-token/programs/src/transfer.rs diff --git a/c-token/src/transfer_interface.rs b/light-token/programs/src/transfer_interface.rs similarity index 100% rename from c-token/src/transfer_interface.rs rename to light-token/programs/src/transfer_interface.rs diff --git a/c-token/src/transfer_spl_ctoken.rs b/light-token/programs/src/transfer_spl_ctoken.rs similarity index 100% rename from c-token/src/transfer_spl_ctoken.rs rename to light-token/programs/src/transfer_spl_ctoken.rs diff --git a/c-token/tests/client-close-ctoken.rs b/light-token/programs/tests/client-close-ctoken.rs similarity index 100% rename from c-token/tests/client-close-ctoken.rs rename to light-token/programs/tests/client-close-ctoken.rs diff --git a/c-token/tests/client-create-cata.rs b/light-token/programs/tests/client-create-cata.rs similarity index 100% rename from c-token/tests/client-create-cata.rs rename to light-token/programs/tests/client-create-cata.rs diff --git a/c-token/tests/client-create-cmint.rs b/light-token/programs/tests/client-create-cmint.rs similarity index 100% rename from c-token/tests/client-create-cmint.rs rename to light-token/programs/tests/client-create-cmint.rs diff --git a/c-token/tests/client-create-ctoken.rs b/light-token/programs/tests/client-create-ctoken.rs similarity index 100% rename from c-token/tests/client-create-ctoken.rs rename to light-token/programs/tests/client-create-ctoken.rs diff --git a/c-token/tests/client-mint-to-ctoken.rs b/light-token/programs/tests/client-mint-to-ctoken.rs similarity index 100% rename from c-token/tests/client-mint-to-ctoken.rs rename to light-token/programs/tests/client-mint-to-ctoken.rs diff --git a/c-token/tests/client-transfer-interface.rs b/light-token/programs/tests/client-transfer-interface.rs similarity index 100% rename from c-token/tests/client-transfer-interface.rs rename to light-token/programs/tests/client-transfer-interface.rs diff --git a/c-token/tests/devnet-client-create-cmint.rs b/light-token/programs/tests/devnet-client-create-mint.rs similarity index 88% rename from c-token/tests/devnet-client-create-cmint.rs rename to light-token/programs/tests/devnet-client-create-mint.rs index c2f4272..c0b615b 100644 --- a/c-token/tests/devnet-client-create-cmint.rs +++ b/light-token/programs/tests/devnet-client-create-mint.rs @@ -1,42 +1,41 @@ -// Test for: client-create-cmint.mdx - use light_client::indexer::{AddressWithTree, Indexer}; use light_client::rpc::{LightClient, LightClientConfig, Rpc}; use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams}; use light_ctoken_interface::instructions::extensions::token_metadata::TokenMetadataInstructionData; use light_ctoken_interface::instructions::extensions::ExtensionInstructionData; use light_ctoken_interface::state::AdditionalMetadata; -use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; +use solana_sdk::{bs58, pubkey::Pubkey, signature::Keypair, signer::Signer}; use std::env; use std::fs; use serde_json; use std::convert::TryFrom; + #[tokio::test(flavor = "multi_thread")] async fn test_create_rent_free_mint_with_metadata() { - // Load environment variables from .env file dotenvy::dotenv().ok(); - // Initialize LightClient on devnet with Photon indexer let keypair_path = env::var("KEYPAIR_PATH") .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); - - // Get Helius API key from environment - let helius_api_key = env::var("HELIUS_API_KEY") - .expect("HELIUS_API_KEY environment variable must be set. Create a .env file or set it in your environment."); + let api_key = env::var("api_key") + .expect("api_key environment variable must be set. Create a .env file or set it in your environment."); let photon_base = "https://devnet.helius-rpc.com".to_string(); - let config = LightClientConfig::devnet(Some(photon_base), Some(helius_api_key)); + let config = LightClientConfig::devnet(Some(photon_base), Some(api_key)); let mut rpc = LightClient::new_with_retry(config, None) .await .expect("Failed to initialize LightClient"); // Create c-mint with metadata - let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + let (mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; - println!("Created compressed mint: {}", mint); + println!("Mint Address: {}", bs58::encode(compression_address).into_string()); + println!("Decimals: 9"); + println!("Name: Rent Free Token"); + println!("Symbol: RFT"); + println!("URI: https://example.com/metadata.json"); } pub async fn create_compressed_mint( diff --git a/light-token/programs/tests/devnet-client-mint-to-ctoken.rs b/light-token/programs/tests/devnet-client-mint-to-ctoken.rs new file mode 100644 index 0000000..ecd3fbc --- /dev/null +++ b/light-token/programs/tests/devnet-client-mint-to-ctoken.rs @@ -0,0 +1,278 @@ +// Test for: client-mint-to-ctoken.mdx + +use borsh::BorshDeserialize; +use light_client::indexer::{AddressWithTree, Indexer}; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; +use light_ctoken_sdk::ctoken::{ + CreateCMint, CreateCMintParams, CreateCTokenAccount, MintToCToken, MintToCTokenParams, +}; +use light_ctoken_interface::instructions::extensions::token_metadata::TokenMetadataInstructionData; +use light_ctoken_interface::instructions::extensions::ExtensionInstructionData; +use light_ctoken_interface::instructions::mint_action::CompressedMintWithContext; +use light_ctoken_interface::state::{AdditionalMetadata, CToken, CompressedMint}; +use solana_sdk::{bs58, pubkey::Pubkey, signature::Keypair, signer::Signer}; +use std::env; +use std::fs; +use serde_json; +use std::convert::TryFrom; + + +#[tokio::test(flavor = "multi_thread")] +async fn test_create_rent_free_mint_with_metadata() { + // Load environment variables from .env file + dotenvy::dotenv().ok(); + + // Initialize LightClient on devnet with Photon indexer + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + + // Get Helius API key from environment + let helius_api_key = env::var("HELIUS_API_KEY") + .expect("HELIUS_API_KEY environment variable must be set. Create a .env file or set it in your environment."); + + let photon_base = "https://devnet.helius-rpc.com".to_string(); + let config = LightClientConfig::devnet(Some(photon_base), Some(helius_api_key)); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to initialize LightClient"); + + // Create c-mint with metadata + let (mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + println!("\n=== Created Compressed Mint ==="); + println!("Mint PDA: {}", mint); + println!("Compression Address: {}", bs58::encode(compression_address).into_string()); + println!("Decimals: 9"); + println!("Name: Rent Free Token"); + println!("Symbol: RFT"); + println!("URI: https://example.com/metadata.json"); + + // Step 2: Create ctoken account + let ctoken_account = Keypair::new(); + let owner = payer.pubkey(); + let create_account_ix = CreateCTokenAccount::new( + payer.pubkey(), + ctoken_account.pubkey(), + mint, + owner, + ) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction( + &[create_account_ix], + &payer.pubkey(), + &[&payer, &ctoken_account], + ) + .await + .unwrap(); + println!("Created ctoken account: {}", ctoken_account.pubkey()); + + // Step 3: Get compressed mint account to build CompressedMintWithContext + let compressed_mint_account = rpc + .get_compressed_account(compression_address, None) + .await + .unwrap() + .value + .expect("Compressed mint should exist"); + + // Step 4: Get validity proof for the mint operation + let rpc_result = rpc + .get_validity_proof(vec![compressed_mint_account.hash], vec![], None) + .await + .unwrap() + .value; + + // Step 5: Deserialize compressed mint data + let compressed_mint = CompressedMint::deserialize( + &mut compressed_mint_account.data.unwrap().data.as_slice(), + ) + .unwrap(); + + // Step 6: Build CompressedMintWithContext + let compressed_mint_with_context = CompressedMintWithContext { + address: compression_address, + leaf_index: compressed_mint_account.leaf_index, + prove_by_index: true, + root_index: rpc_result.accounts[0] + .root_index + .root_index() + .unwrap_or_default(), + mint: compressed_mint.try_into().unwrap(), + }; + + let amount = 1_000_000_000u64; // 1 token with 9 decimals + + // Step 7: Get active output queue for devnet (same pattern as create_compressed_mint) + let _ = rpc.get_latest_active_state_trees().await; + let output_queue = match rpc + .get_random_state_tree_info() + .ok() + .or_else(|| rpc.get_random_state_tree_info_v1().ok()) + { + Some(info) => info + .get_output_pubkey() + .expect("Invalid state tree type for output"), + None => { + let queues = rpc + .indexer_mut() + .expect("IndexerNotInitialized") + .get_queue_info(None) + .await + .expect("Failed to fetch queue info") + .value + .queues; + queues + .get(0) + .map(|q| q.queue) + .expect("NoStateTreesAvailable: no active state trees returned") + } + }; + + // Step 8: Build mint params + let params = MintToCTokenParams::new( + compressed_mint_with_context, + amount, + payer.pubkey(), // mint_authority + rpc_result.proof, + ); + + // Step 9: Build instruction using SDK builder + let instruction = MintToCToken::new( + params, + payer.pubkey(), + compressed_mint_account.tree_info.tree, + output_queue, + output_queue, + vec![ctoken_account.pubkey()], + ) + .instruction() + .unwrap(); + + // Step 10: Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + println!("Minted {} tokens to ctoken account", amount); + + // Step 11: Verify tokens were minted + let ctoken_account_data = rpc + .get_account(ctoken_account.pubkey()) + .await + .unwrap() + .unwrap(); + + let ctoken_state = CToken::deserialize(&mut &ctoken_account_data.data[..]).unwrap(); + assert_eq!(ctoken_state.amount, amount, "Token amount should match"); + assert_eq!(ctoken_state.mint, mint.to_bytes(), "Mint should match"); + assert_eq!(ctoken_state.owner, owner.to_bytes(), "Owner should match"); + + println!("Successfully minted and verified {} tokens!", amount); +} +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + // Ensure state trees are fetched, then pick a valid one via helper + let _ = rpc.get_latest_active_state_trees().await; + let output_pubkey = match rpc + .get_random_state_tree_info() + .ok() + .or_else(|| rpc.get_random_state_tree_info_v1().ok()) + { + Some(info) => info + .get_output_pubkey() + .expect("Invalid state tree type for output"), + None => { + let queues = rpc + .indexer_mut() + .expect("IndexerNotInitialized") + .get_queue_info(None) + .await + .expect("Failed to fetch queue info") + .value + .queues; + queues + .get(0) + .map(|q| q.queue) + .expect("NoStateTreesAvailable: no active state trees returned") + } + }; + + // Derive address + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = + light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params with token metadata + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: Some(vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some(payer.pubkey().to_bytes().into()), + name: b"Rent Free Token".to_vec(), + symbol: b"RFT".to_vec(), + uri: b"https://example.com/metadata.json".to_vec(), + additional_metadata: Some(vec![AdditionalMetadata { + key: b"type".to_vec(), + value: b"compressed".to_vec(), + }]), + }, + )]), + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_pubkey, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} + +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::try_from(&bytes[..])?) +} diff --git a/c-token/tests/devnet-spl-ctoken-transfer.rs b/light-token/programs/tests/devnet-spl-ctoken-transfer.rs similarity index 100% rename from c-token/tests/devnet-spl-ctoken-transfer.rs rename to light-token/programs/tests/devnet-spl-ctoken-transfer.rs diff --git a/light-token/tests/create-ata-interface.test.ts b/light-token/tests/create-ata-interface.test.ts new file mode 100644 index 0000000..57496a2 --- /dev/null +++ b/light-token/tests/create-ata-interface.test.ts @@ -0,0 +1,674 @@ +import { describe, it, expect, beforeAll } from 'vitest'; +import { Keypair, Signer, PublicKey } from '@solana/web3.js'; +import { + Rpc, + newAccountWithLamports, + createRpc, + VERSION, + featureFlags, + CTOKEN_PROGRAM_ID, +} from '@lightprotocol/stateless.js'; +import { + TOKEN_PROGRAM_ID, + TOKEN_2022_PROGRAM_ID, + createMint, + getMint, + getAssociatedTokenAddressSync, + ASSOCIATED_TOKEN_PROGRAM_ID, +} from '@solana/spl-token'; +import { + createMintInterface, + createAtaInterface, + createAtaInterfaceIdempotent, + getAssociatedTokenAddressInterface, + findMintAddress, +} from '@lightprotocol/compressed-token/unified'; + +featureFlags.version = VERSION.V2; + +describe('createAtaInterface', () => { + let rpc: Rpc; + let payer: Signer; + + beforeAll(async () => { + rpc = createRpc(); + payer = await newAccountWithLamports(rpc, 10e9); + }); + + describe('CToken (default programId)', () => { + it('should create CToken ATA with default programId', async () => { + const mintSigner = Keypair.generate(); + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + const [mintPda] = findMintAddress(mintSigner.publicKey); + + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 9, + mintSigner, + ); + + const address = await createAtaInterface( + rpc, + payer, + mintPda, + owner.publicKey, + ); + + const expectedAddress = getAssociatedTokenAddressInterface( + mintPda, + owner.publicKey, + ); + expect(address.toBase58()).toBe(expectedAddress.toBase58()); + + const accountInfo = await rpc.getAccountInfo(address); + expect(accountInfo).not.toBe(null); + expect(accountInfo?.owner.toBase58()).toBe( + CTOKEN_PROGRAM_ID.toBase58(), + ); + }); + + it('should create CToken ATA with explicit CTOKEN_PROGRAM_ID', async () => { + const mintSigner = Keypair.generate(); + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + const [mintPda] = findMintAddress(mintSigner.publicKey); + + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 6, + mintSigner, + ); + + const address = await createAtaInterface( + rpc, + payer, + mintPda, + owner.publicKey, + false, + undefined, + CTOKEN_PROGRAM_ID, + ); + + const expectedAddress = getAssociatedTokenAddressInterface( + mintPda, + owner.publicKey, + false, + CTOKEN_PROGRAM_ID, + ); + expect(address.toBase58()).toBe(expectedAddress.toBase58()); + }); + + it('should fail creating CToken ATA twice (non-idempotent)', async () => { + const mintSigner = Keypair.generate(); + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + const [mintPda] = findMintAddress(mintSigner.publicKey); + + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 9, + mintSigner, + ); + + await createAtaInterface(rpc, payer, mintPda, owner.publicKey); + + await expect( + createAtaInterface(rpc, payer, mintPda, owner.publicKey), + ).rejects.toThrow(); + }); + + it('should create CToken ATA idempotently', async () => { + const mintSigner = Keypair.generate(); + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + const [mintPda] = findMintAddress(mintSigner.publicKey); + + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 9, + mintSigner, + ); + + const addr1 = await createAtaInterfaceIdempotent( + rpc, + payer, + mintPda, + owner.publicKey, + ); + + const addr2 = await createAtaInterfaceIdempotent( + rpc, + payer, + mintPda, + owner.publicKey, + ); + + const addr3 = await createAtaInterfaceIdempotent( + rpc, + payer, + mintPda, + owner.publicKey, + ); + + expect(addr1.toBase58()).toBe(addr2.toBase58()); + expect(addr2.toBase58()).toBe(addr3.toBase58()); + }); + + it('should create CToken ATAs for multiple owners', async () => { + const mintSigner = Keypair.generate(); + const mintAuthority = Keypair.generate(); + const owner1 = Keypair.generate(); + const owner2 = Keypair.generate(); + const [mintPda] = findMintAddress(mintSigner.publicKey); + + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 9, + mintSigner, + ); + + const addr1 = await createAtaInterface( + rpc, + payer, + mintPda, + owner1.publicKey, + ); + + const addr2 = await createAtaInterface( + rpc, + payer, + mintPda, + owner2.publicKey, + ); + + expect(addr1.toBase58()).not.toBe(addr2.toBase58()); + + const expected1 = getAssociatedTokenAddressInterface( + mintPda, + owner1.publicKey, + ); + const expected2 = getAssociatedTokenAddressInterface( + mintPda, + owner2.publicKey, + ); + + expect(addr1.toBase58()).toBe(expected1.toBase58()); + expect(addr2.toBase58()).toBe(expected2.toBase58()); + }); + }); + + describe('SPL Token (TOKEN_PROGRAM_ID)', () => { + it('should create SPL Token ATA', async () => { + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + + const mint = await createMint( + rpc, + payer, + mintAuthority.publicKey, + null, + 9, + undefined, + undefined, + TOKEN_PROGRAM_ID, + ); + + const address = await createAtaInterface( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_PROGRAM_ID, + ); + + const expectedAddress = getAssociatedTokenAddressSync( + mint, + owner.publicKey, + false, + TOKEN_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + expect(address.toBase58()).toBe(expectedAddress.toBase58()); + + const accountInfo = await rpc.getAccountInfo(address); + expect(accountInfo).not.toBe(null); + expect(accountInfo?.owner.toBase58()).toBe( + TOKEN_PROGRAM_ID.toBase58(), + ); + }); + + it('should create SPL Token ATA idempotently', async () => { + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + + const mint = await createMint( + rpc, + payer, + mintAuthority.publicKey, + null, + 6, + undefined, + undefined, + TOKEN_PROGRAM_ID, + ); + + const addr1 = await createAtaInterfaceIdempotent( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_PROGRAM_ID, + ); + + const addr2 = await createAtaInterfaceIdempotent( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_PROGRAM_ID, + ); + + expect(addr1.toBase58()).toBe(addr2.toBase58()); + }); + + it('should fail creating SPL Token ATA twice (non-idempotent)', async () => { + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + + const mint = await createMint( + rpc, + payer, + mintAuthority.publicKey, + null, + 9, + undefined, + undefined, + TOKEN_PROGRAM_ID, + ); + + await createAtaInterface( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_PROGRAM_ID, + ); + + await expect( + createAtaInterface( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_PROGRAM_ID, + ), + ).rejects.toThrow(); + }); + }); + + describe('Token-2022 (TOKEN_2022_PROGRAM_ID)', () => { + it('should create Token-2022 ATA', async () => { + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + + const mint = await createMint( + rpc, + payer, + mintAuthority.publicKey, + null, + 9, + undefined, + undefined, + TOKEN_2022_PROGRAM_ID, + ); + + const address = await createAtaInterface( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_2022_PROGRAM_ID, + ); + + const expectedAddress = getAssociatedTokenAddressSync( + mint, + owner.publicKey, + false, + TOKEN_2022_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + expect(address.toBase58()).toBe(expectedAddress.toBase58()); + + const accountInfo = await rpc.getAccountInfo(address); + expect(accountInfo).not.toBe(null); + expect(accountInfo?.owner.toBase58()).toBe( + TOKEN_2022_PROGRAM_ID.toBase58(), + ); + }); + + it('should create Token-2022 ATA idempotently', async () => { + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + + const mint = await createMint( + rpc, + payer, + mintAuthority.publicKey, + null, + 6, + undefined, + undefined, + TOKEN_2022_PROGRAM_ID, + ); + + const addr1 = await createAtaInterfaceIdempotent( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_2022_PROGRAM_ID, + ); + + const addr2 = await createAtaInterfaceIdempotent( + rpc, + payer, + mint, + owner.publicKey, + false, + undefined, + TOKEN_2022_PROGRAM_ID, + ); + + expect(addr1.toBase58()).toBe(addr2.toBase58()); + }); + }); + + describe('PDA owner (allowOwnerOffCurve)', () => { + it('should create CToken ATA for PDA owner with allowOwnerOffCurve=true', async () => { + const mintSigner = Keypair.generate(); + const mintAuthority = Keypair.generate(); + const [mintPda] = findMintAddress(mintSigner.publicKey); + + // Create a PDA owner + const [pdaOwner] = PublicKey.findProgramAddressSync( + [Buffer.from('test-pda-owner')], + CTOKEN_PROGRAM_ID, + ); + + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 9, + mintSigner, + ); + + const address = await createAtaInterface( + rpc, + payer, + mintPda, + pdaOwner, + true, // allowOwnerOffCurve + ); + + const expectedAddress = getAssociatedTokenAddressInterface( + mintPda, + pdaOwner, + true, + ); + expect(address.toBase58()).toBe(expectedAddress.toBase58()); + }); + + it('should create SPL Token ATA for PDA owner with allowOwnerOffCurve=true', async () => { + const mintAuthority = Keypair.generate(); + + // Create a PDA owner + const [pdaOwner] = PublicKey.findProgramAddressSync( + [Buffer.from('test-spl-pda-owner')], + TOKEN_PROGRAM_ID, + ); + + const mint = await createMint( + rpc, + payer, + mintAuthority.publicKey, + null, + 9, + undefined, + undefined, + TOKEN_PROGRAM_ID, + ); + + const address = await createAtaInterface( + rpc, + payer, + mint, + pdaOwner, + true, // allowOwnerOffCurve + undefined, + TOKEN_PROGRAM_ID, + ); + + const expectedAddress = getAssociatedTokenAddressSync( + mint, + pdaOwner, + true, + TOKEN_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + expect(address.toBase58()).toBe(expectedAddress.toBase58()); + }); + }); + + describe('cross-program verification', () => { + it('should produce different ATAs for same owner/mint with different programs', async () => { + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + + // Create SPL mint + const splMint = await createMint( + rpc, + payer, + mintAuthority.publicKey, + null, + 9, + undefined, + undefined, + TOKEN_PROGRAM_ID, + ); + + // Create CToken mint + const mintSigner = Keypair.generate(); + const [ctokenMint] = findMintAddress(mintSigner.publicKey); + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 9, + mintSigner, + ); + + // Create ATAs for both + const splAta = await createAtaInterfaceIdempotent( + rpc, + payer, + splMint, + owner.publicKey, + false, + undefined, + TOKEN_PROGRAM_ID, + ); + + const ctokenAta = await createAtaInterfaceIdempotent( + rpc, + payer, + ctokenMint, + owner.publicKey, + ); + + // ATAs should be different (different mints and programs) + expect(splAta.toBase58()).not.toBe(ctokenAta.toBase58()); + }); + + it('should match expected derivation for each program', async () => { + const owner = Keypair.generate(); + + // SPL Token + const splMintAuth = Keypair.generate(); + const splMint = await createMint( + rpc, + payer, + splMintAuth.publicKey, + null, + 9, + undefined, + undefined, + TOKEN_PROGRAM_ID, + ); + const splAta = await createAtaInterfaceIdempotent( + rpc, + payer, + splMint, + owner.publicKey, + false, + undefined, + TOKEN_PROGRAM_ID, + ); + const expectedSplAta = getAssociatedTokenAddressSync( + splMint, + owner.publicKey, + false, + TOKEN_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + expect(splAta.toBase58()).toBe(expectedSplAta.toBase58()); + + // Token-2022 + const t22MintAuth = Keypair.generate(); + const t22Mint = await createMint( + rpc, + payer, + t22MintAuth.publicKey, + null, + 9, + undefined, + undefined, + TOKEN_2022_PROGRAM_ID, + ); + const t22Ata = await createAtaInterfaceIdempotent( + rpc, + payer, + t22Mint, + owner.publicKey, + false, + undefined, + TOKEN_2022_PROGRAM_ID, + ); + const expectedT22Ata = getAssociatedTokenAddressSync( + t22Mint, + owner.publicKey, + false, + TOKEN_2022_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + expect(t22Ata.toBase58()).toBe(expectedT22Ata.toBase58()); + + // CToken + const mintSigner = Keypair.generate(); + const ctokenMintAuth = Keypair.generate(); + const [ctokenMint] = findMintAddress(mintSigner.publicKey); + await createMintInterface( + rpc, + payer, + ctokenMintAuth, + null, + 9, + mintSigner, + ); + const ctokenAta = await createAtaInterfaceIdempotent( + rpc, + payer, + ctokenMint, + owner.publicKey, + ); + const expectedCtokenAta = getAssociatedTokenAddressInterface( + ctokenMint, + owner.publicKey, + ); + expect(ctokenAta.toBase58()).toBe(expectedCtokenAta.toBase58()); + }); + }); + + describe('concurrent calls', () => { + it('should handle concurrent idempotent calls for CToken', async () => { + const mintSigner = Keypair.generate(); + const mintAuthority = Keypair.generate(); + const owner = Keypair.generate(); + const [mintPda] = findMintAddress(mintSigner.publicKey); + + await createMintInterface( + rpc, + payer, + mintAuthority, + null, + 9, + mintSigner, + ); + + const promises = Array(3) + .fill(null) + .map(() => + createAtaInterfaceIdempotent( + rpc, + payer, + mintPda, + owner.publicKey, + ), + ); + + const results = await Promise.allSettled(promises); + const successful = results.filter(r => r.status === 'fulfilled'); + + expect(successful.length).toBeGreaterThan(0); + + // All successful results should have same address + const addresses = successful.map(r => + (r as PromiseFulfilledResult).value.toBase58(), + ); + const uniqueAddresses = [...new Set(addresses)]; + expect(uniqueAddresses.length).toBe(1); + }); + }); +}); diff --git a/light-token/tests/create-mint.test.ts b/light-token/tests/create-mint.test.ts new file mode 100644 index 0000000..20e8377 --- /dev/null +++ b/light-token/tests/create-mint.test.ts @@ -0,0 +1,112 @@ +import { describe, it, expect, beforeAll, assert } from 'vitest'; +import { CompressedTokenProgram } from '@lightprotocol/compressed-token'; +import { PublicKey, Signer, Keypair } from '@solana/web3.js'; +import { unpackMint, unpackAccount } from '@solana/spl-token'; +import { createMint } from '@lightprotocol/compressed-token'; +import { + Rpc, + newAccountWithLamports, + getTestRpc, +} from '@lightprotocol/stateless.js'; +import { WasmFactory } from '@lightprotocol/hasher.rs'; + +/** + * Asserts that createMint() creates a new spl mint account + the respective + * system pool account + */ +async function assertCreateMintSPL( + mint: PublicKey, + authority: PublicKey, + rpc: Rpc, + decimals: number, + poolAccount: PublicKey, +) { + const mintAcc = await rpc.getAccountInfo(mint); + const unpackedMint = unpackMint(mint, mintAcc); + + expect(unpackedMint.mintAuthority?.toString()).toBe(authority.toString()); + expect(unpackedMint.supply).toBe(0n); + expect(unpackedMint.decimals).toBe(decimals); + expect(unpackedMint.isInitialized).toBe(true); + expect(unpackedMint.freezeAuthority).toBe(null); + expect(unpackedMint.tlvData.length).toBe(0); + + /// Pool (omnibus) account is a regular SPL Token account + const poolAccountInfo = await rpc.getAccountInfo(poolAccount); + const unpackedPoolAccount = unpackAccount(poolAccount, poolAccountInfo); + expect(unpackedPoolAccount.mint.equals(mint)).toBe(true); + expect(unpackedPoolAccount.amount).toBe(0n); + expect( + unpackedPoolAccount.owner.equals( + CompressedTokenProgram.deriveCpiAuthorityPda, + ), + ).toBe(true); + expect(unpackedPoolAccount.delegate).toBe(null); +} + +const TEST_TOKEN_DECIMALS = 2; +describe('createMint (SPL)', () => { + let rpc: Rpc; + let payer: Signer; + let mint: PublicKey; + let mintAuthority: Keypair; + + beforeAll(async () => { + const lightWasm = await WasmFactory.getInstance(); + rpc = await getTestRpc(lightWasm); + payer = await newAccountWithLamports(rpc, 1e9); + }); + + it('should create mint', async () => { + mintAuthority = Keypair.generate(); + const mintKeypair = Keypair.generate(); + + mint = ( + await createMint( + rpc, + payer, + mintAuthority.publicKey, + TEST_TOKEN_DECIMALS, + mintKeypair, + ) + ).mint; + const poolAccount = CompressedTokenProgram.deriveTokenPoolPda(mint); + + assert(mint.equals(mintKeypair.publicKey)); + + await assertCreateMintSPL( + mint, + mintAuthority.publicKey, + rpc, + TEST_TOKEN_DECIMALS, + poolAccount, + ); + + /// Mint already exists + await expect( + createMint( + rpc, + payer, + mintAuthority.publicKey, + TEST_TOKEN_DECIMALS, + mintKeypair, + ), + ).rejects.toThrow(); + }); + + it('should create mint with payer as authority', async () => { + mint = ( + await createMint(rpc, payer, payer.publicKey, TEST_TOKEN_DECIMALS) + ).mint; + + const poolAccount = CompressedTokenProgram.deriveTokenPoolPda(mint); + + await assertCreateMintSPL( + mint, + payer.publicKey, + rpc, + TEST_TOKEN_DECIMALS, + poolAccount, + ); + }); +}); diff --git a/light-token/tests/mint-to.test.ts b/light-token/tests/mint-to.test.ts new file mode 100644 index 0000000..e2a52b3 --- /dev/null +++ b/light-token/tests/mint-to.test.ts @@ -0,0 +1,214 @@ +import { describe, it, expect, beforeAll } from 'vitest'; +import { + PublicKey, + Signer, + Keypair, + ComputeBudgetProgram, +} from '@solana/web3.js'; +import BN from 'bn.js'; +import { + createMint, + createTokenProgramLookupTable, + mintTo, +} from '@lightprotocol/compressed-token'; +import { + getTestKeypair, + newAccountWithLamports, + bn, + Rpc, + sendAndConfirmTx, + buildAndSignTx, + dedupeSigner, + getTestRpc, + TreeInfo, + selectStateTreeInfo, +} from '@lightprotocol/stateless.js'; + +import { CompressedTokenProgram } from '@lightprotocol/compressed-token'; +import { WasmFactory } from '@lightprotocol/hasher.rs'; +import { + getTokenPoolInfos, + selectTokenPoolInfo, + TokenPoolInfo, +} from '@lightprotocol/compressed-token'; + +/** + * Asserts that mintTo() creates a new compressed token account for the + * recipient + */ +async function assertMintTo( + rpc: Rpc, + refMint: PublicKey, + refAmount: BN, + refTo: PublicKey, +) { + const compressedTokenAccounts = await rpc.getCompressedTokenAccountsByOwner( + refTo, + { + mint: refMint, + }, + ); + + const compressedTokenAccount = compressedTokenAccounts.items[0]; + expect(compressedTokenAccount.parsed.mint.toBase58()).toBe( + refMint.toBase58(), + ); + expect(compressedTokenAccount.parsed.amount.eq(refAmount)).toBe(true); + expect(compressedTokenAccount.parsed.owner.equals(refTo)).toBe(true); + expect(compressedTokenAccount.parsed.delegate).toBe(null); +} + +const TEST_TOKEN_DECIMALS = 2; + +describe('mintTo', () => { + let rpc: Rpc; + let payer: Signer; + let bob: Signer; + let mint: PublicKey; + let mintAuthority: Keypair; + let lut: PublicKey; + let stateTreeInfo: TreeInfo; + let tokenPoolInfo: TokenPoolInfo; + + beforeAll(async () => { + const lightWasm = await WasmFactory.getInstance(); + rpc = await getTestRpc(lightWasm); + payer = await newAccountWithLamports(rpc); + bob = getTestKeypair(); + mintAuthority = payer as Keypair; + const mintKeypair = Keypair.generate(); + + mint = ( + await createMint( + rpc, + payer, + mintAuthority.publicKey, + TEST_TOKEN_DECIMALS, + mintKeypair, + ) + ).mint; + + stateTreeInfo = selectStateTreeInfo(await rpc.getStateTreeInfos()); + tokenPoolInfo = selectTokenPoolInfo(await getTokenPoolInfos(rpc, mint)); + + /// Setup LUT. + const { address } = await createTokenProgramLookupTable( + rpc, + payer, + payer, + [mint, payer.publicKey], + ); + lut = address; + }, 80_000); + + it('should mint to bob', async () => { + const amount = bn(1000); + const txId = await mintTo( + rpc, + payer, + mint, + bob.publicKey, + mintAuthority, + amount, + stateTreeInfo, + tokenPoolInfo, + ); + + await assertMintTo(rpc, mint, amount, bob.publicKey); + + /// wrong authority + /// is not checked in cToken program, so it throws invalid owner inside spl token program. + await expect( + mintTo(rpc, payer, mint, bob.publicKey, Keypair.generate(), amount), + ).rejects.toThrowError(/custom program error: 0x4/); + + /// with output state merkle tree defined + await mintTo( + rpc, + payer, + mint, + bob.publicKey, + mintAuthority, + amount, + stateTreeInfo, + tokenPoolInfo, + ); + }); + + // const maxRecipients = 18; + const maxRecipients = 22; + const recipients = Array.from( + { length: maxRecipients }, + () => Keypair.generate().publicKey, + ); + const amounts = Array.from({ length: maxRecipients }, (_, i) => bn(i + 1)); + + it('should mint to multiple recipients', async () => { + /// mint to three recipients + await mintTo( + rpc, + payer, + mint, + recipients.slice(0, 3), + mintAuthority, + amounts.slice(0, 3), + stateTreeInfo, + tokenPoolInfo, + ); + + /// Mint to 10 recipients + const tx = await mintTo( + rpc, + payer, + mint, + recipients.slice(0, 10), + mintAuthority, + amounts.slice(0, 10), + stateTreeInfo, + tokenPoolInfo, + ); + + // Uneven amounts + await expect( + mintTo( + rpc, + payer, + mint, + recipients, + mintAuthority, + amounts.slice(0, 2), + stateTreeInfo, + tokenPoolInfo, + ), + ).rejects.toThrowError( + /Amount and toPubkey arrays must have the same length/, + ); + }); + + it(`should mint to ${recipients.length} recipients optimized with LUT`, async () => { + const lookupTableAccount = (await rpc.getAddressLookupTable(lut)) + .value!; + + const ix = await CompressedTokenProgram.mintTo({ + feePayer: payer.publicKey, + mint, + authority: mintAuthority.publicKey, + amount: amounts, + toPubkey: recipients, + outputStateTreeInfo: stateTreeInfo, + tokenPoolInfo, + }); + + const { blockhash } = await rpc.getLatestBlockhash(); + const additionalSigners = dedupeSigner(payer, [mintAuthority]); + + const tx = buildAndSignTx( + [ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 }), ix], + payer, + blockhash, + additionalSigners, + [lookupTableAccount], + ); + const txId = await sendAndConfirmTx(rpc, tx); + }); +}); diff --git a/light-token/tests/transfer-interface.test.ts b/light-token/tests/transfer-interface.test.ts new file mode 100644 index 0000000..817d55d --- /dev/null +++ b/light-token/tests/transfer-interface.test.ts @@ -0,0 +1,527 @@ +import { describe, it, expect, beforeAll } from 'vitest'; +import { Keypair, Signer, PublicKey } from '@solana/web3.js'; +import { + Rpc, + bn, + newAccountWithLamports, + getTestRpc, + selectStateTreeInfo, + TreeInfo, + CTOKEN_PROGRAM_ID, + VERSION, + featureFlags, +} from '@lightprotocol/stateless.js'; +import { WasmFactory } from '@lightprotocol/hasher.rs'; +import { createMint, mintTo } from '@lightprotocol/compressed-token'; +import { + getTokenPoolInfos, + selectTokenPoolInfo, + TokenPoolInfo, +} from '@lightprotocol/compressed-token'; +import { + getAssociatedTokenAddressInterface, + getOrCreateAtaInterface, + transferInterface, + loadAta, + createLoadAtaInstructions, + createTransferInterfaceInstruction, + createCTokenTransferInstruction, +} from '@lightprotocol/compressed-token/unified'; + +featureFlags.version = VERSION.V2; + +const TEST_TOKEN_DECIMALS = 9; + +describe('transfer-interface', () => { + let rpc: Rpc; + let payer: Signer; + let mint: PublicKey; + let mintAuthority: Keypair; + let stateTreeInfo: TreeInfo; + let tokenPoolInfos: TokenPoolInfo[]; + + beforeAll(async () => { + const lightWasm = await WasmFactory.getInstance(); + rpc = await getTestRpc(lightWasm); + payer = await newAccountWithLamports(rpc, 10e9); + mintAuthority = Keypair.generate(); + const mintKeypair = Keypair.generate(); + + mint = ( + await createMint( + rpc, + payer, + mintAuthority.publicKey, + TEST_TOKEN_DECIMALS, + mintKeypair, + ) + ).mint; + + stateTreeInfo = selectStateTreeInfo(await rpc.getStateTreeInfos()); + tokenPoolInfos = await getTokenPoolInfos(rpc, mint); + }, 60_000); + + describe('createTransferInterfaceInstruction', () => { + it('should create CToken transfer instruction with correct accounts', () => { + const source = Keypair.generate().publicKey; + const destination = Keypair.generate().publicKey; + const owner = Keypair.generate().publicKey; + const amount = BigInt(1000); + + const ix = createTransferInterfaceInstruction( + source, + destination, + owner, + amount, + ); + + expect(ix.programId.equals(CTOKEN_PROGRAM_ID)).toBe(true); + expect(ix.keys.length).toBe(3); + expect(ix.keys[0].pubkey.equals(source)).toBe(true); + expect(ix.keys[1].pubkey.equals(destination)).toBe(true); + expect(ix.keys[2].pubkey.equals(owner)).toBe(true); + }); + + it('should add payer as 4th account when different from owner', () => { + const source = Keypair.generate().publicKey; + const destination = Keypair.generate().publicKey; + const owner = Keypair.generate().publicKey; + const payerPk = Keypair.generate().publicKey; + const amount = BigInt(1000); + + const ix = createCTokenTransferInstruction( + source, + destination, + owner, + amount, + payerPk, + ); + + expect(ix.keys.length).toBe(4); + expect(ix.keys[3].pubkey.equals(payerPk)).toBe(true); + }); + + it('should not add payer when same as owner', () => { + const source = Keypair.generate().publicKey; + const destination = Keypair.generate().publicKey; + const owner = Keypair.generate().publicKey; + const amount = BigInt(1000); + + const ix = createCTokenTransferInstruction( + source, + destination, + owner, + amount, + owner, // payer same as owner + ); + + expect(ix.keys.length).toBe(3); + }); + }); + + describe('createLoadAtaInstructions', () => { + it('should return empty when no balances to load (idempotent)', async () => { + const owner = Keypair.generate(); + const ata = getAssociatedTokenAddressInterface( + mint, + owner.publicKey, + ); + + const ixs = await createLoadAtaInstructions( + rpc, + ata, + owner.publicKey, + mint, + payer.publicKey, + ); + + expect(ixs.length).toBe(0); + }); + + it('should build load instructions for compressed balance', async () => { + const owner = Keypair.generate(); + + // Mint compressed tokens + await mintTo( + rpc, + payer, + mint, + owner.publicKey, + mintAuthority, + bn(1000), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + + const ata = getAssociatedTokenAddressInterface( + mint, + owner.publicKey, + ); + const ixs = await createLoadAtaInstructions( + rpc, + ata, + payer.publicKey, + mint, + ); + + expect(ixs.length).toBeGreaterThan(0); + }); + + it('should load ALL compressed accounts', async () => { + const owner = Keypair.generate(); + + // Mint multiple compressed token accounts + await mintTo( + rpc, + payer, + mint, + owner.publicKey, + mintAuthority, + bn(500), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + await mintTo( + rpc, + payer, + mint, + owner.publicKey, + mintAuthority, + bn(300), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + + const ata = getAssociatedTokenAddressInterface( + mint, + owner.publicKey, + ); + const ixs = await createLoadAtaInstructions( + rpc, + ata, + payer.publicKey, + mint, + ); + + expect(ixs.length).toBeGreaterThan(0); + }); + }); + + describe('loadAta action', () => { + it('should return null when nothing to load (idempotent)', async () => { + const owner = await newAccountWithLamports(rpc, 1e9); + const ata = getAssociatedTokenAddressInterface( + mint, + owner.publicKey, + ); + + const signature = await loadAta(rpc, ata, owner, mint); + + expect(signature).toBeNull(); + }); + + it('should execute load and return signature', async () => { + const owner = await newAccountWithLamports(rpc, 1e9); + + // Mint compressed tokens + await mintTo( + rpc, + payer, + mint, + owner.publicKey, + mintAuthority, + bn(2000), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + + const ata = getAssociatedTokenAddressInterface( + mint, + owner.publicKey, + ); + const signature = await loadAta(rpc, ata, owner, mint); + + expect(signature).not.toBeNull(); + expect(typeof signature).toBe('string'); + + // Verify hot balance increased + const ctokenAta = getAssociatedTokenAddressInterface( + mint, + owner.publicKey, + ); + const ataInfo = await rpc.getAccountInfo(ctokenAta); + expect(ataInfo).not.toBeNull(); + const hotBalance = ataInfo!.data.readBigUInt64LE(64); + expect(hotBalance).toBe(BigInt(2000)); + }); + }); + + describe('transferInterface action', () => { + it('should transfer from hot balance (destination exists)', async () => { + const sender = await newAccountWithLamports(rpc, 1e9); + const recipient = Keypair.generate(); + + // Mint and load sender + await mintTo( + rpc, + payer, + mint, + sender.publicKey, + mintAuthority, + bn(5000), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + const senderAta = getAssociatedTokenAddressInterface( + mint, + sender.publicKey, + ); + await loadAta(rpc, senderAta, sender, mint); + + // Create recipient ATA first (like SPL Token flow) + const recipientAta = await getOrCreateAtaInterface( + rpc, + payer, + mint, + recipient.publicKey, + ); + + const sourceAta = getAssociatedTokenAddressInterface( + mint, + sender.publicKey, + ); + + // Transfer - destination is ATA address + const signature = await transferInterface( + rpc, + payer, + sourceAta, + mint, + recipientAta.parsed.address, + sender, + BigInt(1000), + ); + + expect(signature).toBeDefined(); + + // Verify balances + const senderAtaInfo = await rpc.getAccountInfo(sourceAta); + const senderBalance = senderAtaInfo!.data.readBigUInt64LE(64); + expect(senderBalance).toBe(BigInt(4000)); + + const recipientAtaInfo = await rpc.getAccountInfo( + recipientAta.parsed.address, + ); + const recipientBalance = recipientAtaInfo!.data.readBigUInt64LE(64); + expect(recipientBalance).toBe(BigInt(1000)); + }); + + it('should auto-load sender when transferring from cold', async () => { + const sender = await newAccountWithLamports(rpc, 1e9); + const recipient = Keypair.generate(); + + // Mint compressed tokens (cold) - don't load + await mintTo( + rpc, + payer, + mint, + sender.publicKey, + mintAuthority, + bn(3000), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + + // Create recipient ATA first + const recipientAta = await getOrCreateAtaInterface( + rpc, + payer, + mint, + recipient.publicKey, + ); + + const sourceAta = getAssociatedTokenAddressInterface( + mint, + sender.publicKey, + ); + + // Transfer should auto-load sender's cold balance + const signature = await transferInterface( + rpc, + payer, + sourceAta, + mint, + recipientAta.parsed.address, + sender, + BigInt(2000), + CTOKEN_PROGRAM_ID, + undefined, + { splInterfaceInfos: tokenPoolInfos }, + ); + + expect(signature).toBeDefined(); + + // Verify recipient received tokens + const recipientAtaInfo = await rpc.getAccountInfo( + recipientAta.parsed.address, + ); + const recipientBalance = recipientAtaInfo!.data.readBigUInt64LE(64); + expect(recipientBalance).toBe(BigInt(2000)); + + // Sender should have change (loaded all 3000, sent 2000) + const senderAtaInfo = await rpc.getAccountInfo(sourceAta); + const senderBalance = senderAtaInfo!.data.readBigUInt64LE(64); + expect(senderBalance).toBe(BigInt(1000)); + }); + + it('should throw on source mismatch', async () => { + const sender = await newAccountWithLamports(rpc, 1e9); + const recipient = Keypair.generate(); + const wrongSource = Keypair.generate().publicKey; + + const recipientAta = await getOrCreateAtaInterface( + rpc, + payer, + mint, + recipient.publicKey, + ); + + await expect( + transferInterface( + rpc, + payer, + wrongSource, + mint, + recipientAta.parsed.address, + sender, + BigInt(100), + ), + ).rejects.toThrow('Source mismatch'); + }); + + it('should throw on insufficient balance', async () => { + const sender = await newAccountWithLamports(rpc, 1e9); + const recipient = Keypair.generate(); + + // Mint small amount + await mintTo( + rpc, + payer, + mint, + sender.publicKey, + mintAuthority, + bn(100), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + + const recipientAta = await getOrCreateAtaInterface( + rpc, + payer, + mint, + recipient.publicKey, + ); + + const sourceAta = getAssociatedTokenAddressInterface( + mint, + sender.publicKey, + ); + + await expect( + transferInterface( + rpc, + payer, + sourceAta, + mint, + recipientAta.parsed.address, + sender, + BigInt(99999), + CTOKEN_PROGRAM_ID, + undefined, + { splInterfaceInfos: tokenPoolInfos }, + ), + ).rejects.toThrow('Insufficient balance'); + }); + + it('should work when both sender and recipient have existing ATAs', async () => { + const sender = await newAccountWithLamports(rpc, 1e9); + const recipient = await newAccountWithLamports(rpc, 1e9); + + // Setup sender with hot balance + await mintTo( + rpc, + payer, + mint, + sender.publicKey, + mintAuthority, + bn(5000), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + const senderAta2 = getAssociatedTokenAddressInterface( + mint, + sender.publicKey, + ); + await loadAta(rpc, senderAta2, sender, mint); + + // Setup recipient with existing ATA and balance + await mintTo( + rpc, + payer, + mint, + recipient.publicKey, + mintAuthority, + bn(1000), + stateTreeInfo, + selectTokenPoolInfo(tokenPoolInfos), + ); + const recipientAta2 = getAssociatedTokenAddressInterface( + mint, + recipient.publicKey, + ); + await loadAta( + rpc, + recipientAta2, + recipient, + mint, + undefined, + undefined, + { + splInterfaceInfos: tokenPoolInfos, + }, + ); + + const sourceAta = getAssociatedTokenAddressInterface( + mint, + sender.publicKey, + ); + const destAta = getAssociatedTokenAddressInterface( + mint, + recipient.publicKey, + ); + + const recipientBalanceBefore = (await rpc.getAccountInfo( + destAta, + ))!.data.readBigUInt64LE(64); + + // Transfer + await transferInterface( + rpc, + payer, + sourceAta, + mint, + destAta, + sender, + BigInt(500), + ); + + // Verify recipient balance increased + const recipientBalanceAfter = (await rpc.getAccountInfo( + destAta, + ))!.data.readBigUInt64LE(64); + expect(recipientBalanceAfter).toBe( + recipientBalanceBefore + BigInt(500), + ); + }); + }); +}); diff --git a/light-token/tsconfig.json b/light-token/tsconfig.json new file mode 100644 index 0000000..0131b5d --- /dev/null +++ b/light-token/tsconfig.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Node", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "skipLibCheck": true, + "lib": ["ESNext"], + "types": ["node"] + }, + "include": ["tests/**/*.ts"] +} diff --git a/light-token/vitest.config.ts b/light-token/vitest.config.ts new file mode 100644 index 0000000..887ac6f --- /dev/null +++ b/light-token/vitest.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vitest/config.js'; + +export default defineConfig({ + test: { + include: ['tests/**/*.test.ts'], + testTimeout: 350000, + hookTimeout: 100000, + reporters: ['verbose'], + }, +}); From 90ed27fcf7db3693db23c363adfe0e542a2598ab Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Thu, 11 Dec 2025 19:59:44 +0000 Subject: [PATCH 07/11] Update devnet-client-create-mint.rs --- light-token/programs/tests/devnet-client-create-mint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/light-token/programs/tests/devnet-client-create-mint.rs b/light-token/programs/tests/devnet-client-create-mint.rs index c0b615b..a00d043 100644 --- a/light-token/programs/tests/devnet-client-create-mint.rs +++ b/light-token/programs/tests/devnet-client-create-mint.rs @@ -29,7 +29,7 @@ async fn test_create_rent_free_mint_with_metadata() { .expect("Failed to initialize LightClient"); // Create c-mint with metadata - let (mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + let (_mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; println!("Mint Address: {}", bs58::encode(compression_address).into_string()); println!("Decimals: 9"); From c8189866cc1d1d92f68895195f6815950d524636 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Thu, 11 Dec 2025 21:02:37 +0000 Subject: [PATCH 08/11] Add devnet-spl-to-light-transfer.rs test --- .../tests/devnet-spl-to-light-transfer.rs | 285 ++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 light-token/tests/devnet-spl-to-light-transfer.rs diff --git a/light-token/tests/devnet-spl-to-light-transfer.rs b/light-token/tests/devnet-spl-to-light-transfer.rs new file mode 100644 index 0000000..dda07ff --- /dev/null +++ b/light-token/tests/devnet-spl-to-light-transfer.rs @@ -0,0 +1,285 @@ +// SPL to light-token to light-token scenario test +// +// This test demonstrates the complete flow: +// 1. Create SPL mint manually +// 2. Create SPL interface PDA (token pool) using SDK instruction +// 3. Create SPL token account +// 4. Mint SPL tokens +// 5. Create sender's cToken ATA (compressible) +// 6. Transfer SPL tokens to cToken account +// 7. Create recipient cATA + transfer cToken→cToken in SAME transaction +// 8. Verify balances + +use anchor_spl::token::{spl_token, Mint}; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; +use light_ctoken_sdk::{ + ctoken::{derive_ctoken_ata, CreateAssociatedCTokenAccount, TransferCToken, TransferSplToCtoken}, + spl_interface::{find_spl_interface_pda_with_index, CreateSplInterfacePda}, +}; +use serde_json; +use solana_sdk::compute_budget::ComputeBudgetInstruction; +use solana_sdk::program_pack::Pack; +use solana_sdk::{signature::Keypair, signer::Signer}; +use spl_token_2022::pod::PodAccount; +use std::convert::TryFrom; +use std::env; +use std::fs; + +/// Test SPL → cToken → cToken flow with combined ATA creation + transfer +#[tokio::test(flavor = "multi_thread")] +async fn test_spl_to_ctoken_to_ctoken() { + // 1. Setup test environment - load from .env + dotenvy::dotenv().ok(); + + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + let api_key = env::var("api_key") + .expect("api_key environment variable must be set. Create a .env file or set it in your environment."); + + let config = LightClientConfig::devnet( + Some("https://devnet.helius-rpc.com".to_string()), + Some(api_key), + ); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to initialize LightClient"); + + // 2. Create SPL mint manually + let mint_keypair = Keypair::new(); + let mint = mint_keypair.pubkey(); + let decimals = 2u8; + + // Get rent for mint account + let mint_rent = rpc + .get_minimum_balance_for_rent_exemption(Mint::LEN) + .await + .unwrap(); + + // Create mint account instruction + let create_mint_account_ix = solana_sdk::system_instruction::create_account( + &payer.pubkey(), + &mint, + mint_rent, + Mint::LEN as u64, + &spl_token::ID, + ); + + // Initialize mint instruction + let initialize_mint_ix = spl_token::instruction::initialize_mint( + &spl_token::ID, + &mint, + &payer.pubkey(), // mint authority + None, // freeze authority + decimals, + ) + .unwrap(); + + rpc.create_and_send_transaction( + &[create_mint_account_ix, initialize_mint_ix], + &payer.pubkey(), + &[&payer, &mint_keypair], + ) + .await + .unwrap(); + + // 3. Create SPL interface PDA (token pool) using SDK instruction + let create_spl_interface_pda_ix = + CreateSplInterfacePda::new(payer.pubkey(), mint, anchor_spl::token::ID).instruction(); + + rpc.create_and_send_transaction(&[create_spl_interface_pda_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let mint_amount = 10_000u64; + let spl_to_ctoken_amount = 7_000u64; + let ctoken_transfer_amount = 3_000u64; + + // 4. Create SPL token account (inline) + let spl_token_account_keypair = Keypair::new(); + let token_account_rent = rpc + .get_minimum_balance_for_rent_exemption(spl_token::state::Account::LEN) + .await + .unwrap(); + let create_token_account_ix = solana_sdk::system_instruction::create_account( + &payer.pubkey(), + &spl_token_account_keypair.pubkey(), + token_account_rent, + spl_token::state::Account::LEN as u64, + &spl_token::ID, + ); + let init_token_account_ix = spl_token::instruction::initialize_account( + &spl_token::ID, + &spl_token_account_keypair.pubkey(), + &mint, + &payer.pubkey(), + ) + .unwrap(); + rpc.create_and_send_transaction( + &[create_token_account_ix, init_token_account_ix], + &payer.pubkey(), + &[&spl_token_account_keypair, &payer], + ) + .await + .unwrap(); + + // 5. Mint SPL tokens to the SPL account (inline) + let mint_to_ix = spl_token::instruction::mint_to( + &spl_token::ID, + &mint, + &spl_token_account_keypair.pubkey(), + &payer.pubkey(), + &[&payer.pubkey()], + mint_amount, + ) + .unwrap(); + rpc.create_and_send_transaction(&[mint_to_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Verify SPL account has tokens + let spl_account_data = rpc + .get_account(spl_token_account_keypair.pubkey()) + .await + .unwrap() + .unwrap(); + let spl_account = + spl_pod::bytemuck::pod_from_bytes::(&spl_account_data.data).unwrap(); + let initial_spl_balance: u64 = spl_account.amount.into(); + assert_eq!(initial_spl_balance, mint_amount); + + // 6. Create sender's cToken ATA (compressible with default 16 prepaid epochs) + let (sender_ctoken_ata, _bump) = derive_ctoken_ata(&payer.pubkey(), &mint); + let create_ata_instruction = + CreateAssociatedCTokenAccount::new(payer.pubkey(), payer.pubkey(), mint) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[create_ata_instruction], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Verify sender's cToken ATA was created + let ctoken_account_data = rpc.get_account(sender_ctoken_ata).await.unwrap().unwrap(); + assert!( + !ctoken_account_data.data.is_empty(), + "Sender cToken ATA should exist" + ); + + // 7. Transfer SPL tokens to sender's cToken account + let (spl_interface_pda, spl_interface_pda_bump) = find_spl_interface_pda_with_index(&mint, 0); + + let spl_to_ctoken_ix = TransferSplToCtoken { + amount: spl_to_ctoken_amount, + spl_interface_pda_bump, + source_spl_token_account: spl_token_account_keypair.pubkey(), + destination_ctoken_account: sender_ctoken_ata, + authority: payer.pubkey(), + mint, + payer: payer.pubkey(), + spl_interface_pda, + spl_token_program: anchor_spl::token::ID, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[spl_to_ctoken_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // 8. Create recipient cATA + transfer cToken→cToken in SAME transaction + let recipient = Keypair::new(); + let (recipient_ctoken_ata, _) = derive_ctoken_ata(&recipient.pubkey(), &mint); + + let create_recipient_ata_ix = CreateAssociatedCTokenAccount::new( + payer.pubkey(), + recipient.pubkey(), + mint, + ) + .instruction() + .unwrap(); + + let ctoken_transfer_ix = TransferCToken { + source: sender_ctoken_ata, + destination: recipient_ctoken_ata, + amount: ctoken_transfer_amount, + authority: payer.pubkey(), + max_top_up: None, + } + .instruction() + .unwrap(); + + // COMBINED: create recipient ATA + transfer in one transaction + let compute_unit_ix = ComputeBudgetInstruction::set_compute_unit_limit(10_000); + let tx_id = rpc.create_and_send_transaction( + &[compute_unit_ix, create_recipient_ata_ix, ctoken_transfer_ix], + &payer.pubkey(), + &[&payer], + ) + .await + .unwrap(); + println!("tx_id: {}", tx_id); + + // 9. Verify results + // Check SPL account balance decreased + let spl_account_data = rpc + .get_account(spl_token_account_keypair.pubkey()) + .await + .unwrap() + .unwrap(); + let spl_account = + spl_pod::bytemuck::pod_from_bytes::(&spl_account_data.data).unwrap(); + let final_spl_balance: u64 = spl_account.amount.into(); + assert_eq!( + final_spl_balance, + mint_amount - spl_to_ctoken_amount, + "SPL account balance should be 3000" + ); + + // Check sender cToken balance (7000 - 3000 = 4000) + let sender_ctoken_data = rpc.get_account(sender_ctoken_ata).await.unwrap().unwrap(); + let sender_ctoken = + spl_pod::bytemuck::pod_from_bytes::(&sender_ctoken_data.data[..165]).unwrap(); + let sender_ctoken_balance: u64 = sender_ctoken.amount.into(); + assert_eq!( + sender_ctoken_balance, + spl_to_ctoken_amount - ctoken_transfer_amount, + "Sender cToken balance should be 4000" + ); + + // Check recipient cToken balance (3000) + let recipient_ctoken_data = rpc.get_account(recipient_ctoken_ata).await.unwrap().unwrap(); + let recipient_ctoken = + spl_pod::bytemuck::pod_from_bytes::(&recipient_ctoken_data.data[..165]).unwrap(); + let recipient_ctoken_balance: u64 = recipient_ctoken.amount.into(); + assert_eq!( + recipient_ctoken_balance, ctoken_transfer_amount, + "Recipient cToken balance should be 3000" + ); + + println!("SPL → cToken → cToken transfer completed!"); + println!(" - Created SPL mint: {}", mint); + println!(" - Minted {} tokens to SPL account", mint_amount); + println!(" - Transferred {} SPL → sender cToken", spl_to_ctoken_amount); + println!( + " - Transferred {} cToken → recipient cToken (in same tx as ATA creation)", + ctoken_transfer_amount + ); + println!("\nFinal balances:"); + println!(" - SPL account: {}", final_spl_balance); + println!(" - Sender cToken: {}", sender_ctoken_balance); + println!(" - Recipient cToken: {}", recipient_ctoken_balance); + + println!("\nTest passed!"); +} + +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::try_from(&bytes[..])?) +} \ No newline at end of file From fb974d78669ccfb1ab746d0d4617e6d81edc01c7 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 12 Dec 2025 08:43:52 +0000 Subject: [PATCH 09/11] Fix CI: Update c-token references to light-token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update GitHub Actions workflow and documentation to reference the renamed light-token directory. The directory was previously renamed from c-token to light-token, but CI configuration was not updated, causing build failures. Changes: - Update rust-tests.yml matrix to use light-token instead of c-token - Update README.md section heading and directory path - Update package.json and package-lock.json with new package name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/rust-tests.yml | 4 ++-- README.md | 18 +++++++++--------- light-token/package-lock.json | 4 ++-- light-token/package.json | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 6d3a824..4befe89 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -30,9 +30,9 @@ jobs: - counter/pinocchio - account-comparison - zk-id - - c-token + - light-token include: - - example: c-token + - example: light-token test-command: cargo test - example: basic-operations/native package: native-program-burn diff --git a/README.md b/README.md index c1f0e75..96cb1e9 100644 --- a/README.md +++ b/README.md @@ -42,15 +42,15 @@ Full compressed account lifecycle (create, increment, decrement, reset, close): - **[zk-id](./zk-id)** - A minimal zk id Solana program that uses zero-knowledge proofs for identity verification with compressed accounts. -### cToken Examples - -- **[c-token](./c-token/)** - Client examples for compressed tokens (cToken) including: - - Create compressed mint (cMint) with metadata - - Create compressed token account (cToken) - - Create compressed associated token account (cATA) - - Mint tokens to cToken account - - Transfer between SPL and cToken accounts - - Close cToken account +### Light Token Standard Examples + +- **[light-token](./light-token/)** - Client examples for light tokens including: + - Create mint with metadata + - Create token account + - Create associated token account + - Mint tokens to light-token account + - Transfer between SPL and light-token accounts + - Close light-token account ## Light Protocol dependencies diff --git a/light-token/package-lock.json b/light-token/package-lock.json index 9b097c7..64a401d 100644 --- a/light-token/package-lock.json +++ b/light-token/package-lock.json @@ -1,11 +1,11 @@ { - "name": "c-token-tests", + "name": "light-token-tests", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "c-token-tests", + "name": "light-token-tests", "version": "1.0.0", "dependencies": { "@lightprotocol/compressed-token": "file:../../light-protocol/js/compressed-token", diff --git a/light-token/package.json b/light-token/package.json index a795ef7..0442d83 100644 --- a/light-token/package.json +++ b/light-token/package.json @@ -1,7 +1,7 @@ { - "name": "c-token-tests", + "name": "light-token-tests", "version": "1.0.0", - "description": "TypeScript tests for c-token SDK examples", + "description": "TypeScript tests for light-token SDK examples", "type": "module", "scripts": { "test": "vitest run --reporter=verbose", From 9d63cb08fbcef2d688d5d79c933538dc373b8da0 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 12 Dec 2025 08:49:05 +0000 Subject: [PATCH 10/11] fix(light-token): remove local path patches for CI compatibility Remove [patch.crates-io] section so CI uses published crates instead of local paths that don't exist in the CI environment. --- light-token/Cargo.toml | 48 ++++-------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/light-token/Cargo.toml b/light-token/Cargo.toml index cdc9f87..069ff13 100644 --- a/light-token/Cargo.toml +++ b/light-token/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "c-token-examples" +name = "light-token-examples" version = "0.1.0" description = "Client examples for compressed tokens (cToken) using Light Protocol" repository = "https://github.com/Lightprotocol/program-examples" @@ -8,40 +8,8 @@ edition = "2021" [lib] crate-type = ["cdylib", "lib"] -name = "c_token_examples" -path = "programs/src/lib.rs" - -[[test]] -name = "client-create-cmint" -path = "programs/tests/client-create-cmint.rs" - -[[test]] -name = "client-create-ctoken" -path = "programs/tests/client-create-ctoken.rs" - -[[test]] -name = "client-create-cata" -path = "programs/tests/client-create-cata.rs" - -[[test]] -name = "client-mint-to-ctoken" -path = "programs/tests/client-mint-to-ctoken.rs" - -[[test]] -name = "client-close-ctoken" -path = "programs/tests/client-close-ctoken.rs" - -[[test]] -name = "client-transfer-interface" -path = "programs/tests/client-transfer-interface.rs" - -[[test]] -name = "devnet-spl-ctoken-transfer" -path = "programs/tests/devnet-spl-ctoken-transfer.rs" - -[[test]] -name = "devnet-client-create-mint" -path = "programs/tests/devnet-client-create-mint.rs" +name = "light_token_examples" +path = "src/lib.rs" [dependencies] # Light Protocol SDK dependencies @@ -56,8 +24,7 @@ solana-program = "2.2" borsh = "0.10.4" [dev-dependencies] -# Light Protocol test dependencies -light-program-test = { version = "0.17.1", features = ["v2", "devenv"] } +# Light Protocol client light-client = "0.17.2" # Solana dependencies @@ -84,10 +51,3 @@ check-cfg = [ 'cfg(target_os, values("solana"))', 'cfg(feature, values("frozen-abi", "no-entrypoint"))', ] - -[patch.crates-io] -light-ctoken-sdk = { path = "../../light-protocol/sdk-libs/ctoken-sdk" } -light-ctoken-interface = { path = "../../light-protocol/program-libs/ctoken-interface" } -light-sdk = { path = "../../light-protocol/sdk-libs/sdk" } -light-program-test = { path = "../../light-protocol/sdk-libs/program-test" } -light-client = { path = "../../light-protocol/sdk-libs/client" } From 3ab722f97df71c6670c53d59682f02dc7d0231e0 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Fri, 12 Dec 2025 08:56:18 +0000 Subject: [PATCH 11/11] refactor(light-token): restructure src and tests directories - Move source files from programs/src/ to src/ - Move test files from programs/tests/ to tests/ - Rename files for clarity (e.g., create_cmint.rs -> create_mint.rs) --- .../programs/tests/client-create-cmint.rs | 96 ----- .../programs/tests/client-create-ctoken.rs | 115 ------ .../programs/tests/client-mint-to-ctoken.rs | 181 ---------- .../tests/client-transfer-interface.rs | 280 --------------- .../tests/devnet-spl-ctoken-transfer.rs | 328 ------------------ light-token/{programs => }/src/close.rs | 0 .../src/create_ata2.rs => src/create_ata.rs} | 0 .../create_cmint.rs => src/create_mint.rs} | 2 +- .../src/create_token_account.rs | 0 light-token/{programs => }/src/lib.rs | 16 +- .../src/mint_to_ctoken.rs => src/mint_to.rs} | 0 light-token/{programs => }/src/transfer.rs | 0 .../{programs => }/src/transfer_interface.rs | 0 .../transfer_spl_to_light_token.rs} | 0 .../client-close-ctoken.rs => tests/close.rs} | 122 ++++--- .../create-ata.rs} | 101 ++++-- .../create-mint.rs} | 43 +-- light-token/tests/create-token-account.rs | 159 +++++++++ .../mint-to.rs} | 71 ++-- light-token/tests/transfer-interface.rs | 226 ++++++++++++ 20 files changed, 601 insertions(+), 1139 deletions(-) delete mode 100644 light-token/programs/tests/client-create-cmint.rs delete mode 100644 light-token/programs/tests/client-create-ctoken.rs delete mode 100644 light-token/programs/tests/client-mint-to-ctoken.rs delete mode 100644 light-token/programs/tests/client-transfer-interface.rs delete mode 100644 light-token/programs/tests/devnet-spl-ctoken-transfer.rs rename light-token/{programs => }/src/close.rs (100%) rename light-token/{programs/src/create_ata2.rs => src/create_ata.rs} (100%) rename light-token/{programs/src/create_cmint.rs => src/create_mint.rs} (99%) rename light-token/{programs => }/src/create_token_account.rs (100%) rename light-token/{programs => }/src/lib.rs (98%) rename light-token/{programs/src/mint_to_ctoken.rs => src/mint_to.rs} (100%) rename light-token/{programs => }/src/transfer.rs (100%) rename light-token/{programs => }/src/transfer_interface.rs (100%) rename light-token/{programs/src/transfer_spl_ctoken.rs => src/transfer_spl_to_light_token.rs} (100%) rename light-token/{programs/tests/client-close-ctoken.rs => tests/close.rs} (51%) rename light-token/{programs/tests/client-create-cata.rs => tests/create-ata.rs} (50%) rename light-token/{programs/tests/devnet-client-create-mint.rs => tests/create-mint.rs} (82%) create mode 100644 light-token/tests/create-token-account.rs rename light-token/{programs/tests/devnet-client-mint-to-ctoken.rs => tests/mint-to.rs} (83%) create mode 100644 light-token/tests/transfer-interface.rs diff --git a/light-token/programs/tests/client-create-cmint.rs b/light-token/programs/tests/client-create-cmint.rs deleted file mode 100644 index 540e0ae..0000000 --- a/light-token/programs/tests/client-create-cmint.rs +++ /dev/null @@ -1,96 +0,0 @@ -// Test for: client-create-cmint.mdx - -use light_client::indexer::{AddressWithTree, Indexer}; -use light_client::rpc::Rpc; -use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams}; -use light_ctoken_interface::instructions::extensions::token_metadata::TokenMetadataInstructionData; -use light_ctoken_interface::instructions::extensions::ExtensionInstructionData; -use light_ctoken_interface::state::AdditionalMetadata; -use light_program_test::{LightProgramTest, ProgramTestConfig}; -use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; - - -#[tokio::test(flavor = "multi_thread")] -async fn test_create_rent_free_mint_with_metadata() { - let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) - .await - .unwrap(); - - let payer = rpc.get_payer().insecure_clone(); - - // Create c-mint with metadata - let (_mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; - -} -pub async fn create_compressed_mint( - rpc: &mut R, - payer: &Keypair, - decimals: u8, -) -> (Pubkey, [u8; 32]) { - let mint_signer = Keypair::new(); - let address_tree = rpc.get_address_tree_v2(); - let output_queue = rpc.get_random_state_tree_info().unwrap().queue; - - // Derive address - let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( - &mint_signer.pubkey(), - &address_tree.tree, - ); - - let mint_pda = - light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; - - // Get validity proof for the address - let rpc_result = rpc - .get_validity_proof( - vec![], - vec![AddressWithTree { - address: compression_address, - tree: address_tree.tree, - }], - None, - ) - .await - .unwrap() - .value; - - // Build params with token metadata - let params = CreateCMintParams { - decimals, - address_merkle_tree_root_index: rpc_result.addresses[0].root_index, - mint_authority: payer.pubkey(), - proof: rpc_result.proof.0.unwrap(), - compression_address, - mint: mint_pda, - freeze_authority: None, - extensions: Some(vec![ExtensionInstructionData::TokenMetadata( - TokenMetadataInstructionData { - update_authority: Some(payer.pubkey().to_bytes().into()), - name: b"Rent Free Token".to_vec(), - symbol: b"RFT".to_vec(), - uri: b"https://example.com/metadata.json".to_vec(), - additional_metadata: Some(vec![AdditionalMetadata { - key: b"type".to_vec(), - value: b"compressed".to_vec(), - }]), - }, - )]), - }; - - // Create instruction - let create_cmint = CreateCMint::new( - params, - mint_signer.pubkey(), - payer.pubkey(), - address_tree.tree, - output_queue, - ); - let instruction = create_cmint.instruction().unwrap(); - - // Send transaction - rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) - .await - .unwrap(); - - (mint_pda, compression_address) -} diff --git a/light-token/programs/tests/client-create-ctoken.rs b/light-token/programs/tests/client-create-ctoken.rs deleted file mode 100644 index 3bd58a3..0000000 --- a/light-token/programs/tests/client-create-ctoken.rs +++ /dev/null @@ -1,115 +0,0 @@ -// Test for: client-create-ctoken.mdx - - -use borsh::BorshDeserialize; -use light_client::rpc::Rpc; -use light_ctoken_sdk::ctoken::CreateCTokenAccount; -use light_ctoken_interface::state::CToken; -use light_program_test::{LightProgramTest, ProgramTestConfig}; -use solana_sdk::{signature::Keypair, signer::Signer}; -use light_client::indexer::{AddressWithTree, Indexer}; -use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams}; -use solana_sdk::{pubkey::Pubkey}; - - -#[tokio::test(flavor = "multi_thread")] -async fn test_create_ctoken_account() { - // Create simulated test environment with Light programs - let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) - .await - .unwrap(); - - let payer = rpc.get_payer().insecure_clone(); - - // Create compressed mint first (prerequisite) - let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; - - // Step 1: Generate new keypair for the cToken account - let account = Keypair::new(); - let owner = payer.pubkey(); - - // Step 2: Build instruction using SDK builder - let instruction = CreateCTokenAccount::new( - payer.pubkey(), - account.pubkey(), - mint, - owner, - ) - .instruction() - .unwrap(); - - // Step 3: Send transaction - rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer, &account]) - .await - .unwrap(); - - // Step 4: Verify account creation - let account_data = rpc.get_account(account.pubkey()).await.unwrap().unwrap(); - let ctoken_state = CToken::deserialize(&mut &account_data.data[..]).unwrap(); - - assert_eq!(ctoken_state.mint, mint.to_bytes()); - assert_eq!(ctoken_state.owner, owner.to_bytes()); - assert_eq!(ctoken_state.amount, 0); - -} -pub async fn create_compressed_mint( - rpc: &mut R, - payer: &Keypair, - decimals: u8, -) -> (Pubkey, [u8; 32]) { - let mint_signer = Keypair::new(); - let address_tree = rpc.get_address_tree_v2(); - let output_queue = rpc.get_random_state_tree_info().unwrap().queue; - - // Derive compression address - let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( - &mint_signer.pubkey(), - &address_tree.tree, - ); - - let mint_pda = - light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; - - // Get validity proof for the address - let rpc_result = rpc - .get_validity_proof( - vec![], - vec![AddressWithTree { - address: compression_address, - tree: address_tree.tree, - }], - None, - ) - .await - .unwrap() - .value; - - // Build params - let params = CreateCMintParams { - decimals, - address_merkle_tree_root_index: rpc_result.addresses[0].root_index, - mint_authority: payer.pubkey(), - proof: rpc_result.proof.0.unwrap(), - compression_address, - mint: mint_pda, - freeze_authority: None, - extensions: None, - }; - - // Create instruction - let create_cmint = CreateCMint::new( - params, - mint_signer.pubkey(), - payer.pubkey(), - address_tree.tree, - output_queue, - ); - let instruction = create_cmint.instruction().unwrap(); - - // Send transaction - rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) - .await - .unwrap(); - - (mint_pda, compression_address) -} diff --git a/light-token/programs/tests/client-mint-to-ctoken.rs b/light-token/programs/tests/client-mint-to-ctoken.rs deleted file mode 100644 index ca3b6dd..0000000 --- a/light-token/programs/tests/client-mint-to-ctoken.rs +++ /dev/null @@ -1,181 +0,0 @@ -// Test for: client-mint-to-ctoken.mdx - -use borsh::BorshDeserialize; -use light_client::indexer::{AddressWithTree, Indexer}; -use light_client::rpc::Rpc; -use light_ctoken_sdk::ctoken::{ - CreateCMint, CreateCMintParams, CreateCTokenAccount, MintToCToken, - MintToCTokenParams, -}; -use light_ctoken_interface::instructions::mint_action::CompressedMintWithContext; -use light_ctoken_interface::state::{CToken, CompressedMint}; -use light_program_test::{LightProgramTest, ProgramTestConfig}; -use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; - - -#[tokio::test(flavor = "multi_thread")] -async fn test_mint_to_ctoken_client() { - // Step 1: Setup test environment - let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) - .await - .unwrap(); - - let payer = rpc.get_payer().insecure_clone(); - let mint_authority = payer.pubkey(); - - // Step 2: Create compressed mint (prerequisite) - let (mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; - - // Step 3: Create ctoken account (prerequisite) - let ctoken_account = Keypair::new(); - let owner = payer.pubkey(); - let create_account_ix = CreateCTokenAccount::new( - payer.pubkey(), - ctoken_account.pubkey(), - mint, - owner, - ) - .instruction() - .unwrap(); - - rpc.create_and_send_transaction( - &[create_account_ix], - &payer.pubkey(), - &[&payer, &ctoken_account], - ) - .await - .unwrap(); - - // Step 4: Get compressed mint account to build CompressedMintWithContext - let compressed_mint_account = rpc - .get_compressed_account(compression_address, None) - .await - .unwrap() - .value - .expect("Compressed mint should exist"); - - // Step 5: Get validity proof for the mint operation - let rpc_result = rpc - .get_validity_proof(vec![compressed_mint_account.hash], vec![], None) - .await - .unwrap() - .value; - - // Step 6: Deserialize compressed mint data - let compressed_mint = CompressedMint::deserialize( - &mut compressed_mint_account.data.unwrap().data.as_slice(), - ) - .unwrap(); - - // Step 7: Build CompressedMintWithContext - let compressed_mint_with_context = CompressedMintWithContext { - address: compression_address, - leaf_index: compressed_mint_account.leaf_index, - prove_by_index: true, - root_index: rpc_result.accounts[0] - .root_index - .root_index() - .unwrap_or_default(), - mint: compressed_mint.try_into().unwrap(), - }; - - let amount = 1_000_000_000u64; // 1 token with 9 decimals - - // Step 8: Build mint params - let params = MintToCTokenParams::new( - compressed_mint_with_context, - amount, - mint_authority, - rpc_result.proof, - ); - - // Step 9: Build instruction using SDK builder - let instruction = MintToCToken::new( - params, - payer.pubkey(), - compressed_mint_account.tree_info.tree, - compressed_mint_account.tree_info.queue, - compressed_mint_account.tree_info.queue, - vec![ctoken_account.pubkey()], - ) - .instruction() - .unwrap(); - - // Step 10: Send transaction - rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer]) - .await - .unwrap(); - - // Step 11: Verify tokens were minted - let ctoken_account_data = rpc - .get_account(ctoken_account.pubkey()) - .await - .unwrap() - .unwrap(); - - let ctoken_state = CToken::deserialize(&mut &ctoken_account_data.data[..]).unwrap(); - assert_eq!(ctoken_state.amount, amount, "Token amount should match"); - assert_eq!(ctoken_state.mint, mint.to_bytes(), "Mint should match"); - assert_eq!(ctoken_state.owner, owner.to_bytes(), "Owner should match"); -} -pub async fn create_compressed_mint( - rpc: &mut R, - payer: &Keypair, - decimals: u8, -) -> (Pubkey, [u8; 32]) { - let mint_signer = Keypair::new(); - let address_tree = rpc.get_address_tree_v2(); - let output_queue = rpc.get_random_state_tree_info().unwrap().queue; - - // Derive compression address - let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( - &mint_signer.pubkey(), - &address_tree.tree, - ); - - let mint_pda = - light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; - - // Get validity proof for the address - let rpc_result = rpc - .get_validity_proof( - vec![], - vec![AddressWithTree { - address: compression_address, - tree: address_tree.tree, - }], - None, - ) - .await - .unwrap() - .value; - - // Build params - let params = CreateCMintParams { - decimals, - address_merkle_tree_root_index: rpc_result.addresses[0].root_index, - mint_authority: payer.pubkey(), - proof: rpc_result.proof.0.unwrap(), - compression_address, - mint: mint_pda, - freeze_authority: None, - extensions: None, - }; - - // Create instruction - let create_cmint = CreateCMint::new( - params, - mint_signer.pubkey(), - payer.pubkey(), - address_tree.tree, - output_queue, - ); - let instruction = create_cmint.instruction().unwrap(); - - // Send transaction - rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) - .await - .unwrap(); - - (mint_pda, compression_address) -} diff --git a/light-token/programs/tests/client-transfer-interface.rs b/light-token/programs/tests/client-transfer-interface.rs deleted file mode 100644 index 28f5408..0000000 --- a/light-token/programs/tests/client-transfer-interface.rs +++ /dev/null @@ -1,280 +0,0 @@ -// Test for: transfer-interface.mdx - -use borsh::BorshDeserialize; -use light_client::rpc::Rpc; -use light_ctoken_sdk::ctoken::{ - derive_ctoken_ata, CreateAssociatedCTokenAccount, TransferCToken, - TransferSplToCtoken, -}; -use light_ctoken_interface::state::CToken; -use light_program_test::{LightProgramTest, ProgramTestConfig}; -use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; -use spl_token_2022::state::Account as TokenAccount; -use solana_program::program_pack::Pack; -use anchor_spl; - - -#[tokio::test(flavor = "multi_thread")] -async fn test_client_transfer_spl_to_ctoken_to_ctoken() { - // Step 1: Setup test environment - let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) - .await - .unwrap(); - - let payer = rpc.get_payer().insecure_clone(); - let sender = Keypair::new(); - airdrop_lamports(&mut rpc, &sender.pubkey(), 1_000_000_000) - .await - .unwrap(); - - // Step 2: Create SPL mint - let mint = create_mint_helper(&mut rpc, &payer).await; - let initial_amount = 10000u64; - let spl_to_ctoken_amount = 7000u64; - let ctoken_transfer_amount = 3000u64; - - // Step 3: Create SPL token account and mint tokens - let spl_token_account = Keypair::new(); - create_token_account(&mut rpc, &mint, &spl_token_account, &sender) - .await - .unwrap(); - - mint_spl_tokens( - &mut rpc, - &mint, - &spl_token_account.pubkey(), - &payer, - initial_amount, - ) - .await - .unwrap(); - - // Step 4: Create sender cToken ATA - let (sender_ctoken_ata, _) = derive_ctoken_ata(&sender.pubkey(), &mint); - - let create_sender_ata = CreateAssociatedCTokenAccount::new( - payer.pubkey(), - sender.pubkey(), - mint, - ) - .instruction() - .unwrap(); - - rpc.create_and_send_transaction(&[create_sender_ata], &payer.pubkey(), &[&payer]) - .await - .unwrap(); - - // Step 5: Convert SPL tokens to cToken (7000 tokens) - let (spl_interface_pda, spl_interface_pda_bump) = - light_ctoken_sdk::ctoken::get_spl_interface_pda_and_bump(&mint); - let spl_token_program = anchor_spl::token::ID; - - let spl_to_ctoken_instruction = TransferSplToCtoken { - amount: spl_to_ctoken_amount, - spl_interface_pda_bump, - source_spl_token_account: spl_token_account.pubkey(), - destination_ctoken_account: sender_ctoken_ata, - authority: sender.pubkey(), - mint, - payer: payer.pubkey(), - spl_interface_pda, - spl_token_program, - } - .instruction() - .unwrap(); - - rpc.create_and_send_transaction( - &[spl_to_ctoken_instruction], - &payer.pubkey(), - &[&payer, &sender], - ) - .await - .unwrap(); - - // Step 6: Create recipient cToken ATA - let recipient = Keypair::new(); - airdrop_lamports(&mut rpc, &recipient.pubkey(), 1_000_000_000) - .await - .unwrap(); - - let (recipient_ctoken_ata, _) = derive_ctoken_ata(&recipient.pubkey(), &mint); - - let create_recipient_ata = CreateAssociatedCTokenAccount::new( - payer.pubkey(), - recipient.pubkey(), - mint, - ) - .instruction() - .unwrap(); - - rpc.create_and_send_transaction(&[create_recipient_ata], &payer.pubkey(), &[&payer]) - .await - .unwrap(); - - // Step 7: Transfer cToken from sender to recipient (3000 tokens) - let transfer_instruction = TransferCToken { - source: sender_ctoken_ata, - destination: recipient_ctoken_ata, - amount: ctoken_transfer_amount, - authority: sender.pubkey(), - max_top_up: None, - } - .instruction() - .unwrap(); - - rpc.create_and_send_transaction( - &[transfer_instruction], - &payer.pubkey(), - &[&payer, &sender], - ) - .await - .unwrap(); - - // Step 8: Verify balances - let sender_account_data = rpc.get_account(sender_ctoken_ata).await.unwrap().unwrap(); - let sender_state = CToken::deserialize(&mut &sender_account_data.data[..]).unwrap(); - - let recipient_account_data = rpc - .get_account(recipient_ctoken_ata) - .await - .unwrap() - .unwrap(); - let recipient_state = CToken::deserialize(&mut &recipient_account_data.data[..]).unwrap(); - - // Sender should have: 7000 (converted) - 3000 (transferred) = 4000 - assert_eq!( - sender_state.amount, - spl_to_ctoken_amount - ctoken_transfer_amount, - "Sender cToken balance should be 4000" - ); - - // Recipient should have: 3000 (received) - assert_eq!( - recipient_state.amount, ctoken_transfer_amount, - "Recipient cToken balance should be 3000" - ); - - // Verify SPL account still has remaining tokens: 10000 - 7000 = 3000 - let spl_account_data = rpc - .get_account(spl_token_account.pubkey()) - .await - .unwrap() - .unwrap(); - let spl_account = TokenAccount::unpack(&spl_account_data.data).unwrap(); - assert_eq!( - spl_account.amount, - initial_amount - spl_to_ctoken_amount, - "SPL account should have 3000 remaining" - ); -} - -// Helper functions inlined from light_test_utils (not available on crates.io) - -async fn airdrop_lamports( - rpc: &mut R, - destination_pubkey: &Pubkey, - lamports: u64, -) -> Result<(), light_client::rpc::errors::RpcError> { - let payer = rpc.get_payer().insecure_clone(); - let transfer_ix = solana_sdk::system_instruction::transfer( - &payer.pubkey(), - destination_pubkey, - lamports, - ); - rpc.create_and_send_transaction(&[transfer_ix], &payer.pubkey(), &[&payer]) - .await - .map(|_| ()) -} - -async fn create_mint_helper(rpc: &mut R, payer: &Keypair) -> Pubkey { - let mint = Keypair::new(); - let rent = rpc - .get_minimum_balance_for_rent_exemption(anchor_spl::token::Mint::LEN) - .await - .unwrap(); - - let create_account_ix = solana_sdk::system_instruction::create_account( - &payer.pubkey(), - &mint.pubkey(), - rent, - anchor_spl::token::Mint::LEN as u64, - &spl_token::ID, - ); - - let init_mint_ix = spl_token::instruction::initialize_mint( - &spl_token::ID, - &mint.pubkey(), - &payer.pubkey(), - Some(&payer.pubkey()), - 2, - ) - .unwrap(); - - rpc.create_and_send_transaction( - &[create_account_ix, init_mint_ix], - &payer.pubkey(), - &[payer, &mint], - ) - .await - .unwrap(); - - mint.pubkey() -} - -async fn create_token_account( - rpc: &mut R, - mint: &Pubkey, - account_keypair: &Keypair, - owner: &Keypair, -) -> Result<(), light_client::rpc::errors::RpcError> { - let rent = rpc - .get_minimum_balance_for_rent_exemption(spl_token::state::Account::LEN) - .await - .unwrap(); - - let create_account_ix = solana_sdk::system_instruction::create_account( - &owner.pubkey(), - &account_keypair.pubkey(), - rent, - spl_token::state::Account::LEN as u64, - &spl_token::ID, - ); - - let init_account_ix = spl_token::instruction::initialize_account( - &spl_token::ID, - &account_keypair.pubkey(), - mint, - &owner.pubkey(), - ) - .unwrap(); - - rpc.create_and_send_transaction( - &[create_account_ix, init_account_ix], - &owner.pubkey(), - &[account_keypair, owner], - ) - .await - .map(|_| ()) -} - -async fn mint_spl_tokens( - rpc: &mut R, - mint: &Pubkey, - token_account: &Pubkey, - mint_authority: &Keypair, - amount: u64, -) -> Result<(), light_client::rpc::errors::RpcError> { - let mint_to_ix = spl_token::instruction::mint_to( - &spl_token::ID, - mint, - token_account, - &mint_authority.pubkey(), - &[&mint_authority.pubkey()], - amount, - ) - .unwrap(); - - rpc.create_and_send_transaction(&[mint_to_ix], &mint_authority.pubkey(), &[mint_authority]) - .await - .map(|_| ()) -} diff --git a/light-token/programs/tests/devnet-spl-ctoken-transfer.rs b/light-token/programs/tests/devnet-spl-ctoken-transfer.rs deleted file mode 100644 index d525440..0000000 --- a/light-token/programs/tests/devnet-spl-ctoken-transfer.rs +++ /dev/null @@ -1,328 +0,0 @@ -// Devnet example: SPL token → cToken → cToken transfer -// -// This example demonstrates the full flow on devnet: -// 1. Create SPL mint -// 2. Mint SPL tokens -// 3. Transfer SPL tokens to cToken -// 4. Transfer cToken to another cToken account -// -// Run with: -// cargo test devnet_spl_to_ctoken --release -- --ignored --nocapture -// -// Requires: -// - KEYPAIR_PATH env var (default: ~/.config/solana/id.json) -// - PHOTON_URL env var (default: https://photon-devnet.helius.dev) -// - Devnet SOL in the keypair - -use borsh::BorshDeserialize; -use light_client::rpc::{LightClient, LightClientConfig, Rpc}; -use light_ctoken_sdk::ctoken::{ - derive_ctoken_ata, CreateAssociatedCTokenAccount, TransferCToken, TransferSplToCtoken, -}; -use light_ctoken_interface::state::CToken; -use solana_program::program_pack::Pack; -use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; -use spl_token_2022::state::Account as TokenAccount; -use std::env; - -#[tokio::test(flavor = "multi_thread")] -#[ignore] // Requires devnet SOL and indexer - run with --ignored flag -async fn test_devnet_spl_to_ctoken_to_ctoken() { - // Step 1: Setup devnet connection - let keypair_path = env::var("KEYPAIR_PATH") - .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); - - let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); - println!("Using payer: {}", payer.pubkey()); - - let photon_url = env::var("PHOTON_URL") - .unwrap_or_else(|_| "https://photon-devnet.helius.dev".to_string()); - - let config = LightClientConfig::devnet(Some(photon_url), None); - let mut rpc = LightClient::new_with_retry(config, None) - .await - .expect("Failed to connect to devnet"); - - println!("Connected to devnet"); - - // Step 2: Create SPL mint - let mint = create_mint_helper(&mut rpc, &payer).await; - println!("Created SPL mint: {}", mint); - - let initial_amount = 10000u64; - let spl_to_ctoken_amount = 7000u64; - let ctoken_transfer_amount = 3000u64; - - // Step 3: Create SPL token account and mint tokens - let spl_token_account = Keypair::new(); - create_token_account(&mut rpc, &mint, &spl_token_account, &payer) - .await - .expect("Failed to create token account"); - println!("Created SPL token account: {}", spl_token_account.pubkey()); - - mint_spl_tokens( - &mut rpc, - &mint, - &spl_token_account.pubkey(), - &payer, - initial_amount, - ) - .await - .expect("Failed to mint SPL tokens"); - println!("Minted {} SPL tokens", initial_amount); - - // Step 4: Create sender cToken ATA - let sender = Keypair::new(); - let (sender_ctoken_ata, _) = derive_ctoken_ata(&sender.pubkey(), &mint); - - let create_sender_ata = CreateAssociatedCTokenAccount::new( - payer.pubkey(), - sender.pubkey(), - mint, - ) - .instruction() - .expect("Failed to create sender ATA instruction"); - - rpc.create_and_send_transaction(&[create_sender_ata], &payer.pubkey(), &[&payer]) - .await - .expect("Failed to create sender cToken ATA"); - println!("Created sender cToken ATA: {}", sender_ctoken_ata); - - // Step 5: Convert SPL tokens to cToken (7000 tokens) - let (spl_interface_pda, spl_interface_pda_bump) = - light_ctoken_sdk::ctoken::get_spl_interface_pda_and_bump(&mint); - let spl_token_program = anchor_spl::token::ID; - - let spl_to_ctoken_instruction = TransferSplToCtoken { - amount: spl_to_ctoken_amount, - spl_interface_pda_bump, - source_spl_token_account: spl_token_account.pubkey(), - destination_ctoken_account: sender_ctoken_ata, - authority: payer.pubkey(), // payer owns the SPL token account - mint, - payer: payer.pubkey(), - spl_interface_pda, - spl_token_program, - } - .instruction() - .expect("Failed to create SPL to cToken instruction"); - - rpc.create_and_send_transaction( - &[spl_to_ctoken_instruction], - &payer.pubkey(), - &[&payer], - ) - .await - .expect("Failed to transfer SPL to cToken"); - println!( - "Transferred {} SPL tokens to cToken", - spl_to_ctoken_amount - ); - - // Step 6: Create recipient cToken ATA - let recipient = Keypair::new(); - let (recipient_ctoken_ata, _) = derive_ctoken_ata(&recipient.pubkey(), &mint); - - let create_recipient_ata = CreateAssociatedCTokenAccount::new( - payer.pubkey(), - recipient.pubkey(), - mint, - ) - .instruction() - .expect("Failed to create recipient ATA instruction"); - - rpc.create_and_send_transaction(&[create_recipient_ata], &payer.pubkey(), &[&payer]) - .await - .expect("Failed to create recipient cToken ATA"); - println!("Created recipient cToken ATA: {}", recipient_ctoken_ata); - - // Step 7: Transfer cToken from sender to recipient (3000 tokens) - let transfer_instruction = TransferCToken { - source: sender_ctoken_ata, - destination: recipient_ctoken_ata, - amount: ctoken_transfer_amount, - authority: sender.pubkey(), - max_top_up: None, - } - .instruction() - .expect("Failed to create cToken transfer instruction"); - - rpc.create_and_send_transaction( - &[transfer_instruction], - &payer.pubkey(), - &[&payer, &sender], - ) - .await - .expect("Failed to transfer cToken"); - println!( - "Transferred {} cTokens from sender to recipient", - ctoken_transfer_amount - ); - - // Step 8: Verify balances - let sender_account_data = rpc - .get_account(sender_ctoken_ata) - .await - .expect("Failed to get sender account") - .expect("Sender account not found"); - let sender_state = CToken::deserialize(&mut &sender_account_data.data[..]) - .expect("Failed to deserialize sender cToken"); - - let recipient_account_data = rpc - .get_account(recipient_ctoken_ata) - .await - .expect("Failed to get recipient account") - .expect("Recipient account not found"); - let recipient_state = CToken::deserialize(&mut &recipient_account_data.data[..]) - .expect("Failed to deserialize recipient cToken"); - - // Sender should have: 7000 (converted) - 3000 (transferred) = 4000 - assert_eq!( - sender_state.amount, - spl_to_ctoken_amount - ctoken_transfer_amount, - "Sender cToken balance should be 4000" - ); - println!( - "Sender cToken balance: {} (expected: {})", - sender_state.amount, - spl_to_ctoken_amount - ctoken_transfer_amount - ); - - // Recipient should have: 3000 (received) - assert_eq!( - recipient_state.amount, ctoken_transfer_amount, - "Recipient cToken balance should be 3000" - ); - println!( - "Recipient cToken balance: {} (expected: {})", - recipient_state.amount, ctoken_transfer_amount - ); - - // Verify SPL account still has remaining tokens: 10000 - 7000 = 3000 - let spl_account_data = rpc - .get_account(spl_token_account.pubkey()) - .await - .expect("Failed to get SPL account") - .expect("SPL account not found"); - let spl_account = TokenAccount::unpack(&spl_account_data.data) - .expect("Failed to unpack SPL account"); - assert_eq!( - spl_account.amount, - initial_amount - spl_to_ctoken_amount, - "SPL account should have 3000 remaining" - ); - println!( - "SPL account balance: {} (expected: {})", - spl_account.amount, - initial_amount - spl_to_ctoken_amount - ); - - println!("\nAll assertions passed!"); -} - -// Helper: Load keypair from file -fn load_keypair(path: &str) -> Result> { - let path = if path.starts_with("~") { - path.replace("~", &env::var("HOME").unwrap_or_default()) - } else { - path.to_string() - }; - let file = std::fs::read_to_string(&path)?; - let bytes: Vec = serde_json::from_str(&file)?; - Ok(Keypair::from_bytes(&bytes)?) -} - -// Helper: Create SPL mint -async fn create_mint_helper(rpc: &mut R, payer: &Keypair) -> Pubkey { - let mint = Keypair::new(); - let rent = rpc - .get_minimum_balance_for_rent_exemption(anchor_spl::token::Mint::LEN) - .await - .expect("Failed to get rent"); - - let create_account_ix = solana_sdk::system_instruction::create_account( - &payer.pubkey(), - &mint.pubkey(), - rent, - anchor_spl::token::Mint::LEN as u64, - &spl_token::ID, - ); - - let init_mint_ix = spl_token::instruction::initialize_mint( - &spl_token::ID, - &mint.pubkey(), - &payer.pubkey(), - Some(&payer.pubkey()), - 2, // decimals - ) - .expect("Failed to create init mint instruction"); - - rpc.create_and_send_transaction( - &[create_account_ix, init_mint_ix], - &payer.pubkey(), - &[payer, &mint], - ) - .await - .expect("Failed to create mint"); - - mint.pubkey() -} - -// Helper: Create SPL token account -async fn create_token_account( - rpc: &mut R, - mint: &Pubkey, - account_keypair: &Keypair, - owner: &Keypair, -) -> Result<(), light_client::rpc::errors::RpcError> { - let rent = rpc - .get_minimum_balance_for_rent_exemption(spl_token::state::Account::LEN) - .await?; - - let create_account_ix = solana_sdk::system_instruction::create_account( - &owner.pubkey(), - &account_keypair.pubkey(), - rent, - spl_token::state::Account::LEN as u64, - &spl_token::ID, - ); - - let init_account_ix = spl_token::instruction::initialize_account( - &spl_token::ID, - &account_keypair.pubkey(), - mint, - &owner.pubkey(), - ) - .expect("Failed to create init account instruction"); - - rpc.create_and_send_transaction( - &[create_account_ix, init_account_ix], - &owner.pubkey(), - &[account_keypair, owner], - ) - .await - .map(|_| ()) -} - -// Helper: Mint SPL tokens -async fn mint_spl_tokens( - rpc: &mut R, - mint: &Pubkey, - token_account: &Pubkey, - mint_authority: &Keypair, - amount: u64, -) -> Result<(), light_client::rpc::errors::RpcError> { - let mint_to_ix = spl_token::instruction::mint_to( - &spl_token::ID, - mint, - token_account, - &mint_authority.pubkey(), - &[&mint_authority.pubkey()], - amount, - ) - .expect("Failed to create mint_to instruction"); - - rpc.create_and_send_transaction(&[mint_to_ix], &mint_authority.pubkey(), &[mint_authority]) - .await - .map(|_| ()) -} diff --git a/light-token/programs/src/close.rs b/light-token/src/close.rs similarity index 100% rename from light-token/programs/src/close.rs rename to light-token/src/close.rs diff --git a/light-token/programs/src/create_ata2.rs b/light-token/src/create_ata.rs similarity index 100% rename from light-token/programs/src/create_ata2.rs rename to light-token/src/create_ata.rs diff --git a/light-token/programs/src/create_cmint.rs b/light-token/src/create_mint.rs similarity index 99% rename from light-token/programs/src/create_cmint.rs rename to light-token/src/create_mint.rs index 8d0a753..b680ab5 100644 --- a/light-token/programs/src/create_cmint.rs +++ b/light-token/src/create_mint.rs @@ -195,7 +195,7 @@ pub fn process_create_cmint_with_pda_authority( accounts: &[AccountInfo], data: CreateCmintData, ) -> Result<(), ProgramError> { - use crate::mint_to_ctoken::MINT_AUTHORITY_SEED; + use crate::mint_to::MINT_AUTHORITY_SEED; if accounts.len() < 12 { return Err(ProgramError::NotEnoughAccountKeys); diff --git a/light-token/programs/src/create_token_account.rs b/light-token/src/create_token_account.rs similarity index 100% rename from light-token/programs/src/create_token_account.rs rename to light-token/src/create_token_account.rs diff --git a/light-token/programs/src/lib.rs b/light-token/src/lib.rs similarity index 98% rename from light-token/programs/src/lib.rs rename to light-token/src/lib.rs index 3e072c7..3ee3c74 100644 --- a/light-token/programs/src/lib.rs +++ b/light-token/src/lib.rs @@ -1,20 +1,20 @@ #![allow(unexpected_cfgs)] mod close; -mod create_ata2; -mod create_cmint; +mod create_ata; +mod create_mint; mod create_token_account; -mod mint_to_ctoken; +mod mint_to; mod transfer; mod transfer_interface; -mod transfer_spl_ctoken; +mod transfer_spl_to_light_token; // Re-export all instruction data types pub use close::{process_close_account_invoke, process_close_account_invoke_signed}; -pub use create_ata2::{ +pub use create_ata::{ process_create_ata2_invoke, process_create_ata2_invoke_signed, CreateAta2Data, }; -pub use create_cmint::{ +pub use create_mint::{ process_create_cmint, process_create_cmint_invoke_signed, process_create_cmint_with_pda_authority, CreateCmintData, MINT_SIGNER_SEED, }; @@ -22,7 +22,7 @@ pub use create_token_account::{ process_create_token_account_invoke, process_create_token_account_invoke_signed, CreateTokenAccountData, }; -pub use mint_to_ctoken::{ +pub use mint_to::{ process_mint_to_ctoken, process_mint_to_ctoken_invoke_signed, MintToCTokenData, MINT_AUTHORITY_SEED, }; @@ -34,7 +34,7 @@ pub use transfer_interface::{ process_transfer_interface_invoke, process_transfer_interface_invoke_signed, TransferInterfaceData, TRANSFER_INTERFACE_AUTHORITY_SEED, }; -pub use transfer_spl_ctoken::{ +pub use transfer_spl_to_light_token::{ process_ctoken_to_spl_invoke, process_ctoken_to_spl_invoke_signed, process_spl_to_ctoken_invoke, process_spl_to_ctoken_invoke_signed, TransferCtokenToSplData, TransferSplToCtokenData, TRANSFER_AUTHORITY_SEED, diff --git a/light-token/programs/src/mint_to_ctoken.rs b/light-token/src/mint_to.rs similarity index 100% rename from light-token/programs/src/mint_to_ctoken.rs rename to light-token/src/mint_to.rs diff --git a/light-token/programs/src/transfer.rs b/light-token/src/transfer.rs similarity index 100% rename from light-token/programs/src/transfer.rs rename to light-token/src/transfer.rs diff --git a/light-token/programs/src/transfer_interface.rs b/light-token/src/transfer_interface.rs similarity index 100% rename from light-token/programs/src/transfer_interface.rs rename to light-token/src/transfer_interface.rs diff --git a/light-token/programs/src/transfer_spl_ctoken.rs b/light-token/src/transfer_spl_to_light_token.rs similarity index 100% rename from light-token/programs/src/transfer_spl_ctoken.rs rename to light-token/src/transfer_spl_to_light_token.rs diff --git a/light-token/programs/tests/client-close-ctoken.rs b/light-token/tests/close.rs similarity index 51% rename from light-token/programs/tests/client-close-ctoken.rs rename to light-token/tests/close.rs index da51993..e000f85 100644 --- a/light-token/programs/tests/client-close-ctoken.rs +++ b/light-token/tests/close.rs @@ -1,68 +1,67 @@ -// Test for: close-ctoken.mdx - use borsh::BorshDeserialize; use light_client::indexer::{AddressWithTree, Indexer}; -use light_client::rpc::Rpc; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; use light_ctoken_sdk::ctoken::{ - CloseCTokenAccount, CreateCMint, CreateCMintParams, CreateCTokenAccount, - CTOKEN_PROGRAM_ID, + CloseCTokenAccount, CreateCMint, CreateCMintParams, CreateCTokenAccount, CTOKEN_PROGRAM_ID, }; use light_ctoken_interface::state::CToken; -use light_program_test::{LightProgramTest, ProgramTestConfig}; +use serde_json; use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; - +use std::convert::TryFrom; +use std::env; +use std::fs; #[tokio::test(flavor = "multi_thread")] async fn test_close_ctoken_account() { - // Step 1: Setup test environment - let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) - .await - .unwrap(); + dotenvy::dotenv().ok(); - let payer = rpc.get_payer().insecure_clone(); + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); - // Step 2: Create compressed mint (prerequisite) - let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + let api_key = env::var("api_key") + .expect("api_key environment variable must be set"); + + let config = LightClientConfig::devnet( + Some("https://devnet.helius-rpc.com".to_string()), + Some(api_key), + ); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to initialize LightClient"); + // Step 1: Create compressed mint (prerequisite) + let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; - // Step 3: Create cToken account with 0 balance + // Step 2: Create cToken account with 0 balance let account = Keypair::new(); let owner = payer.pubkey(); + let create_instruction = + CreateCTokenAccount::new(payer.pubkey(), account.pubkey(), mint, owner) + .instruction() + .unwrap(); - let create_instruction = CreateCTokenAccount::new( - payer.pubkey(), - account.pubkey(), - mint, - owner, - ) - .instruction() - .unwrap(); - - rpc.create_and_send_transaction( - &[create_instruction], - &payer.pubkey(), - &[&payer, &account], - ) - .await - .unwrap(); - + rpc.create_and_send_transaction(&[create_instruction], &payer.pubkey(), &[&payer, &account]) + .await + .unwrap(); - // Step 4: Verify account exists before closing + // Step 3: Verify account exists before closing let account_before_close = rpc.get_account(account.pubkey()).await.unwrap(); assert!( account_before_close.is_some(), "Account should exist before closing" ); - let ctoken_state = CToken::deserialize(&mut &account_before_close.unwrap().data[..]).unwrap(); + let ctoken_state = + CToken::deserialize(&mut &account_before_close.unwrap().data[..]).unwrap(); println!("\ncToken account state before closing:"); println!(" Mint: {:?}", ctoken_state.mint); println!(" Owner: {:?}", ctoken_state.owner); println!(" Amount: {}", ctoken_state.amount); assert_eq!(ctoken_state.amount, 0, "Account balance must be 0 to close"); - // Step 5: Build close instruction using SDK builder + // Step 4: Build close instruction using SDK builder let close_instruction = CloseCTokenAccount::new( CTOKEN_PROGRAM_ID, account.pubkey(), @@ -72,20 +71,24 @@ async fn test_close_ctoken_account() { .instruction() .unwrap(); - // Step 6: Send close transaction - let close_tx_sig = rpc.create_and_send_transaction(&[close_instruction], &payer.pubkey(), &[&payer]) + // Step 5: Send close transaction + let close_tx_sig = rpc + .create_and_send_transaction(&[close_instruction], &payer.pubkey(), &[&payer]) .await .unwrap(); println!("\nClose transaction: {}", close_tx_sig); - // Step 7: Verify account is closed + // Step 6: Verify account is closed let account_after_close = rpc.get_account(account.pubkey()).await.unwrap(); assert!( account_after_close.is_none(), "Account should be closed and no longer exist" ); + + println!("Successfully closed cToken account!"); } + pub async fn create_compressed_mint( rpc: &mut R, payer: &Keypair, @@ -93,7 +96,32 @@ pub async fn create_compressed_mint( ) -> (Pubkey, [u8; 32]) { let mint_signer = Keypair::new(); let address_tree = rpc.get_address_tree_v2(); - let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Fetch active state trees for devnet + let _ = rpc.get_latest_active_state_trees().await; + let output_pubkey = match rpc + .get_random_state_tree_info() + .ok() + .or_else(|| rpc.get_random_state_tree_info_v1().ok()) + { + Some(info) => info + .get_output_pubkey() + .expect("Invalid state tree type for output"), + None => { + let queues = rpc + .indexer_mut() + .expect("IndexerNotInitialized") + .get_queue_info(None) + .await + .expect("Failed to fetch queue info") + .value + .queues; + queues + .get(0) + .map(|q| q.queue) + .expect("NoStateTreesAvailable: no active state trees returned") + } + }; // Derive compression address let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( @@ -101,8 +129,7 @@ pub async fn create_compressed_mint( &address_tree.tree, ); - let mint_pda = - light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; + let mint_pda = light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc @@ -136,7 +163,7 @@ pub async fn create_compressed_mint( mint_signer.pubkey(), payer.pubkey(), address_tree.tree, - output_queue, + output_pubkey, ); let instruction = create_cmint.instruction().unwrap(); @@ -147,3 +174,14 @@ pub async fn create_compressed_mint( (mint_pda, compression_address) } + +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::try_from(&bytes[..])?) +} diff --git a/light-token/programs/tests/client-create-cata.rs b/light-token/tests/create-ata.rs similarity index 50% rename from light-token/programs/tests/client-create-cata.rs rename to light-token/tests/create-ata.rs index 86e6c52..12b6c0b 100644 --- a/light-token/programs/tests/client-create-cata.rs +++ b/light-token/tests/create-ata.rs @@ -1,48 +1,53 @@ -// Test for: create-cata.mdx - use borsh::BorshDeserialize; use light_client::indexer::{AddressWithTree, Indexer}; -use light_client::rpc::Rpc; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; use light_ctoken_sdk::ctoken::{ - derive_ctoken_ata, CreateAssociatedCTokenAccount, CreateCMint, - CreateCMintParams, + derive_ctoken_ata, CreateAssociatedCTokenAccount, CreateCMint, CreateCMintParams, }; use light_ctoken_interface::state::CToken; -use light_program_test::{LightProgramTest, ProgramTestConfig}; +use serde_json; use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; - +use std::convert::TryFrom; +use std::env; +use std::fs; #[tokio::test(flavor = "multi_thread")] -async fn test_create_cata_client() { - // Step 1: Setup test environment - let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) - .await - .unwrap(); +async fn test_create_associated_token_account() { + dotenvy::dotenv().ok(); - let payer = rpc.get_payer().insecure_clone(); + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + + let api_key = env::var("api_key") + .expect("api_key environment variable must be set"); + + let config = LightClientConfig::devnet( + Some("https://devnet.helius-rpc.com".to_string()), + Some(api_key), + ); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to initialize LightClient"); - // Step 2: Create compressed mint (prerequisite) + // Step 1: Create compressed mint (prerequisite) let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; - // Step 3: Define owner and derive ATA address + // Step 2: Define owner and derive ATA address let owner = payer.pubkey(); let (ata_address, _bump) = derive_ctoken_ata(&owner, &mint); - // Step 4: Build instruction using SDK builder - let instruction = CreateAssociatedCTokenAccount::new( - payer.pubkey(), - owner, - mint, - ) - .instruction() - .unwrap(); + // Step 3: Build instruction using SDK builder + let instruction = CreateAssociatedCTokenAccount::new(payer.pubkey(), owner, mint) + .instruction() + .unwrap(); - // Step 5: Send transaction (only payer signs, no account keypair needed) + // Step 4: Send transaction (only payer signs, no account keypair needed) rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer]) .await .unwrap(); - // Step 6: Verify cATA creation + // Step 5: Verify cATA creation let account_data = rpc.get_account(ata_address).await.unwrap().unwrap(); let ctoken_state = CToken::deserialize(&mut &account_data.data[..]).unwrap(); @@ -50,6 +55,7 @@ async fn test_create_cata_client() { assert_eq!(ctoken_state.owner, owner.to_bytes(), "Owner should match"); assert_eq!(ctoken_state.amount, 0, "Initial amount should be 0"); } + pub async fn create_compressed_mint( rpc: &mut R, payer: &Keypair, @@ -57,7 +63,32 @@ pub async fn create_compressed_mint( ) -> (Pubkey, [u8; 32]) { let mint_signer = Keypair::new(); let address_tree = rpc.get_address_tree_v2(); - let output_queue = rpc.get_random_state_tree_info().unwrap().queue; + + // Fetch active state trees for devnet + let _ = rpc.get_latest_active_state_trees().await; + let output_pubkey = match rpc + .get_random_state_tree_info() + .ok() + .or_else(|| rpc.get_random_state_tree_info_v1().ok()) + { + Some(info) => info + .get_output_pubkey() + .expect("Invalid state tree type for output"), + None => { + let queues = rpc + .indexer_mut() + .expect("IndexerNotInitialized") + .get_queue_info(None) + .await + .expect("Failed to fetch queue info") + .value + .queues; + queues + .get(0) + .map(|q| q.queue) + .expect("NoStateTreesAvailable: no active state trees returned") + } + }; // Derive compression address let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( @@ -65,8 +96,7 @@ pub async fn create_compressed_mint( &address_tree.tree, ); - let mint_pda = - light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; + let mint_pda = light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc @@ -82,7 +112,7 @@ pub async fn create_compressed_mint( .unwrap() .value; - // Build params + // Build params (no metadata for this simple example) let params = CreateCMintParams { decimals, address_merkle_tree_root_index: rpc_result.addresses[0].root_index, @@ -100,7 +130,7 @@ pub async fn create_compressed_mint( mint_signer.pubkey(), payer.pubkey(), address_tree.tree, - output_queue, + output_pubkey, ); let instruction = create_cmint.instruction().unwrap(); @@ -111,3 +141,14 @@ pub async fn create_compressed_mint( (mint_pda, compression_address) } + +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::try_from(&bytes[..])?) +} diff --git a/light-token/programs/tests/devnet-client-create-mint.rs b/light-token/tests/create-mint.rs similarity index 82% rename from light-token/programs/tests/devnet-client-create-mint.rs rename to light-token/tests/create-mint.rs index a00d043..d2838e5 100644 --- a/light-token/programs/tests/devnet-client-create-mint.rs +++ b/light-token/tests/create-mint.rs @@ -4,40 +4,43 @@ use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams}; use light_ctoken_interface::instructions::extensions::token_metadata::TokenMetadataInstructionData; use light_ctoken_interface::instructions::extensions::ExtensionInstructionData; use light_ctoken_interface::state::AdditionalMetadata; +use serde_json; use solana_sdk::{bs58, pubkey::Pubkey, signature::Keypair, signer::Signer}; +use std::convert::TryFrom; use std::env; use std::fs; -use serde_json; -use std::convert::TryFrom; - - #[tokio::test(flavor = "multi_thread")] -async fn test_create_rent_free_mint_with_metadata() { +async fn test_create_compressed_mint_with_metadata() { dotenvy::dotenv().ok(); let keypair_path = env::var("KEYPAIR_PATH") .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + let api_key = env::var("api_key") - .expect("api_key environment variable must be set. Create a .env file or set it in your environment."); + .expect("api_key environment variable must be set"); - let photon_base = "https://devnet.helius-rpc.com".to_string(); - let config = LightClientConfig::devnet(Some(photon_base), Some(api_key)); + let config = LightClientConfig::devnet( + Some("https://devnet.helius-rpc.com".to_string()), + Some(api_key), + ); let mut rpc = LightClient::new_with_retry(config, None) .await .expect("Failed to initialize LightClient"); - // Create c-mint with metadata - let (_mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + // Create compressed mint with metadata + let (mint_pda, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; - println!("Mint Address: {}", bs58::encode(compression_address).into_string()); + println!("\n=== Created Compressed Mint ==="); + println!("Mint PDA: {}", mint_pda); + println!("Compression Address: {}", bs58::encode(compression_address).into_string()); println!("Decimals: 9"); - println!("Name: Rent Free Token"); - println!("Symbol: RFT"); + println!("Name: Example Token"); + println!("Symbol: EXT"); println!("URI: https://example.com/metadata.json"); - } + pub async fn create_compressed_mint( rpc: &mut R, payer: &Keypair, @@ -45,7 +48,8 @@ pub async fn create_compressed_mint( ) -> (Pubkey, [u8; 32]) { let mint_signer = Keypair::new(); let address_tree = rpc.get_address_tree_v2(); - // Ensure state trees are fetched, then pick a valid one via helper + + // Fetch active state trees for devnet let _ = rpc.get_latest_active_state_trees().await; let output_pubkey = match rpc .get_random_state_tree_info() @@ -71,14 +75,13 @@ pub async fn create_compressed_mint( } }; - // Derive address + // Derive compression address let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( &mint_signer.pubkey(), &address_tree.tree, ); - let mint_pda = - light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; + let mint_pda = light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc @@ -106,8 +109,8 @@ pub async fn create_compressed_mint( extensions: Some(vec![ExtensionInstructionData::TokenMetadata( TokenMetadataInstructionData { update_authority: Some(payer.pubkey().to_bytes().into()), - name: b"Rent Free Token".to_vec(), - symbol: b"RFT".to_vec(), + name: b"Example Token".to_vec(), + symbol: b"EXT".to_vec(), uri: b"https://example.com/metadata.json".to_vec(), additional_metadata: Some(vec![AdditionalMetadata { key: b"type".to_vec(), diff --git a/light-token/tests/create-token-account.rs b/light-token/tests/create-token-account.rs new file mode 100644 index 0000000..49f89de --- /dev/null +++ b/light-token/tests/create-token-account.rs @@ -0,0 +1,159 @@ +use borsh::BorshDeserialize; +use light_client::indexer::{AddressWithTree, Indexer}; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; +use light_ctoken_sdk::ctoken::{CreateCMint, CreateCMintParams, CreateCTokenAccount}; +use light_ctoken_interface::state::CToken; +use serde_json; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; +use std::convert::TryFrom; +use std::env; +use std::fs; + +#[tokio::test(flavor = "multi_thread")] +async fn test_create_ctoken_account() { + dotenvy::dotenv().ok(); + + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + + let api_key = env::var("api_key") + .expect("api_key environment variable must be set"); + + let config = LightClientConfig::devnet( + Some("https://devnet.helius-rpc.com".to_string()), + Some(api_key), + ); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to initialize LightClient"); + + // Step 1: Create compressed mint (prerequisite) + let (mint, _compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; + + // Step 2: Generate new keypair for the cToken account + let account = Keypair::new(); + let owner = payer.pubkey(); + + println!("\n=== Creating cToken Account ==="); + println!("Account: {}", account.pubkey()); + println!("Owner: {}", owner); + println!("Mint: {}", mint); + + // Step 3: Build instruction using SDK builder + let instruction = CreateCTokenAccount::new(payer.pubkey(), account.pubkey(), mint, owner) + .instruction() + .unwrap(); + + // Step 4: Send transaction (account keypair must sign) + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer, &account]) + .await + .unwrap(); + + // Step 5: Verify account creation + let account_data = rpc.get_account(account.pubkey()).await.unwrap().unwrap(); + let ctoken_state = CToken::deserialize(&mut &account_data.data[..]).unwrap(); + + assert_eq!(ctoken_state.mint, mint.to_bytes(), "Mint should match"); + assert_eq!(ctoken_state.owner, owner.to_bytes(), "Owner should match"); + assert_eq!(ctoken_state.amount, 0, "Initial amount should be 0"); + + println!("Successfully created cToken account!"); +} + +pub async fn create_compressed_mint( + rpc: &mut R, + payer: &Keypair, + decimals: u8, +) -> (Pubkey, [u8; 32]) { + let mint_signer = Keypair::new(); + let address_tree = rpc.get_address_tree_v2(); + + // Fetch active state trees for devnet + let _ = rpc.get_latest_active_state_trees().await; + let output_pubkey = match rpc + .get_random_state_tree_info() + .ok() + .or_else(|| rpc.get_random_state_tree_info_v1().ok()) + { + Some(info) => info + .get_output_pubkey() + .expect("Invalid state tree type for output"), + None => { + let queues = rpc + .indexer_mut() + .expect("IndexerNotInitialized") + .get_queue_info(None) + .await + .expect("Failed to fetch queue info") + .value + .queues; + queues + .get(0) + .map(|q| q.queue) + .expect("NoStateTreesAvailable: no active state trees returned") + } + }; + + // Derive compression address + let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( + &mint_signer.pubkey(), + &address_tree.tree, + ); + + let mint_pda = light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; + + // Get validity proof for the address + let rpc_result = rpc + .get_validity_proof( + vec![], + vec![AddressWithTree { + address: compression_address, + tree: address_tree.tree, + }], + None, + ) + .await + .unwrap() + .value; + + // Build params + let params = CreateCMintParams { + decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: payer.pubkey(), + proof: rpc_result.proof.0.unwrap(), + compression_address, + mint: mint_pda, + freeze_authority: None, + extensions: None, + }; + + // Create instruction + let create_cmint = CreateCMint::new( + params, + mint_signer.pubkey(), + payer.pubkey(), + address_tree.tree, + output_pubkey, + ); + let instruction = create_cmint.instruction().unwrap(); + + // Send transaction + rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_signer]) + .await + .unwrap(); + + (mint_pda, compression_address) +} + +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::try_from(&bytes[..])?) +} diff --git a/light-token/programs/tests/devnet-client-mint-to-ctoken.rs b/light-token/tests/mint-to.rs similarity index 83% rename from light-token/programs/tests/devnet-client-mint-to-ctoken.rs rename to light-token/tests/mint-to.rs index ecd3fbc..83e4e5e 100644 --- a/light-token/programs/tests/devnet-client-mint-to-ctoken.rs +++ b/light-token/tests/mint-to.rs @@ -1,5 +1,3 @@ -// Test for: client-mint-to-ctoken.mdx - use borsh::BorshDeserialize; use light_client::indexer::{AddressWithTree, Indexer}; use light_client::rpc::{LightClient, LightClientConfig, Rpc}; @@ -7,57 +5,52 @@ use light_ctoken_sdk::ctoken::{ CreateCMint, CreateCMintParams, CreateCTokenAccount, MintToCToken, MintToCTokenParams, }; use light_ctoken_interface::instructions::extensions::token_metadata::TokenMetadataInstructionData; +use solana_sdk::compute_budget::ComputeBudgetInstruction; use light_ctoken_interface::instructions::extensions::ExtensionInstructionData; use light_ctoken_interface::instructions::mint_action::CompressedMintWithContext; use light_ctoken_interface::state::{AdditionalMetadata, CToken, CompressedMint}; +use serde_json; use solana_sdk::{bs58, pubkey::Pubkey, signature::Keypair, signer::Signer}; +use std::convert::TryFrom; use std::env; use std::fs; -use serde_json; -use std::convert::TryFrom; - #[tokio::test(flavor = "multi_thread")] -async fn test_create_rent_free_mint_with_metadata() { - // Load environment variables from .env file +async fn test_mint_to_ctoken() { dotenvy::dotenv().ok(); - // Initialize LightClient on devnet with Photon indexer let keypair_path = env::var("KEYPAIR_PATH") .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + let mint_authority = payer.pubkey(); - // Get Helius API key from environment - let helius_api_key = env::var("HELIUS_API_KEY") - .expect("HELIUS_API_KEY environment variable must be set. Create a .env file or set it in your environment."); + let api_key = env::var("api_key") + .expect("api_key environment variable must be set"); - let photon_base = "https://devnet.helius-rpc.com".to_string(); - let config = LightClientConfig::devnet(Some(photon_base), Some(helius_api_key)); + let config = LightClientConfig::devnet( + Some("https://devnet.helius-rpc.com".to_string()), + Some(api_key), + ); let mut rpc = LightClient::new_with_retry(config, None) .await .expect("Failed to initialize LightClient"); - // Create c-mint with metadata + // Step 1: Create compressed mint with metadata let (mint, compression_address) = create_compressed_mint(&mut rpc, &payer, 9).await; println!("\n=== Created Compressed Mint ==="); println!("Mint PDA: {}", mint); - println!("Compression Address: {}", bs58::encode(compression_address).into_string()); - println!("Decimals: 9"); - println!("Name: Rent Free Token"); - println!("Symbol: RFT"); - println!("URI: https://example.com/metadata.json"); + println!( + "Compression Address: {}", + bs58::encode(compression_address).into_string() + ); // Step 2: Create ctoken account let ctoken_account = Keypair::new(); let owner = payer.pubkey(); - let create_account_ix = CreateCTokenAccount::new( - payer.pubkey(), - ctoken_account.pubkey(), - mint, - owner, - ) - .instruction() - .unwrap(); + let create_account_ix = + CreateCTokenAccount::new(payer.pubkey(), ctoken_account.pubkey(), mint, owner) + .instruction() + .unwrap(); rpc.create_and_send_transaction( &[create_account_ix], @@ -93,7 +86,7 @@ async fn test_create_rent_free_mint_with_metadata() { let compressed_mint_with_context = CompressedMintWithContext { address: compression_address, leaf_index: compressed_mint_account.leaf_index, - prove_by_index: true, + prove_by_index: false, root_index: rpc_result.accounts[0] .root_index .root_index() @@ -103,7 +96,7 @@ async fn test_create_rent_free_mint_with_metadata() { let amount = 1_000_000_000u64; // 1 token with 9 decimals - // Step 7: Get active output queue for devnet (same pattern as create_compressed_mint) + // Step 7: Get active output queue for devnet let _ = rpc.get_latest_active_state_trees().await; let output_queue = match rpc .get_random_state_tree_info() @@ -133,7 +126,7 @@ async fn test_create_rent_free_mint_with_metadata() { let params = MintToCTokenParams::new( compressed_mint_with_context, amount, - payer.pubkey(), // mint_authority + mint_authority, rpc_result.proof, ); @@ -142,7 +135,7 @@ async fn test_create_rent_free_mint_with_metadata() { params, payer.pubkey(), compressed_mint_account.tree_info.tree, - output_queue, + compressed_mint_account.tree_info.queue, output_queue, vec![ctoken_account.pubkey()], ) @@ -150,7 +143,8 @@ async fn test_create_rent_free_mint_with_metadata() { .unwrap(); // Step 10: Send transaction - rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[&payer]) + let compute_unit_ix = ComputeBudgetInstruction::set_compute_unit_limit(300_000); + rpc.create_and_send_transaction(&[compute_unit_ix, instruction], &payer.pubkey(), &[&payer]) .await .unwrap(); println!("Minted {} tokens to ctoken account", amount); @@ -169,6 +163,7 @@ async fn test_create_rent_free_mint_with_metadata() { println!("Successfully minted and verified {} tokens!", amount); } + pub async fn create_compressed_mint( rpc: &mut R, payer: &Keypair, @@ -176,7 +171,8 @@ pub async fn create_compressed_mint( ) -> (Pubkey, [u8; 32]) { let mint_signer = Keypair::new(); let address_tree = rpc.get_address_tree_v2(); - // Ensure state trees are fetched, then pick a valid one via helper + + // Fetch active state trees for devnet let _ = rpc.get_latest_active_state_trees().await; let output_pubkey = match rpc .get_random_state_tree_info() @@ -202,14 +198,13 @@ pub async fn create_compressed_mint( } }; - // Derive address + // Derive compression address let compression_address = light_ctoken_sdk::ctoken::derive_cmint_compressed_address( &mint_signer.pubkey(), &address_tree.tree, ); - let mint_pda = - light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; + let mint_pda = light_ctoken_sdk::ctoken::find_cmint_address(&mint_signer.pubkey()).0; // Get validity proof for the address let rpc_result = rpc @@ -237,8 +232,8 @@ pub async fn create_compressed_mint( extensions: Some(vec![ExtensionInstructionData::TokenMetadata( TokenMetadataInstructionData { update_authority: Some(payer.pubkey().to_bytes().into()), - name: b"Rent Free Token".to_vec(), - symbol: b"RFT".to_vec(), + name: b"Example Token".to_vec(), + symbol: b"EXT".to_vec(), uri: b"https://example.com/metadata.json".to_vec(), additional_metadata: Some(vec![AdditionalMetadata { key: b"type".to_vec(), diff --git a/light-token/tests/transfer-interface.rs b/light-token/tests/transfer-interface.rs new file mode 100644 index 0000000..1ad033e --- /dev/null +++ b/light-token/tests/transfer-interface.rs @@ -0,0 +1,226 @@ +use anchor_spl::token::{spl_token, Mint}; +use light_client::rpc::{LightClient, LightClientConfig, Rpc}; +use light_ctoken_sdk::{ + ctoken::{ + derive_ctoken_ata as derive_token_ata, CreateAssociatedCTokenAccount as CreateAssociatedTokenAccount, + TransferCToken as TransferToken, TransferSplToCtoken as TransferSplToToken, + }, + spl_interface::{find_spl_interface_pda_with_index, CreateSplInterfacePda}, +}; +use serde_json; +use solana_sdk::compute_budget::ComputeBudgetInstruction; +use solana_sdk::program_pack::Pack; +use solana_sdk::{signature::Keypair, signer::Signer}; +use spl_token_2022::pod::PodAccount; +use std::convert::TryFrom; +use std::env; +use std::fs; + +/// Test SPL → light-token → light-token +// with ATA creation + transfer in one transaction +#[tokio::test(flavor = "multi_thread")] +async fn test_spl_to_token_to_token() { + dotenvy::dotenv().ok(); + + let keypair_path = env::var("KEYPAIR_PATH") + .unwrap_or_else(|_| format!("{}/.config/solana/id.json", env::var("HOME").unwrap())); + let payer = load_keypair(&keypair_path).expect("Failed to load keypair"); + let api_key = env::var("api_key") + .expect("api_key environment variable must be set. Create a .env file or set it in your environment."); + + let config = LightClientConfig::devnet( + Some("https://devnet.helius-rpc.com".to_string()), + Some(api_key), + ); + let mut rpc = LightClient::new_with_retry(config, None) + .await + .expect("Failed to initialize LightClient"); + + // 2. Create SPL mint + let mint_keypair = Keypair::new(); + let mint = mint_keypair.pubkey(); + let decimals = 2u8; + + let mint_rent = rpc + .get_minimum_balance_for_rent_exemption(Mint::LEN) + .await + .unwrap(); + + let create_mint_account_ix = solana_sdk::system_instruction::create_account( + &payer.pubkey(), + &mint, + mint_rent, + Mint::LEN as u64, + &spl_token::ID, + ); + + let initialize_mint_ix = spl_token::instruction::initialize_mint( + &spl_token::ID, + &mint, + &payer.pubkey(), + None, + decimals, + ) + .unwrap(); + + rpc.create_and_send_transaction( + &[create_mint_account_ix, initialize_mint_ix], + &payer.pubkey(), + &[&payer, &mint_keypair], + ) + .await + .unwrap(); + + // 3. Create SPL interface PDA + let create_spl_interface_pda_ix = + CreateSplInterfacePda::new(payer.pubkey(), mint, anchor_spl::token::ID).instruction(); + + rpc.create_and_send_transaction(&[create_spl_interface_pda_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + let mint_amount = 10_000u64; + let spl_to_token_amount = 7_000u64; + let token_transfer_amount = 3_000u64; + + // 4. Create SPL token account + let spl_token_account_keypair = Keypair::new(); + let token_account_rent = rpc + .get_minimum_balance_for_rent_exemption(spl_token::state::Account::LEN) + .await + .unwrap(); + let create_token_account_ix = solana_sdk::system_instruction::create_account( + &payer.pubkey(), + &spl_token_account_keypair.pubkey(), + token_account_rent, + spl_token::state::Account::LEN as u64, + &spl_token::ID, + ); + let init_token_account_ix = spl_token::instruction::initialize_account( + &spl_token::ID, + &spl_token_account_keypair.pubkey(), + &mint, + &payer.pubkey(), + ) + .unwrap(); + rpc.create_and_send_transaction( + &[create_token_account_ix, init_token_account_ix], + &payer.pubkey(), + &[&spl_token_account_keypair, &payer], + ) + .await + .unwrap(); + + // 5. Mint SPL tokens to the SPL account + let mint_to_ix = spl_token::instruction::mint_to( + &spl_token::ID, + &mint, + &spl_token_account_keypair.pubkey(), + &payer.pubkey(), + &[&payer.pubkey()], + mint_amount, + ) + .unwrap(); + rpc.create_and_send_transaction(&[mint_to_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Verify SPL account has tokens + let spl_account_data = rpc + .get_account(spl_token_account_keypair.pubkey()) + .await + .unwrap() + .unwrap(); + let spl_account = + spl_pod::bytemuck::pod_from_bytes::(&spl_account_data.data).unwrap(); + let initial_spl_balance: u64 = spl_account.amount.into(); + assert_eq!(initial_spl_balance, mint_amount); + + // 6. Create sender's token ATA + let (sender_token_ata, _bump) = derive_token_ata(&payer.pubkey(), &mint); + let create_ata_instruction = + CreateAssociatedTokenAccount::new(payer.pubkey(), payer.pubkey(), mint) + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[create_ata_instruction], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // Verify sender's token ATA was created + let token_account_data = rpc.get_account(sender_token_ata).await.unwrap().unwrap(); + assert!( + !token_account_data.data.is_empty(), + "Sender token ATA should exist" + ); + + // 7. Transfer SPL tokens to sender's token account + let (spl_interface_pda, spl_interface_pda_bump) = find_spl_interface_pda_with_index(&mint, 0); + + let spl_to_token_ix = TransferSplToToken { + amount: spl_to_token_amount, + spl_interface_pda_bump, + source_spl_token_account: spl_token_account_keypair.pubkey(), + destination_ctoken_account: sender_token_ata, + authority: payer.pubkey(), + mint, + payer: payer.pubkey(), + spl_interface_pda, + spl_token_program: anchor_spl::token::ID, + } + .instruction() + .unwrap(); + + rpc.create_and_send_transaction(&[spl_to_token_ix], &payer.pubkey(), &[&payer]) + .await + .unwrap(); + + // 8. Create recipient ATA + transfer token→token in one transaction + let recipient = Keypair::new(); + let (recipient_token_ata, _) = derive_token_ata(&recipient.pubkey(), &mint); + + let create_recipient_ata_ix = CreateAssociatedTokenAccount::new( + payer.pubkey(), + recipient.pubkey(), + mint, + ) + .instruction() + .unwrap(); + + let token_transfer_ix = TransferToken { + source: sender_token_ata, + destination: recipient_token_ata, + amount: token_transfer_amount, + authority: payer.pubkey(), + max_top_up: None, + } + .instruction() + .unwrap(); + + let compute_unit_ix = ComputeBudgetInstruction::set_compute_unit_limit(10_000); + let tx_id = rpc.create_and_send_transaction( + &[compute_unit_ix, create_recipient_ata_ix, token_transfer_ix], + &payer.pubkey(), + &[&payer], + ) + .await + .unwrap(); + println!("Sender: {}", payer.pubkey()); + println!("Recipient: {}", recipient.pubkey()); + println!("Amount: {}\n", token_transfer_amount); + println!( + "Transaction: https://explorer.solana.com/tx/{}?cluster=devnet\n", + tx_id + ); +} + +fn load_keypair(path: &str) -> Result> { + let path = if path.starts_with("~") { + path.replace("~", &env::var("HOME").unwrap_or_default()) + } else { + path.to_string() + }; + let file = fs::read_to_string(&path)?; + let bytes: Vec = serde_json::from_str(&file)?; + Ok(Keypair::try_from(&bytes[..])?) +} \ No newline at end of file