From da718b85af332c45179ea736205985593a2807c9 Mon Sep 17 00:00:00 2001 From: ananas Date: Wed, 21 Jan 2026 16:52:01 +0000 Subject: [PATCH 1/7] refactor: light token client to a clean minimal impl, move existing actions to test utils --- .github/workflows/sdk-tests.yml | 2 +- Cargo.lock | 24 + Cargo.toml | 1 + forester/Cargo.toml | 1 + forester/src/compressible/mint/compressor.rs | 2 +- forester/tests/e2e_test.rs | 10 +- forester/tests/test_compressible_ctoken.rs | 2 +- .../tests/compress_only/all.rs | 10 +- .../tests/compress_only/ata_decompress.rs | 6 +- .../compress_only/decompress_restrictions.rs | 14 +- .../compress_only/invalid_destination.rs | 14 +- .../compress_only/invalid_extension_state.rs | 12 +- .../tests/compress_only/mod.rs | 4 +- .../tests/compress_only/withheld_fee.rs | 6 +- .../tests/freeze/compress_only.rs | 6 +- .../tests/freeze/functional.rs | 8 +- .../tests/light_token/burn.rs | 26 +- .../tests/light_token/compress_and_close.rs | 40 +- .../tests/light_token/extensions.rs | 6 +- .../tests/light_token/shared.rs | 6 +- .../light_token/spl_instruction_compat.rs | 22 +- .../compressed-token-test/tests/mint/burn.rs | 26 +- .../tests/mint/cmint_resize.rs | 48 +- .../tests/mint/edge_cases.rs | 16 +- .../tests/mint/failing.rs | 86 ++-- .../tests/mint/functional.rs | 111 ++--- .../tests/mint/mint_to.rs | 26 +- .../tests/mint/random.rs | 16 +- .../tests/transfer2/compress_failing.rs | 40 +- .../tests/transfer2/decompress_failing.rs | 20 +- .../no_system_program_cpi_failing.rs | 40 +- .../tests/transfer2/shared.rs | 25 +- .../tests/transfer2/spl_ctoken.rs | 2 +- .../tests/transfer2/transfer_failing.rs | 6 +- .../registry-test/tests/compressible.rs | 17 +- program-tests/utils/Cargo.toml | 8 + .../create_compressible_token_account.rs | 0 .../utils/src/actions/legacy/create_mint.rs | 61 +++ .../legacy}/instructions/create_mint.rs | 2 +- .../legacy}/instructions/mint_action.rs | 0 .../instructions/mint_to_compressed.rs | 0 .../src/actions/legacy}/instructions/mod.rs | 0 .../actions/legacy}/instructions/transfer2.rs | 0 .../instructions/update_compressed_mint.rs | 0 .../utils/src/actions/legacy}/mint_action.rs | 4 +- .../src/actions/legacy}/mint_to_compressed.rs | 2 +- program-tests/utils/src/actions/legacy/mod.rs | 18 + .../src/actions/legacy}/spl_interface.rs | 0 .../utils/src/actions/legacy/transfer.rs | 78 ++++ .../src/actions/legacy}/transfer2/approve.rs | 2 +- .../src/actions/legacy}/transfer2/compress.rs | 2 +- .../legacy}/transfer2/compress_and_close.rs | 2 +- .../legacy}/transfer2/ctoken_to_spl.rs | 0 .../actions/legacy}/transfer2/decompress.rs | 2 +- .../src/actions/legacy}/transfer2/mod.rs | 0 .../legacy}/transfer2/spl_to_ctoken.rs | 0 .../src/actions/legacy}/transfer2/transfer.rs | 2 +- .../legacy}/transfer2/transfer_delegated.rs | 2 +- .../actions/legacy}/update_compressed_mint.rs | 2 +- program-tests/utils/src/actions/mod.rs | 6 + program-tests/utils/src/assert_mint_action.rs | 3 +- program-tests/utils/src/assert_transfer2.rs | 8 +- program-tests/utils/src/lib.rs | 1 + sdk-libs/token-client/src/actions/approve.rs | 122 +++++ .../token-client/src/actions/create_ata.rs | 99 ++++ .../token-client/src/actions/create_mint.rs | 215 +++++++-- sdk-libs/token-client/src/actions/mint_to.rs | 75 +++ sdk-libs/token-client/src/actions/mod.rs | 50 +- sdk-libs/token-client/src/actions/revoke.rs | 110 +++++ sdk-libs/token-client/src/actions/transfer.rs | 129 +++--- .../src/actions/transfer_checked.rs | 86 ++++ .../src/actions/transfer_interface.rs | 122 +++++ sdk-libs/token-client/src/actions/unwrap.rs | 84 ++++ sdk-libs/token-client/src/actions/wrap.rs | 85 ++++ sdk-libs/token-client/src/lib.rs | 6 +- .../src/instruction/approve_checked.rs | 144 ------ sdk-libs/token-sdk/src/instruction/mod.rs | 2 - .../sdk-light-token-test/tests/shared.rs | 4 +- .../tests/test_decompress_mint.rs | 4 +- .../tests/decompress_full_cpi.rs | 6 +- .../sdk-token-test/tests/test_4_transfer2.rs | 2 +- .../tests/test_compress_full_and_close.rs | 2 +- sdk-tests/token-client-test/Cargo.toml | 29 ++ .../tests/test_approve_revoke.rs | 427 ++++++++++++++++++ .../tests/test_create_mint.rs | 160 +++++++ .../token-client-test/tests/test_transfer.rs | 193 ++++++++ .../tests/test_transfer_checked.rs | 206 +++++++++ .../tests/test_transfer_interface.rs | 215 +++++++++ .../tests/test_wrap_unwrap.rs | 328 ++++++++++++++ 89 files changed, 3205 insertions(+), 606 deletions(-) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/create_compressible_token_account.rs (100%) create mode 100644 program-tests/utils/src/actions/legacy/create_mint.rs rename {sdk-libs/token-client/src => program-tests/utils/src/actions/legacy}/instructions/create_mint.rs (95%) rename {sdk-libs/token-client/src => program-tests/utils/src/actions/legacy}/instructions/mint_action.rs (100%) rename {sdk-libs/token-client/src => program-tests/utils/src/actions/legacy}/instructions/mint_to_compressed.rs (100%) rename {sdk-libs/token-client/src => program-tests/utils/src/actions/legacy}/instructions/mod.rs (100%) rename {sdk-libs/token-client/src => program-tests/utils/src/actions/legacy}/instructions/transfer2.rs (100%) rename {sdk-libs/token-client/src => program-tests/utils/src/actions/legacy}/instructions/update_compressed_mint.rs (100%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/mint_action.rs (98%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/mint_to_compressed.rs (96%) create mode 100644 program-tests/utils/src/actions/legacy/mod.rs rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/spl_interface.rs (100%) create mode 100644 program-tests/utils/src/actions/legacy/transfer.rs rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/approve.rs (97%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/compress.rs (99%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/compress_and_close.rs (97%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/ctoken_to_spl.rs (100%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/decompress.rs (97%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/mod.rs (100%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/spl_to_ctoken.rs (100%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/transfer.rs (97%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/transfer2/transfer_delegated.rs (98%) rename {sdk-libs/token-client/src/actions => program-tests/utils/src/actions/legacy}/update_compressed_mint.rs (98%) create mode 100644 program-tests/utils/src/actions/mod.rs create mode 100644 sdk-libs/token-client/src/actions/approve.rs create mode 100644 sdk-libs/token-client/src/actions/create_ata.rs create mode 100644 sdk-libs/token-client/src/actions/mint_to.rs create mode 100644 sdk-libs/token-client/src/actions/revoke.rs create mode 100644 sdk-libs/token-client/src/actions/transfer_checked.rs create mode 100644 sdk-libs/token-client/src/actions/transfer_interface.rs create mode 100644 sdk-libs/token-client/src/actions/unwrap.rs create mode 100644 sdk-libs/token-client/src/actions/wrap.rs delete mode 100644 sdk-libs/token-sdk/src/instruction/approve_checked.rs create mode 100644 sdk-tests/token-client-test/Cargo.toml create mode 100644 sdk-tests/token-client-test/tests/test_approve_revoke.rs create mode 100644 sdk-tests/token-client-test/tests/test_create_mint.rs create mode 100644 sdk-tests/token-client-test/tests/test_transfer.rs create mode 100644 sdk-tests/token-client-test/tests/test_transfer_checked.rs create mode 100644 sdk-tests/token-client-test/tests/test_transfer_interface.rs create mode 100644 sdk-tests/token-client-test/tests/test_wrap_unwrap.rs diff --git a/.github/workflows/sdk-tests.yml b/.github/workflows/sdk-tests.yml index 0b2669aec1..98d50f2e22 100644 --- a/.github/workflows/sdk-tests.yml +++ b/.github/workflows/sdk-tests.yml @@ -52,7 +52,7 @@ jobs: - program: anchor & pinocchio sub-tests: '["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk-compressible-test", "cargo-test-sbf -p csdk-anchor-derived-test", "cargo-test-sbf -p csdk-anchor-full-derived-test", "cargo-test-sbf -p sdk-pinocchio-v1-test", "cargo-test-sbf -p sdk-pinocchio-v2-test", "cargo-test-sbf -p pinocchio-nostd-test", "cargo-test-sbf -p single-mint-test", "cargo-test-sbf -p single-pda-test", "cargo-test-sbf -p single-ata-test", "cargo-test-sbf -p single-token-test"]' - program: token test - sub-tests: '["cargo-test-sbf -p sdk-token-test"]' + sub-tests: '["cargo-test-sbf -p sdk-token-test", "cargo-test-sbf -p token-client-test"]' - program: sdk-libs test_cmd: just sdk-libs test steps: diff --git a/Cargo.lock b/Cargo.lock index a107e70b97..b53dd361f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4166,6 +4166,7 @@ dependencies = [ "anchor-lang", "anchor-spl", "base64 0.13.1", + "borsh 0.10.4", "create-address-test-program", "forester-utils", "light-account-checks", @@ -4191,6 +4192,7 @@ dependencies = [ "light-token", "light-token-client", "light-token-interface", + "light-token-types", "light-zero-copy", "log", "num-bigint 0.4.6", @@ -4198,7 +4200,13 @@ dependencies = [ "rand 0.8.5", "reqwest 0.12.26", "solana-banks-client", + "solana-instruction", + "solana-keypair", + "solana-msg 2.2.1", + "solana-pubkey 2.4.0", "solana-sdk", + "solana-signature", + "solana-signer", "solana-system-interface 1.0.0", "spl-pod", "spl-token 7.0.0", @@ -10593,6 +10601,22 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "token-client-test" +version = "0.1.0" +dependencies = [ + "borsh 0.10.4", + "light-client", + "light-program-test", + "light-test-utils", + "light-token", + "light-token-client", + "light-token-interface", + "solana-sdk", + "spl-token 7.0.0", + "tokio", +] + [[package]] name = "tokio" version = "1.48.0" diff --git a/Cargo.toml b/Cargo.toml index dc679fc404..c552f04eb9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,6 +58,7 @@ members = [ "sdk-tests/sdk-v1-native-test", "sdk-tests/sdk-token-test", "sdk-tests/sdk-light-token-test", + "sdk-tests/token-client-test", "sdk-tests/csdk-anchor-full-derived-test", "sdk-tests/csdk-anchor-full-derived-test-sdk", "sdk-tests/single-mint-test", diff --git a/forester/Cargo.toml b/forester/Cargo.toml index 5b23dc2855..c648a54156 100644 --- a/forester/Cargo.toml +++ b/forester/Cargo.toml @@ -31,6 +31,7 @@ light-compressible = { workspace = true, default-features = false, features = [" light-token-interface = { workspace = true } light-token-client = { workspace = true } light-token = { workspace = true } +light-test-utils = { workspace = true } light-compressed-token-sdk = { workspace = true } solana-rpc-client-api = { workspace = true } solana-transaction-status = { workspace = true } diff --git a/forester/src/compressible/mint/compressor.rs b/forester/src/compressible/mint/compressor.rs index 259416f05d..db3d4bd6d2 100644 --- a/forester/src/compressible/mint/compressor.rs +++ b/forester/src/compressible/mint/compressor.rs @@ -6,7 +6,7 @@ use std::sync::{ use forester_utils::rpc_pool::SolanaRpcPool; use futures::StreamExt; use light_client::{indexer::Indexer, rpc::Rpc}; -use light_token_client::instructions::mint_action::{ +use light_test_utils::actions::legacy::instructions::mint_action::{ create_mint_action_instruction, MintActionParams, MintActionType, }; use solana_sdk::{ diff --git a/forester/tests/e2e_test.rs b/forester/tests/e2e_test.rs index 70bb748ea9..0f0387bb0c 100644 --- a/forester/tests/e2e_test.rs +++ b/forester/tests/e2e_test.rs @@ -39,14 +39,14 @@ use light_hasher::Poseidon; use light_program_test::accounts::test_accounts::TestAccounts; use light_prover_client::prover::spawn_prover; use light_test_utils::{ - conversions::sdk_to_program_token_data, get_concurrent_merkle_tree, get_indexed_merkle_tree, - pack::pack_new_address_params_assigned, spl::create_mint_helper_with_keypair, + actions::{create_compressible_token_account, CreateCompressibleTokenAccountInputs}, + conversions::sdk_to_program_token_data, + get_concurrent_merkle_tree, get_indexed_merkle_tree, + pack::pack_new_address_params_assigned, + spl::create_mint_helper_with_keypair, system_program::create_invoke_instruction, }; use light_token::compat::TokenDataWithMerkleContext; -use light_token_client::actions::{ - create_compressible_token_account, CreateCompressibleTokenAccountInputs, -}; use light_token_interface::state::TokenDataVersion; use rand::{prelude::SliceRandom, rngs::StdRng, Rng, SeedableRng}; use serial_test::serial; diff --git a/forester/tests/test_compressible_ctoken.rs b/forester/tests/test_compressible_ctoken.rs index c4ba53697e..4bd135b9b5 100644 --- a/forester/tests/test_compressible_ctoken.rs +++ b/forester/tests/test_compressible_ctoken.rs @@ -21,7 +21,7 @@ use light_registry::{ utils::{get_forester_pda, get_protocol_config_pda_address}, ForesterConfig, }; -use light_token_client::actions::{ +use light_test_utils::actions::legacy::{ create_compressible_token_account, CreateCompressibleTokenAccountInputs, }; use light_token_interface::state::TokenDataVersion; diff --git a/program-tests/compressed-token-test/tests/compress_only/all.rs b/program-tests/compressed-token-test/tests/compress_only/all.rs index 89be839c88..1dca92d9ea 100644 --- a/program-tests/compressed-token-test/tests/compress_only/all.rs +++ b/program-tests/compressed-token-test/tests/compress_only/all.rs @@ -21,11 +21,13 @@ async fn test_compress_and_close_ctoken_with_extensions() { use light_client::indexer::CompressedTokenAccount; use light_client::indexer::Indexer; use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index; - use light_test_utils::mint_2022::{create_token_22_account, mint_spl_tokens_22}; - use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}; - use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + }, + mint_2022::{create_token_22_account, mint_spl_tokens_22}, }; + use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}; use light_token_interface::{ instructions::extensions::{ CompressedOnlyExtensionInstructionData, ExtensionInstructionData, diff --git a/program-tests/compressed-token-test/tests/compress_only/ata_decompress.rs b/program-tests/compressed-token-test/tests/compress_only/ata_decompress.rs index 3fff58d3ac..1f5f9453be 100644 --- a/program-tests/compressed-token-test/tests/compress_only/ata_decompress.rs +++ b/program-tests/compressed-token-test/tests/compress_only/ata_decompress.rs @@ -9,6 +9,9 @@ use light_program_test::{ program_test::TestRpc, utils::assert::assert_rpc_error, LightProgramTest, ProgramTestConfig, }; use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + }, mint_2022::{ create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22, RESTRICTED_EXTENSIONS, @@ -19,9 +22,6 @@ use light_token::instruction::{ derive_token_ata, CompressibleParams, CreateAssociatedTokenAccount, CreateTokenAccount, TransferFromSpl, }; -use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, -}; use light_token_interface::{ instructions::extensions::{CompressedOnlyExtensionInstructionData, ExtensionInstructionData}, state::{ExtensionStruct, TokenDataVersion}, diff --git a/program-tests/compressed-token-test/tests/compress_only/decompress_restrictions.rs b/program-tests/compressed-token-test/tests/compress_only/decompress_restrictions.rs index 430b3ed59a..4f23f42292 100644 --- a/program-tests/compressed-token-test/tests/compress_only/decompress_restrictions.rs +++ b/program-tests/compressed-token-test/tests/compress_only/decompress_restrictions.rs @@ -11,14 +11,16 @@ use light_program_test::{ utils::assert::assert_rpc_error, ProgramTestConfig, Rpc, }; -use light_test_utils::mint_2022::{ - create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22, - RESTRICTED_EXTENSIONS, +use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + }, + mint_2022::{ + create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22, + RESTRICTED_EXTENSIONS, + }, }; use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}; -use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, -}; use light_token_interface::{ instructions::extensions::{CompressedOnlyExtensionInstructionData, ExtensionInstructionData}, state::TokenDataVersion, diff --git a/program-tests/compressed-token-test/tests/compress_only/invalid_destination.rs b/program-tests/compressed-token-test/tests/compress_only/invalid_destination.rs index b9c35082eb..e085af3c5b 100644 --- a/program-tests/compressed-token-test/tests/compress_only/invalid_destination.rs +++ b/program-tests/compressed-token-test/tests/compress_only/invalid_destination.rs @@ -14,14 +14,16 @@ use light_program_test::{ utils::assert::assert_rpc_error, ProgramTestConfig, Rpc, }; -use light_test_utils::mint_2022::{ - create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22, - RESTRICTED_EXTENSIONS, +use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + }, + mint_2022::{ + create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22, + RESTRICTED_EXTENSIONS, + }, }; use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}; -use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, -}; use light_token_interface::{ instructions::extensions::{CompressedOnlyExtensionInstructionData, ExtensionInstructionData}, state::TokenDataVersion, diff --git a/program-tests/compressed-token-test/tests/compress_only/invalid_extension_state.rs b/program-tests/compressed-token-test/tests/compress_only/invalid_extension_state.rs index e54222acde..3122555dd4 100644 --- a/program-tests/compressed-token-test/tests/compress_only/invalid_extension_state.rs +++ b/program-tests/compressed-token-test/tests/compress_only/invalid_extension_state.rs @@ -18,15 +18,17 @@ use light_program_test::{ utils::assert::assert_rpc_error, ProgramTestConfig, Rpc, }; -use light_test_utils::mint_2022::{ - create_token_22_account, mint_spl_tokens_22, set_mint_transfer_fee, set_mint_transfer_hook, +use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + }, + mint_2022::{ + create_token_22_account, mint_spl_tokens_22, set_mint_transfer_fee, set_mint_transfer_hook, + }, }; use light_token::instruction::{ CompressibleParams, CreateTokenAccount, TransferFromSpl, TransferToSpl, }; -use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, -}; use light_token_interface::{ find_spl_interface_pda_with_index, instructions::extensions::{CompressedOnlyExtensionInstructionData, ExtensionInstructionData}, diff --git a/program-tests/compressed-token-test/tests/compress_only/mod.rs b/program-tests/compressed-token-test/tests/compress_only/mod.rs index f0aeff10c7..f0fc95c6cf 100644 --- a/program-tests/compressed-token-test/tests/compress_only/mod.rs +++ b/program-tests/compressed-token-test/tests/compress_only/mod.rs @@ -155,10 +155,10 @@ pub async fn run_compress_and_close_extension_test( ) -> Result<(), RpcError> { use light_client::indexer::Indexer; use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index; - use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}; - use light_token_client::instructions::transfer2::{ + use light_test_utils::actions::legacy::instructions::transfer2::{ create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, }; + use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}; use light_token_interface::{ instructions::extensions::{ CompressedOnlyExtensionInstructionData, ExtensionInstructionData, diff --git a/program-tests/compressed-token-test/tests/compress_only/withheld_fee.rs b/program-tests/compressed-token-test/tests/compress_only/withheld_fee.rs index 0caa35e5ca..65d720d7f0 100644 --- a/program-tests/compressed-token-test/tests/compress_only/withheld_fee.rs +++ b/program-tests/compressed-token-test/tests/compress_only/withheld_fee.rs @@ -8,13 +8,13 @@ use light_client::indexer::Indexer; use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index; use light_program_test::{program_test::TestRpc, LightProgramTest, ProgramTestConfig}; use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + }, mint_2022::{create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22}, Rpc, RpcError, }; use light_token::instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}; -use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, -}; use light_token_interface::{ instructions::extensions::{CompressedOnlyExtensionInstructionData, ExtensionInstructionData}, state::{ diff --git a/program-tests/compressed-token-test/tests/freeze/compress_only.rs b/program-tests/compressed-token-test/tests/freeze/compress_only.rs index f54429f5de..d9d7eebd75 100644 --- a/program-tests/compressed-token-test/tests/freeze/compress_only.rs +++ b/program-tests/compressed-token-test/tests/freeze/compress_only.rs @@ -10,6 +10,9 @@ use light_compressed_token::freeze::sdk::{ use light_compressed_token_sdk::spl_interface::find_spl_interface_pda_with_index; use light_program_test::{program_test::TestRpc, LightProgramTest, ProgramTestConfig}; use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, + }, conversions::sdk_to_program_token_data, mint_2022::{ create_mint_22_with_extension_types, create_token_22_account, mint_spl_tokens_22, @@ -21,9 +24,6 @@ use light_token::{ compat::{AccountState, TokenDataWithMerkleContext}, instruction::{CompressibleParams, CreateTokenAccount, TransferFromSpl}, }; -use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, -}; use light_token_interface::{ instructions::extensions::{CompressedOnlyExtensionInstructionData, ExtensionInstructionData}, state::TokenDataVersion, diff --git a/program-tests/compressed-token-test/tests/freeze/functional.rs b/program-tests/compressed-token-test/tests/freeze/functional.rs index 4796a59a71..5d43d66015 100644 --- a/program-tests/compressed-token-test/tests/freeze/functional.rs +++ b/program-tests/compressed-token-test/tests/freeze/functional.rs @@ -10,11 +10,13 @@ use light_compressed_token::freeze::sdk::{ use light_program_test::{LightProgramTest, ProgramTestConfig}; use light_prover_client::prover::spawn_prover; use light_test_utils::{ - conversions::sdk_to_program_token_data, mint_2022::create_token_22_account, - spl::create_mint_22_helper, Rpc, RpcError, + actions::transfer2::{compress_with_version, decompress}, + conversions::sdk_to_program_token_data, + mint_2022::create_token_22_account, + spl::create_mint_22_helper, + Rpc, RpcError, }; use light_token::compat::{AccountState, TokenDataWithMerkleContext}; -use light_token_client::actions::transfer2::{compress_with_version, decompress}; use light_token_interface::state::TokenDataVersion; use serial_test::serial; use solana_sdk::{program_pack::Pack, pubkey::Pubkey, signature::Keypair, signer::Signer}; diff --git a/program-tests/compressed-token-test/tests/light_token/burn.rs b/program-tests/compressed-token-test/tests/light_token/burn.rs index 8490655227..01ba115ef1 100644 --- a/program-tests/compressed-token-test/tests/light_token/burn.rs +++ b/program-tests/compressed-token-test/tests/light_token/burn.rs @@ -21,9 +21,11 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::find_m use light_program_test::{ program_test::TestRpc, utils::assert::assert_rpc_error, LightProgramTest, ProgramTestConfig, }; -use light_test_utils::assert_ctoken_burn::assert_ctoken_burn; +use light_test_utils::{ + actions::legacy::instructions::mint_action::DecompressMintParams, + assert_ctoken_burn::assert_ctoken_burn, +}; use light_token::instruction::{derive_token_ata, Burn, CreateAssociatedTokenAccount, MintTo}; -use light_token_client::instructions::mint_action::DecompressMintParams; use super::shared::*; @@ -346,7 +348,7 @@ async fn setup_burn_test() -> BurnTestContext { .unwrap(); // Step 2: Create compressed mint + Mint (no recipients) - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -357,14 +359,16 @@ async fn setup_burn_test() -> BurnTestContext { vec![], // No ctoken recipients None, // No mint authority update None, // No freeze authority update - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 8, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 8, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, + }, + ), ) .await .unwrap(); diff --git a/program-tests/compressed-token-test/tests/light_token/compress_and_close.rs b/program-tests/compressed-token-test/tests/light_token/compress_and_close.rs index d858945406..ec78b45615 100644 --- a/program-tests/compressed-token-test/tests/light_token/compress_and_close.rs +++ b/program-tests/compressed-token-test/tests/light_token/compress_and_close.rs @@ -101,7 +101,7 @@ async fn test_compress_and_close_owner_scenarios() { .unwrap(); // Create compress_and_close instruction with is_compressible=false for non-compressible account - use light_token_client::instructions::transfer2::{ + use light_test_utils::actions::legacy::instructions::transfer2::{ create_generic_transfer2_instruction, CompressAndCloseInput, Transfer2InstructionType, }; @@ -180,7 +180,7 @@ async fn test_compress_and_close_owner_scenarios() { context.rpc.set_account(ata_pubkey, ata_account); // Create compress_and_close instruction manually for ATA - use light_token_client::instructions::transfer2::{ + use light_test_utils::actions::legacy::instructions::transfer2::{ create_generic_transfer2_instruction, CompressAndCloseInput, Transfer2InstructionType, }; @@ -289,8 +289,10 @@ async fn test_compress_and_close_rent_authority_scenarios() { .unwrap(); // Assert compress and close succeeded - use light_test_utils::assert_transfer2::assert_transfer2_compress_and_close; - use light_token_client::instructions::transfer2::CompressAndCloseInput; + use light_test_utils::{ + actions::legacy::instructions::transfer2::CompressAndCloseInput, + assert_transfer2::assert_transfer2_compress_and_close, + }; let output_queue = context.rpc.get_random_state_tree_info().unwrap().queue; assert_transfer2_compress_and_close( @@ -342,8 +344,10 @@ async fn test_compress_and_close_rent_authority_scenarios() { .unwrap(); // Assert compress and close succeeded - use light_test_utils::assert_transfer2::assert_transfer2_compress_and_close; - use light_token_client::instructions::transfer2::CompressAndCloseInput; + use light_test_utils::{ + actions::legacy::instructions::transfer2::CompressAndCloseInput, + assert_transfer2::assert_transfer2_compress_and_close, + }; let output_queue = context.rpc.get_random_state_tree_info().unwrap().queue; assert_transfer2_compress_and_close( @@ -400,8 +404,10 @@ async fn test_compress_and_close_rent_authority_scenarios() { .unwrap(); // Assert compress and close succeeded - use light_test_utils::assert_transfer2::assert_transfer2_compress_and_close; - use light_token_client::instructions::transfer2::CompressAndCloseInput; + use light_test_utils::{ + actions::legacy::instructions::transfer2::CompressAndCloseInput, + assert_transfer2::assert_transfer2_compress_and_close, + }; let output_queue = context.rpc.get_random_state_tree_info().unwrap().queue; assert_transfer2_compress_and_close( @@ -481,8 +487,10 @@ async fn test_compress_and_close_compress_to_pubkey() { .unwrap(); // Assert compress and close succeeded - the owner in compressed output should be the token_account_pubkey - use light_test_utils::assert_transfer2::assert_transfer2_compress_and_close; - use light_token_client::instructions::transfer2::CompressAndCloseInput; + use light_test_utils::{ + actions::legacy::instructions::transfer2::CompressAndCloseInput, + assert_transfer2::assert_transfer2_compress_and_close, + }; let output_queue = context.rpc.get_random_state_tree_info().unwrap().queue; assert_transfer2_compress_and_close( @@ -880,8 +888,10 @@ async fn test_compress_and_close_output_validation_errors() { .unwrap(); // Assert compress and close succeeded - use light_test_utils::assert_transfer2::assert_transfer2_compress_and_close; - use light_token_client::instructions::transfer2::CompressAndCloseInput; + use light_test_utils::{ + actions::legacy::instructions::transfer2::CompressAndCloseInput, + assert_transfer2::assert_transfer2_compress_and_close, + }; let output_queue = context.rpc.get_random_state_tree_info().unwrap().queue; assert_transfer2_compress_and_close( @@ -957,8 +967,10 @@ async fn test_compress_and_close_output_validation_errors() { .unwrap(); // Assert compress and close succeeded - use light_test_utils::assert_transfer2::assert_transfer2_compress_and_close; - use light_token_client::instructions::transfer2::CompressAndCloseInput; + use light_test_utils::{ + actions::legacy::instructions::transfer2::CompressAndCloseInput, + assert_transfer2::assert_transfer2_compress_and_close, + }; let output_queue = context.rpc.get_random_state_tree_info().unwrap().queue; assert_transfer2_compress_and_close( diff --git a/program-tests/compressed-token-test/tests/light_token/extensions.rs b/program-tests/compressed-token-test/tests/light_token/extensions.rs index 5b1c737e87..1061b5bd5e 100644 --- a/program-tests/compressed-token-test/tests/light_token/extensions.rs +++ b/program-tests/compressed-token-test/tests/light_token/extensions.rs @@ -5,15 +5,15 @@ use light_program_test::{utils::assert::assert_rpc_error, LightProgramTest, ProgramTestConfig}; use light_test_utils::{ + actions::legacy::instructions::transfer2::{ + create_generic_transfer2_instruction, CompressInput, Transfer2InstructionType, + }, mint_2022::{ create_mint_22_with_extensions, create_token_22_account, mint_spl_tokens_22, Token22ExtensionConfig, }, Rpc, RpcError, }; -use light_token_client::instructions::transfer2::{ - create_generic_transfer2_instruction, CompressInput, Transfer2InstructionType, -}; use light_token_interface::state::{ ExtensionStruct, PausableAccountExtension, PermanentDelegateAccountExtension, TransferFeeAccountExtension, TransferHookAccountExtension, ACCOUNT_TYPE_TOKEN_ACCOUNT, diff --git a/program-tests/compressed-token-test/tests/light_token/shared.rs b/program-tests/compressed-token-test/tests/light_token/shared.rs index d177bf1665..78811c89bc 100644 --- a/program-tests/compressed-token-test/tests/light_token/shared.rs +++ b/program-tests/compressed-token-test/tests/light_token/shared.rs @@ -6,6 +6,7 @@ pub use light_program_test::{ }; use light_registry::compressible::compressed_token::CompressAndCloseIndices; pub use light_test_utils::{ + actions::legacy::{instructions::transfer2::CompressInput, transfer2::compress}, assert_close_token_account::assert_close_token_account, assert_create_token_account::{ assert_create_associated_token_account, assert_create_token_account, CompressibleData, @@ -18,9 +19,6 @@ pub use light_token::instruction::{ derive_token_ata, Approve, CloseAccount, CompressibleParams, CreateAssociatedTokenAccount, CreateTokenAccount, Revoke, }; -pub use light_token_client::{ - actions::transfer2::compress, instructions::transfer2::CompressInput, -}; pub use serial_test::serial; pub use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; /// Shared test context for account operations @@ -575,7 +573,7 @@ pub async fn compress_and_close_and_assert_fails( name: &str, expected_error_code: u32, ) { - use light_token_client::instructions::transfer2::{ + use light_test_utils::actions::legacy::instructions::transfer2::{ create_generic_transfer2_instruction, CompressAndCloseInput, Transfer2InstructionType, }; diff --git a/program-tests/compressed-token-test/tests/light_token/spl_instruction_compat.rs b/program-tests/compressed-token-test/tests/light_token/spl_instruction_compat.rs index 71ec389827..5084f479f9 100644 --- a/program-tests/compressed-token-test/tests/light_token/spl_instruction_compat.rs +++ b/program-tests/compressed-token-test/tests/light_token/spl_instruction_compat.rs @@ -426,7 +426,7 @@ async fn test_spl_instruction_compatibility() { async fn test_spl_instruction_compatibility_with_mint() { use light_compressed_token_sdk::compressed_token::create_compressed_mint::find_mint_address; use light_program_test::ProgramTestConfig; - use light_token_client::instructions::mint_action::DecompressMintParams; + use light_test_utils::actions::legacy::instructions::mint_action::DecompressMintParams; // Set up test environment let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) @@ -446,7 +446,7 @@ async fn test_spl_instruction_compatibility_with_mint() { println!("Creating decompressed mint with freeze authority..."); // Create compressed mint + Mint (decompressed mint) - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -457,14 +457,16 @@ async fn test_spl_instruction_compatibility_with_mint() { vec![], // No ctoken recipients None, // No mint authority update None, // No freeze authority update - Some(light_token_client::instructions::mint_action::NewMint { - decimals, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: Some(freeze_authority.pubkey()), - metadata: None, - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: Some(freeze_authority.pubkey()), + metadata: None, + version: 3, + }, + ), ) .await .unwrap(); diff --git a/program-tests/compressed-token-test/tests/mint/burn.rs b/program-tests/compressed-token-test/tests/mint/burn.rs index a17d1a45ef..259ca534e2 100644 --- a/program-tests/compressed-token-test/tests/mint/burn.rs +++ b/program-tests/compressed-token-test/tests/mint/burn.rs @@ -1,8 +1,10 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::find_mint_address; use light_program_test::{LightProgramTest, ProgramTestConfig}; -use light_test_utils::{assert_ctoken_burn::assert_ctoken_burn, Rpc}; +use light_test_utils::{ + actions::legacy::instructions::mint_action::DecompressMintParams, + assert_ctoken_burn::assert_ctoken_burn, Rpc, +}; use light_token::instruction::{derive_token_ata, Burn, CreateAssociatedTokenAccount}; -use light_token_client::instructions::mint_action::DecompressMintParams; use light_token_interface::instructions::mint_action::Recipient; use serial_test::serial; use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; @@ -50,7 +52,7 @@ async fn setup_burn_test(mint_amount: u64) -> BurnTestContext { .unwrap(); // Step 2: Create compressed mint + Mint + mint tokens in one call - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -64,14 +66,16 @@ async fn setup_burn_test(mint_amount: u64) -> BurnTestContext { }], // Mint to Light Token in same tx None, // No mint authority update None, // No freeze authority update - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 8, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 8, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, + }, + ), ) .await .unwrap(); diff --git a/program-tests/compressed-token-test/tests/mint/cmint_resize.rs b/program-tests/compressed-token-test/tests/mint/cmint_resize.rs index 1e654664c7..be80b5fc81 100644 --- a/program-tests/compressed-token-test/tests/mint/cmint_resize.rs +++ b/program-tests/compressed-token-test/tests/mint/cmint_resize.rs @@ -15,16 +15,20 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::{ derive_mint_compressed_address, find_mint_address, }; use light_program_test::{LightProgramTest, ProgramTestConfig}; -use light_test_utils::{assert_mint_action::assert_mint_action, Rpc}; +use light_test_utils::{ + actions::{ + create_mint, + legacy::instructions::mint_action::{ + DecompressMintParams, MintActionParams, MintActionType, MintToRecipient, + }, + mint_action, mint_action_comprehensive, + }, + assert_mint_action::assert_mint_action, + Rpc, +}; use light_token::instruction::{ derive_token_ata, CompressibleParams, CreateAssociatedTokenAccount, }; -use light_token_client::{ - actions::create_mint, - instructions::mint_action::{ - DecompressMintParams, MintActionParams, MintActionType, MintToRecipient, - }, -}; use light_token_interface::{ instructions::extensions::token_metadata::TokenMetadataInstructionData, state::{extensions::AdditionalMetadata, Mint, TokenDataVersion}, @@ -75,7 +79,7 @@ async fn test_cmint_update_metadata_grow() { .unwrap(); // 2. Decompress to CMint (creates on-chain account) - light_token_client::actions::mint_action_comprehensive( + mint_action_comprehensive( &mut rpc, &mint_seed, &authority, @@ -110,7 +114,7 @@ async fn test_cmint_update_metadata_grow() { .to_vec(), }]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -174,7 +178,7 @@ async fn test_cmint_update_metadata_shrink() { .unwrap(); // 2. Decompress to CMint - light_token_client::actions::mint_action_comprehensive( + mint_action_comprehensive( &mut rpc, &mint_seed, &authority, @@ -207,7 +211,7 @@ async fn test_cmint_update_metadata_shrink() { value: "Short".as_bytes().to_vec(), }]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -276,7 +280,7 @@ async fn test_cmint_remove_metadata_key() { .unwrap(); // 2. Decompress to CMint - light_token_client::actions::mint_action_comprehensive( + mint_action_comprehensive( &mut rpc, &mint_seed, &authority, @@ -308,7 +312,7 @@ async fn test_cmint_remove_metadata_key() { idempotent: 0, }]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -377,7 +381,7 @@ async fn test_cmint_multiple_metadata_changes() { .unwrap(); // 2. Decompress to CMint - light_token_client::actions::mint_action_comprehensive( + mint_action_comprehensive( &mut rpc, &mint_seed, &authority, @@ -423,7 +427,7 @@ async fn test_cmint_multiple_metadata_changes() { }, ]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -495,7 +499,7 @@ async fn test_cmint_all_operations() { .unwrap(); // 2. Decompress to CMint - light_token_client::actions::mint_action_comprehensive( + mint_action_comprehensive( &mut rpc, &mint_seed, &authority, @@ -614,7 +618,7 @@ async fn test_cmint_all_operations() { }, ]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -697,7 +701,7 @@ async fn test_decompress_with_mint_to() { }, ]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -778,7 +782,7 @@ async fn test_decompress_with_authority_updates() { }, ]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -862,7 +866,7 @@ async fn test_decompress_with_metadata_update() { }, ]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -968,7 +972,7 @@ async fn test_decompress_with_mint_to_ctoken() { }, ]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, @@ -1144,7 +1148,7 @@ async fn test_decompress_with_all_operations() { }, ]; - light_token_client::actions::mint_action( + mint_action( &mut rpc, MintActionParams { compressed_mint_address, diff --git a/program-tests/compressed-token-test/tests/mint/edge_cases.rs b/program-tests/compressed-token-test/tests/mint/edge_cases.rs index 2196795fc9..0572b51aa1 100644 --- a/program-tests/compressed-token-test/tests/mint/edge_cases.rs +++ b/program-tests/compressed-token-test/tests/mint/edge_cases.rs @@ -5,13 +5,15 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::{ }; use light_program_test::{LightProgramTest, ProgramTestConfig}; use light_test_utils::{ - assert_mint_action::assert_mint_action, mint_assert::assert_compressed_mint_account, Rpc, + actions::{ + create_mint, + legacy::instructions::mint_action::{MintActionType, MintToRecipient}, + }, + assert_mint_action::assert_mint_action, + mint_assert::assert_compressed_mint_account, + Rpc, }; use light_token::instruction::{CompressibleParams, CreateAssociatedTokenAccount}; -use light_token_client::{ - actions::create_mint, - instructions::mint_action::{MintActionType, MintToRecipient}, -}; use light_token_interface::state::{extensions::AdditionalMetadata, Mint, TokenDataVersion}; use serial_test::serial; use solana_sdk::{signature::Keypair, signer::Signer}; @@ -249,9 +251,9 @@ async fn functional_all_in_one_instruction() { .unwrap(); // Execute all actions in a single instruction - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: authority.pubkey(), diff --git a/program-tests/compressed-token-test/tests/mint/failing.rs b/program-tests/compressed-token-test/tests/mint/failing.rs index 721053e462..48b5246ec8 100644 --- a/program-tests/compressed-token-test/tests/mint/failing.rs +++ b/program-tests/compressed-token-test/tests/mint/failing.rs @@ -7,13 +7,15 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::{ }; use light_program_test::{utils::assert::assert_rpc_error, LightProgramTest, ProgramTestConfig}; use light_test_utils::{ - assert_mint_action::assert_mint_action, mint_assert::assert_compressed_mint_account, Rpc, + actions::{ + create_mint, + legacy::instructions::mint_action::{MintActionType, MintToRecipient}, + }, + assert_mint_action::assert_mint_action, + mint_assert::assert_compressed_mint_account, + Rpc, }; use light_token::instruction::{CompressibleParams, CreateAssociatedTokenAccount}; -use light_token_client::{ - actions::create_mint, - instructions::mint_action::{MintActionType, MintToRecipient}, -}; use light_token_interface::state::{extensions::AdditionalMetadata, Mint}; use serial_test::serial; use solana_sdk::{ @@ -116,7 +118,7 @@ async fn functional_and_failing_tests() { // 2. FAIL - Create mint with duplicate metadata keys { let duplicate_mint_seed = Keypair::new(); - let result = light_token_client::actions::create_mint( + let result = light_test_utils::actions::create_mint( &mut rpc, &duplicate_mint_seed, // Use new mint seed 8, // decimals @@ -186,7 +188,7 @@ async fn functional_and_failing_tests() { // 3. MintToCompressed with invalid mint authority { - let result = light_token_client::actions::mint_to_compressed( + let result = light_test_utils::actions::mint_to_compressed( &mut rpc, spl_mint_pda, vec![ @@ -224,7 +226,7 @@ async fn functional_and_failing_tests() { .unwrap(); let recipient = Keypair::new().pubkey(); - let result = light_token_client::actions::mint_to_compressed( + let result = light_test_utils::actions::mint_to_compressed( &mut rpc, spl_mint_pda, vec![ @@ -268,7 +270,7 @@ async fn functional_and_failing_tests() { // 5. UpdateMintAuthority with invalid mint authority { - let result = light_token_client::actions::update_mint_authority( + let result = light_test_utils::actions::update_mint_authority( &mut rpc, &invalid_mint_authority, // Invalid authority Some(Keypair::new().pubkey()), @@ -301,7 +303,7 @@ async fn functional_and_failing_tests() { ) .unwrap(); - let result = light_token_client::actions::update_mint_authority( + let result = light_test_utils::actions::update_mint_authority( &mut rpc, &mint_authority, // Valid current authority Some(new_mint_authority.pubkey()), @@ -338,7 +340,7 @@ async fn functional_and_failing_tests() { .value .unwrap(); - let result = light_token_client::actions::update_freeze_authority( + let result = light_test_utils::actions::update_freeze_authority( &mut rpc, &invalid_freeze_authority, // Invalid authority Some(Keypair::new().pubkey()), @@ -372,7 +374,7 @@ async fn functional_and_failing_tests() { ) .unwrap(); - let result = light_token_client::actions::update_freeze_authority( + let result = light_test_utils::actions::update_freeze_authority( &mut rpc, &freeze_authority, // Valid current freeze authority Some(new_freeze_authority.pubkey()), @@ -413,7 +415,7 @@ async fn functional_and_failing_tests() { .unwrap(); // Try to mint with invalid authority - let result = light_token_client::actions::mint_action_comprehensive( + let result = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &invalid_mint_authority, // Invalid authority @@ -471,7 +473,7 @@ async fn functional_and_failing_tests() { light_token::instruction::derive_token_ata(&recipient2.pubkey(), &spl_mint_pda).0; // Try to mint with valid NEW authority (since we updated it) - let result = light_token_client::actions::mint_action_comprehensive( + let result = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &new_mint_authority, // Valid NEW authority after update @@ -508,9 +510,9 @@ async fn functional_and_failing_tests() { // 11. UpdateMetadataField with invalid metadata authority { - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: invalid_metadata_authority.pubkey(), // Invalid authority @@ -558,9 +560,9 @@ async fn functional_and_failing_tests() { value: "Updated Token Name".as_bytes().to_vec(), }]; - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: metadata_authority.pubkey(), // Valid metadata authority @@ -591,9 +593,9 @@ async fn functional_and_failing_tests() { // 13. UpdateMetadataAuthority with invalid metadata authority { - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: invalid_metadata_authority.pubkey(), // Invalid authority @@ -637,9 +639,9 @@ async fn functional_and_failing_tests() { new_authority: new_metadata_authority.pubkey(), }]; - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: metadata_authority.pubkey(), // Valid current metadata authority @@ -670,9 +672,9 @@ async fn functional_and_failing_tests() { // 15. RemoveMetadataKey with invalid metadata authority { - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: invalid_metadata_authority.pubkey(), // Invalid authority @@ -718,9 +720,9 @@ async fn functional_and_failing_tests() { idempotent: 0, // 0 = false }]; - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: new_metadata_authority.pubkey(), // Valid NEW metadata authority after update @@ -771,9 +773,9 @@ async fn functional_and_failing_tests() { idempotent: 1, // 1 = true (won't error if key doesn't exist) }]; - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: new_metadata_authority.pubkey(), // Valid NEW metadata authority @@ -977,7 +979,7 @@ async fn test_create_mint_non_signer_mint_signer() { // Create the instruction using the helper function let mut instruction = - light_token_client::instructions::create_mint::create_compressed_mint_instruction( + light_test_utils::actions::legacy::instructions::create_mint::create_compressed_mint_instruction( &mut rpc, &mint_seed, 8, // decimals @@ -1026,7 +1028,7 @@ async fn test_compress_and_close_mint_must_be_only_action() { use light_compressed_token_sdk::compressed_token::create_compressed_mint::derive_mint_compressed_address; use light_compressible::rent::SLOTS_PER_EPOCH; use light_program_test::program_test::TestRpc; - use light_token_client::instructions::mint_action::DecompressMintParams; + use light_test_utils::actions::legacy::instructions::mint_action::DecompressMintParams; let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2(false, None)) .await @@ -1048,7 +1050,7 @@ async fn test_compress_and_close_mint_must_be_only_action() { derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree_pubkey); // 1. Create compressed mint with Mint (decompressed) - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -1059,14 +1061,16 @@ async fn test_compress_and_close_mint_must_be_only_action() { vec![], None, None, - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 9, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 9, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, + }, + ), ) .await .unwrap(); @@ -1076,9 +1080,9 @@ async fn test_compress_and_close_mint_must_be_only_action() { // 2. Try to combine CompressAndCloseMint with UpdateMintAuthority let new_authority = Keypair::new(); - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: mint_authority.pubkey(), diff --git a/program-tests/compressed-token-test/tests/mint/functional.rs b/program-tests/compressed-token-test/tests/mint/functional.rs index 36a15e9c6c..1440b8f2be 100644 --- a/program-tests/compressed-token-test/tests/mint/functional.rs +++ b/program-tests/compressed-token-test/tests/mint/functional.rs @@ -6,6 +6,17 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::{ use light_compressible::{compression_info::CompressionInfo, rent::SLOTS_PER_EPOCH}; use light_program_test::{program_test::TestRpc, LightProgramTest, ProgramTestConfig}; use light_test_utils::{ + actions::{ + create_mint, + legacy::instructions::{ + mint_action::{DecompressMintParams, MintActionType}, + transfer2::{ + create_decompress_instruction, create_generic_transfer2_instruction, CompressInput, + DecompressInput, Transfer2InstructionType, TransferInput, + }, + }, + mint_to_compressed, transfer, transfer2, + }, assert_ctoken_transfer::assert_ctoken_transfer, assert_mint_action::assert_mint_action, assert_mint_to_compressed::{assert_mint_to_compressed, assert_mint_to_compressed_one}, @@ -19,16 +30,6 @@ use light_test_utils::{ use light_token::instruction::{ derive_token_ata, CompressibleParams, CreateAssociatedTokenAccount, }; -use light_token_client::{ - actions::{create_mint, mint_to_compressed, transfer, transfer2}, - instructions::{ - mint_action::{DecompressMintParams, MintActionType}, - transfer2::{ - create_decompress_instruction, create_generic_transfer2_instruction, CompressInput, - DecompressInput, Transfer2InstructionType, TransferInput, - }, - }, -}; use light_token_interface::{ instructions::{ extensions::token_metadata::TokenMetadataInstructionData, mint_action::Recipient, @@ -185,7 +186,7 @@ async fn test_create_compressed_mint() { // Verify the transfer was successful using new transfer wrapper assert_transfer2_transfer( &mut rpc, - light_token_client::instructions::transfer2::TransferInput { + light_test_utils::actions::legacy::instructions::transfer2::TransferInput { compressed_token_account: compressed_token_accounts, to: new_recipient, amount: transfer_amount, @@ -258,7 +259,7 @@ async fn test_create_compressed_mint() { // Use comprehensive decompress assertion assert_transfer2_decompress( &mut rpc, - light_token_client::instructions::transfer2::DecompressInput { + light_test_utils::actions::legacy::instructions::transfer2::DecompressInput { pool_index: None, compressed_token_account: vec![compressed_token_account.clone()], decompress_amount, @@ -317,7 +318,7 @@ async fn test_create_compressed_mint() { // Use comprehensive compress assertion assert_transfer2_compress( &mut rpc, - light_token_client::instructions::transfer2::CompressInput { + light_test_utils::actions::legacy::instructions::transfer2::CompressInput { compressed_token_account: None, solana_token_account: ctoken_ata_pubkey, to: compress_recipient.pubkey(), @@ -567,7 +568,7 @@ async fn test_update_compressed_mint_authority() { .unwrap(); // 2. Update mint authority - let _signature = light_token_client::actions::update_mint_authority( + let _signature = light_test_utils::actions::update_mint_authority( &mut rpc, &initial_mint_authority, Some(new_mint_authority.pubkey()), @@ -594,7 +595,7 @@ async fn test_update_compressed_mint_authority() { new_mint_authority.pubkey() ); // 3. Update freeze authority (need to preserve mint authority) - let _signature = light_token_client::actions::update_freeze_authority( + let _signature = light_test_utils::actions::update_freeze_authority( &mut rpc, &initial_freeze_authority, Some(new_freeze_authority.pubkey()), @@ -639,7 +640,7 @@ async fn test_update_compressed_mint_authority() { .find(|account| account.address == Some(compressed_mint_address)) .expect("Updated compressed mint account not found"); - let _signature = light_token_client::actions::update_mint_authority( + let _signature = light_test_utils::actions::update_mint_authority( &mut rpc, &new_mint_authority, None, // Revoke authority @@ -719,7 +720,7 @@ async fn test_ctoken_transfer() { amount: 100000000u64, }]; - let signature = light_token_client::actions::mint_action_comprehensive( + let signature = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -730,14 +731,16 @@ async fn test_ctoken_transfer() { decompressed_recipients, // mint to decompressed recipients None, // no mint authority update None, // no freeze authority update - Some(light_token_client::instructions::mint_action::NewMint { - decimals, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: Some(freeze_authority.pubkey()), - metadata: None, // No metadata for simplicity - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: Some(freeze_authority.pubkey()), + metadata: None, // No metadata for simplicity + version: 3, + }, + ), ) .await .unwrap(); @@ -929,7 +932,7 @@ async fn test_ctoken_transfer() { // Use comprehensive compress assertion assert_transfer2_compress( &mut rpc, - light_token_client::instructions::transfer2::CompressInput { + light_test_utils::actions::legacy::instructions::transfer2::CompressInput { pool_index: None, compressed_token_account: None, solana_token_account: second_recipient_ata, @@ -1171,7 +1174,7 @@ async fn test_mint_actions() { rpc.context.warp_to_slot(1); // === SINGLE MINT ACTION INSTRUCTION === // Execute ONE instruction with ALL actions - let signature = light_token_client::actions::mint_action_comprehensive( + let signature = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -1182,7 +1185,7 @@ async fn test_mint_actions() { vec![], // mint_to_decompressed_recipients Some(new_mint_authority.pubkey()), // update_mint_authority None, // update_freeze_authority - Some(light_token_client::instructions::mint_action::NewMint { + Some(light_test_utils::actions::legacy::instructions::mint_action::NewMint { decimals, supply: 0, mint_authority: mint_authority.pubkey(), @@ -1326,7 +1329,7 @@ async fn test_mint_actions() { let additional_mint_amount = 7500u64; rpc.context.warp_to_slot(3); // Execute mint_action on existing mint (no creation) - let signature2 = light_token_client::actions::mint_action_comprehensive( + let signature2 = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &new_mint_authority, // Current authority from first test (now the authority for this mint) @@ -1418,7 +1421,7 @@ async fn test_create_compressed_mint_with_mint() { let (mint_pda, _mint_bump) = find_mint_address(&mint_seed.pubkey()); // Create mint + decompress in single instruction - let signature = light_token_client::actions::mint_action_comprehensive( + let signature = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -1429,14 +1432,16 @@ async fn test_create_compressed_mint_with_mint() { vec![], // no decompressed recipients None, // no mint authority update None, // no freeze authority update - Some(light_token_client::instructions::mint_action::NewMint { - decimals, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: Some(freeze_authority.pubkey()), - metadata: None, - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: Some(freeze_authority.pubkey()), + metadata: None, + version: 3, + }, + ), ) .await .unwrap(); @@ -1495,7 +1500,7 @@ async fn test_create_compressed_mint_with_mint() { .expect("Failed to deserialize Mint data"); // Compress and close Mint (permissionless when rent expired) - let close_signature = light_token_client::actions::mint_action_comprehensive( + let close_signature = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -1552,7 +1557,7 @@ async fn test_compress_and_close_mint_idempotent() { let (mint_pda, _) = find_mint_address(&mint_seed.pubkey()); // 1. Create compressed mint WITH Mint (decompress_mint = true) - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -1563,14 +1568,16 @@ async fn test_compress_and_close_mint_idempotent() { vec![], None, None, - Some(light_token_client::instructions::mint_action::NewMint { - decimals, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: Some(freeze_authority.pubkey()), - metadata: None, - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: Some(freeze_authority.pubkey()), + metadata: None, + version: 3, + }, + ), ) .await .unwrap(); @@ -1579,7 +1586,7 @@ async fn test_compress_and_close_mint_idempotent() { rpc.warp_to_slot(SLOTS_PER_EPOCH * 2).unwrap(); // 2. Compress and close Mint (first time - should succeed) - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -1609,9 +1616,9 @@ async fn test_compress_and_close_mint_idempotent() { use solana_sdk::compute_budget::ComputeBudgetInstruction; let mint_action_ix = - light_token_client::instructions::mint_action::create_mint_action_instruction( + light_test_utils::actions::legacy::instructions::mint_action::create_mint_action_instruction( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: mint_authority.pubkey(), @@ -1738,7 +1745,7 @@ async fn test_decompress_existing_mint_to_mint() { ); // === STEP 3: Decompress existing mint to Mint === - let signature = light_token_client::actions::mint_action_comprehensive( + let signature = light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, diff --git a/program-tests/compressed-token-test/tests/mint/mint_to.rs b/program-tests/compressed-token-test/tests/mint/mint_to.rs index cbf6561574..fcc2803d0d 100644 --- a/program-tests/compressed-token-test/tests/mint/mint_to.rs +++ b/program-tests/compressed-token-test/tests/mint/mint_to.rs @@ -1,8 +1,10 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::find_mint_address; use light_program_test::{LightProgramTest, ProgramTestConfig}; -use light_test_utils::{assert_ctoken_mint_to::assert_ctoken_mint_to, Rpc}; +use light_test_utils::{ + actions::legacy::instructions::mint_action::DecompressMintParams, + assert_ctoken_mint_to::assert_ctoken_mint_to, Rpc, +}; use light_token::instruction::{derive_token_ata, CreateAssociatedTokenAccount, MintTo}; -use light_token_client::instructions::mint_action::DecompressMintParams; use serial_test::serial; use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; @@ -48,7 +50,7 @@ async fn setup_mint_to_test() -> MintToTestContext { .unwrap(); // Step 2: Create compressed mint + Mint (no recipients - we'll mint via MintTo) - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -59,14 +61,16 @@ async fn setup_mint_to_test() -> MintToTestContext { vec![], // No ctoken recipients - we'll mint separately None, // No mint authority update None, // No freeze authority update - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 8, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 8, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, + }, + ), ) .await .unwrap(); diff --git a/program-tests/compressed-token-test/tests/mint/random.rs b/program-tests/compressed-token-test/tests/mint/random.rs index 081c607d0f..0b20f280db 100644 --- a/program-tests/compressed-token-test/tests/mint/random.rs +++ b/program-tests/compressed-token-test/tests/mint/random.rs @@ -6,13 +6,15 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::{ }; use light_program_test::{LightProgramTest, ProgramTestConfig}; use light_test_utils::{ - assert_mint_action::assert_mint_action, mint_assert::assert_compressed_mint_account, Rpc, + actions::{ + create_mint, + legacy::instructions::mint_action::{MintActionType, MintToRecipient}, + }, + assert_mint_action::assert_mint_action, + mint_assert::assert_compressed_mint_account, + Rpc, }; use light_token::instruction::CreateAssociatedTokenAccount; -use light_token_client::{ - actions::create_mint, - instructions::mint_action::{MintActionType, MintToRecipient}, -}; use light_token_interface::state::{extensions::AdditionalMetadata, Mint}; use serial_test::serial; use solana_sdk::{signature::Keypair, signer::Signer}; @@ -346,9 +348,9 @@ async fn test_random_mint_action() { .unwrap(); println!("actions {:?}", actions); // Execute all actions in a single instruction - let result = light_token_client::actions::mint_action( + let result = light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: authority.pubkey(), diff --git a/program-tests/compressed-token-test/tests/transfer2/compress_failing.rs b/program-tests/compressed-token-test/tests/transfer2/compress_failing.rs index 9e2d63fef5..e6229ffb35 100644 --- a/program-tests/compressed-token-test/tests/transfer2/compress_failing.rs +++ b/program-tests/compressed-token-test/tests/transfer2/compress_failing.rs @@ -117,7 +117,7 @@ async fn setup_compression_test(token_amount: u64) -> Result Result Result<(), RpcError> { let token_amount = 1000u64; let decompressed_recipients = vec![Recipient::new(owner.pubkey(), token_amount)]; - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -639,14 +641,16 @@ async fn test_compression_max_top_up_exceeded() -> Result<(), RpcError> { decompressed_recipients, // mint to decompressed Light Token ATA None, None, - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 6, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, // ShaFlat for compressible accounts - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 6, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, // ShaFlat for compressible accounts + }, + ), ) .await?; diff --git a/program-tests/compressed-token-test/tests/transfer2/decompress_failing.rs b/program-tests/compressed-token-test/tests/transfer2/decompress_failing.rs index d8d7ca4806..3000b84066 100644 --- a/program-tests/compressed-token-test/tests/transfer2/decompress_failing.rs +++ b/program-tests/compressed-token-test/tests/transfer2/decompress_failing.rs @@ -118,7 +118,7 @@ async fn setup_decompression_test( let compressed_recipients = vec![Recipient::new(owner.pubkey(), compressed_amount)]; let decompressed_recipients = vec![Recipient::new(owner.pubkey(), 0)]; - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -129,14 +129,16 @@ async fn setup_decompression_test( decompressed_recipients, // mint 1 token to decompressed Light Token ATA None, // no mint authority update None, // no freeze authority update - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 6, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, // ShaFlat for mint hashing - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 6, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, // ShaFlat for mint hashing + }, + ), ) .await?; diff --git a/program-tests/compressed-token-test/tests/transfer2/no_system_program_cpi_failing.rs b/program-tests/compressed-token-test/tests/transfer2/no_system_program_cpi_failing.rs index 2cd32161b9..b5f940f58d 100644 --- a/program-tests/compressed-token-test/tests/transfer2/no_system_program_cpi_failing.rs +++ b/program-tests/compressed-token-test/tests/transfer2/no_system_program_cpi_failing.rs @@ -130,7 +130,7 @@ async fn setup_no_system_program_cpi_test( vec![] }; - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut rpc, &mint_seed, &mint_authority, @@ -141,14 +141,16 @@ async fn setup_no_system_program_cpi_test( decompressed_recipients, // mint to source Light Token ATA (empty if token_amount is 0) None, None, - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 6, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, // ShaFlat - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 6, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, // ShaFlat + }, + ), ) .await .unwrap(); @@ -738,7 +740,7 @@ async fn test_too_many_mints() { // Create mint and mint tokens to source Light Token ATA let decompressed_recipients = vec![Recipient::new(context.owner.pubkey(), 1000)]; - light_token_client::actions::mint_action_comprehensive( + light_test_utils::actions::mint_action_comprehensive( &mut context.rpc, &mint_seed, &mint_authority, @@ -749,14 +751,16 @@ async fn test_too_many_mints() { decompressed_recipients, // mint to source Light Token ATA None, None, - Some(light_token_client::instructions::mint_action::NewMint { - decimals: 6, - supply: 0, - mint_authority: mint_authority.pubkey(), - freeze_authority: None, - metadata: None, - version: 3, // ShaFlat - }), + Some( + light_test_utils::actions::legacy::instructions::mint_action::NewMint { + decimals: 6, + supply: 0, + mint_authority: mint_authority.pubkey(), + freeze_authority: None, + metadata: None, + version: 3, // ShaFlat + }, + ), ) .await .unwrap(); diff --git a/program-tests/compressed-token-test/tests/transfer2/shared.rs b/program-tests/compressed-token-test/tests/transfer2/shared.rs index ced4e55898..69237ef81d 100644 --- a/program-tests/compressed-token-test/tests/transfer2/shared.rs +++ b/program-tests/compressed-token-test/tests/transfer2/shared.rs @@ -7,6 +7,17 @@ use light_compressed_token_sdk::compressed_token::create_compressed_mint::{ }; use light_program_test::{indexer::TestIndexerExtensions, LightProgramTest, ProgramTestConfig}; use light_test_utils::{ + actions::{ + create_mint, + legacy::instructions::{ + mint_action::MintActionType, + transfer2::{ + create_generic_transfer2_instruction, ApproveInput, CompressAndCloseInput, + CompressInput, DecompressInput, Transfer2InstructionType, TransferInput, + }, + }, + mint_to_compressed, + }, airdrop_lamports, assert_transfer2::assert_transfer2, spl::{ @@ -15,16 +26,6 @@ use light_test_utils::{ }, }; use light_token::instruction::{CompressibleParams, CreateAssociatedTokenAccount}; -use light_token_client::{ - actions::{create_mint, mint_to_compressed}, - instructions::{ - mint_action::MintActionType, - transfer2::{ - create_generic_transfer2_instruction, ApproveInput, CompressAndCloseInput, - CompressInput, DecompressInput, Transfer2InstructionType, TransferInput, - }, - }, -}; use light_token_interface::{ instructions::{mint_action::Recipient, transfer2::CompressedTokenInstructionDataTransfer2}, state::TokenDataVersion, @@ -496,9 +497,9 @@ impl TestContext { let compressed_mint_address = derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree_pubkey); - light_token_client::actions::mint_action( + light_test_utils::actions::mint_action( &mut rpc, - light_token_client::instructions::mint_action::MintActionParams { + light_test_utils::actions::legacy::instructions::mint_action::MintActionParams { compressed_mint_address, mint_seed: mint_seed.pubkey(), authority: mint_authority.pubkey(), diff --git a/program-tests/compressed-token-test/tests/transfer2/spl_ctoken.rs b/program-tests/compressed-token-test/tests/transfer2/spl_ctoken.rs index 3cb1cf1e03..d55087e5e8 100644 --- a/program-tests/compressed-token-test/tests/transfer2/spl_ctoken.rs +++ b/program-tests/compressed-token-test/tests/transfer2/spl_ctoken.rs @@ -14,6 +14,7 @@ use light_compressed_token_sdk::{ use light_program_test::utils::assert::assert_rpc_error; pub use light_program_test::{LightProgramTest, ProgramTestConfig}; pub use light_test_utils::{ + actions::transfer2::{self}, airdrop_lamports, spl::{ create_mint_helper, create_token_2022_account, mint_spl_tokens, CREATE_MINT_HELPER_DECIMALS, @@ -24,7 +25,6 @@ pub use light_token::instruction::{ derive_token_ata, CompressibleParams, CreateAssociatedTokenAccount, }; use light_token::ValidityProof; -pub use light_token_client::actions::transfer2::{self}; use light_token_interface::instructions::transfer2::{Compression, MultiTokenTransferOutputData}; use solana_sdk::pubkey::Pubkey; pub use solana_sdk::{instruction::Instruction, signature::Keypair, signer::Signer}; diff --git a/program-tests/compressed-token-test/tests/transfer2/transfer_failing.rs b/program-tests/compressed-token-test/tests/transfer2/transfer_failing.rs index 7abbd48302..a503a6c0f0 100644 --- a/program-tests/compressed-token-test/tests/transfer2/transfer_failing.rs +++ b/program-tests/compressed-token-test/tests/transfer2/transfer_failing.rs @@ -16,9 +16,11 @@ use light_program_test::{ utils::assert::assert_rpc_error, LightProgramTest, ProgramTestConfig, Rpc, }; use light_sdk::instruction::PackedAccounts; -use light_test_utils::{airdrop_lamports, RpcError}; +use light_test_utils::{ + actions::{create_mint, mint_to_compressed, transfer2::approve}, + airdrop_lamports, RpcError, +}; use light_token::ValidityProof; -use light_token_client::actions::{create_mint, mint_to_compressed, transfer2::approve}; use light_token_interface::{ instructions::{mint_action::Recipient, transfer2::MultiInputTokenDataWithContext}, state::TokenDataVersion, diff --git a/program-tests/registry-test/tests/compressible.rs b/program-tests/registry-test/tests/compressible.rs index 6326b4f084..633dc1831e 100644 --- a/program-tests/registry-test/tests/compressible.rs +++ b/program-tests/registry-test/tests/compressible.rs @@ -26,18 +26,19 @@ use light_registry::accounts::{ WithdrawFundingPool as WithdrawFundingPoolAccounts, }; use light_test_utils::{ - airdrop_lamports, assert_claim::assert_claim, spl::create_mint_helper, Rpc, RpcError, + actions::{ + create_compressible_token_account, + legacy::instructions::mint_action::{DecompressMintParams, NewMint}, + mint_action_comprehensive, transfer, CreateCompressibleTokenAccountInputs, + }, + airdrop_lamports, + assert_claim::assert_claim, + spl::create_mint_helper, + Rpc, RpcError, }; use light_token::instruction::{ derive_token_ata, CompressibleParams, CreateAssociatedTokenAccount, MintTo, }; -use light_token_client::{ - actions::{ - create_compressible_token_account, mint_action_comprehensive, transfer, - CreateCompressibleTokenAccountInputs, - }, - instructions::mint_action::{DecompressMintParams, NewMint}, -}; use solana_sdk::{ instruction::Instruction, pubkey::Pubkey, diff --git a/program-tests/utils/Cargo.toml b/program-tests/utils/Cargo.toml index 21b57c5f15..7b32fa5a0d 100644 --- a/program-tests/utils/Cargo.toml +++ b/program-tests/utils/Cargo.toml @@ -55,3 +55,11 @@ light-token = { workspace = true } light-compressed-token-sdk = { workspace = true } light-token-client = { workspace = true } light-compressible = { workspace = true } +light-token-types = { workspace = true } +solana-pubkey = { workspace = true } +solana-keypair = { workspace = true } +solana-signer = { workspace = true } +solana-signature = { workspace = true } +solana-instruction = { workspace = true } +solana-msg = { workspace = true } +borsh = { workspace = true } diff --git a/sdk-libs/token-client/src/actions/create_compressible_token_account.rs b/program-tests/utils/src/actions/legacy/create_compressible_token_account.rs similarity index 100% rename from sdk-libs/token-client/src/actions/create_compressible_token_account.rs rename to program-tests/utils/src/actions/legacy/create_compressible_token_account.rs diff --git a/program-tests/utils/src/actions/legacy/create_mint.rs b/program-tests/utils/src/actions/legacy/create_mint.rs new file mode 100644 index 0000000000..88e493755f --- /dev/null +++ b/program-tests/utils/src/actions/legacy/create_mint.rs @@ -0,0 +1,61 @@ +use light_client::{ + indexer::Indexer, + rpc::{Rpc, RpcError}, +}; +use light_token_interface::instructions::extensions::TokenMetadataInstructionData; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +use super::instructions::create_mint::create_compressed_mint_instruction; + +/// Create a compressed mint and send the transaction. +/// +/// # Arguments +/// * `rpc` - RPC client with indexer capabilities +/// * `mint_seed` - Keypair used to derive the mint PDA (must sign the transaction) +/// * `decimals` - Number of decimal places for the token +/// * `mint_authority_keypair` - Authority keypair that can mint tokens (must sign the transaction) +/// * `freeze_authority` - Optional authority that can freeze tokens +/// * `payer` - Transaction fee payer keypair +/// * `metadata` - Optional metadata for the token +/// +/// # Returns +/// `Result` - The transaction signature +pub async fn create_mint( + rpc: &mut R, + mint_seed: &Keypair, + decimals: u8, + mint_authority_keypair: &Keypair, + freeze_authority: Option, + metadata: Option, + payer: &Keypair, +) -> Result { + // Create the instruction + let ix = create_compressed_mint_instruction( + rpc, + mint_seed, + decimals, + mint_authority_keypair.pubkey(), + freeze_authority, + payer.pubkey(), + metadata, + ) + .await?; + + // Determine signers (deduplicate if any keypairs are the same) + let mut signers = vec![payer]; + if mint_seed.pubkey() != payer.pubkey() { + signers.push(mint_seed); + } + if mint_authority_keypair.pubkey() != payer.pubkey() + && mint_authority_keypair.pubkey() != mint_seed.pubkey() + { + signers.push(mint_authority_keypair); + } + + // Send the transaction + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await +} diff --git a/sdk-libs/token-client/src/instructions/create_mint.rs b/program-tests/utils/src/actions/legacy/instructions/create_mint.rs similarity index 95% rename from sdk-libs/token-client/src/instructions/create_mint.rs rename to program-tests/utils/src/actions/legacy/instructions/create_mint.rs index ebdc8e0bfc..c166c4aa2d 100644 --- a/sdk-libs/token-client/src/instructions/create_mint.rs +++ b/program-tests/utils/src/actions/legacy/instructions/create_mint.rs @@ -8,7 +8,7 @@ use solana_keypair::Keypair; use solana_pubkey::Pubkey; use solana_signer::Signer; -use crate::instructions::mint_action::{create_mint_action_instruction, MintActionParams, NewMint}; +use super::mint_action::{create_mint_action_instruction, MintActionParams, NewMint}; /// Create a compressed-only mint instruction (no decompression). /// diff --git a/sdk-libs/token-client/src/instructions/mint_action.rs b/program-tests/utils/src/actions/legacy/instructions/mint_action.rs similarity index 100% rename from sdk-libs/token-client/src/instructions/mint_action.rs rename to program-tests/utils/src/actions/legacy/instructions/mint_action.rs diff --git a/sdk-libs/token-client/src/instructions/mint_to_compressed.rs b/program-tests/utils/src/actions/legacy/instructions/mint_to_compressed.rs similarity index 100% rename from sdk-libs/token-client/src/instructions/mint_to_compressed.rs rename to program-tests/utils/src/actions/legacy/instructions/mint_to_compressed.rs diff --git a/sdk-libs/token-client/src/instructions/mod.rs b/program-tests/utils/src/actions/legacy/instructions/mod.rs similarity index 100% rename from sdk-libs/token-client/src/instructions/mod.rs rename to program-tests/utils/src/actions/legacy/instructions/mod.rs diff --git a/sdk-libs/token-client/src/instructions/transfer2.rs b/program-tests/utils/src/actions/legacy/instructions/transfer2.rs similarity index 100% rename from sdk-libs/token-client/src/instructions/transfer2.rs rename to program-tests/utils/src/actions/legacy/instructions/transfer2.rs diff --git a/sdk-libs/token-client/src/instructions/update_compressed_mint.rs b/program-tests/utils/src/actions/legacy/instructions/update_compressed_mint.rs similarity index 100% rename from sdk-libs/token-client/src/instructions/update_compressed_mint.rs rename to program-tests/utils/src/actions/legacy/instructions/update_compressed_mint.rs diff --git a/sdk-libs/token-client/src/actions/mint_action.rs b/program-tests/utils/src/actions/legacy/mint_action.rs similarity index 98% rename from sdk-libs/token-client/src/actions/mint_action.rs rename to program-tests/utils/src/actions/legacy/mint_action.rs index aa1420e58f..d16ba10a3b 100644 --- a/sdk-libs/token-client/src/actions/mint_action.rs +++ b/program-tests/utils/src/actions/legacy/mint_action.rs @@ -11,7 +11,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::mint_action::{ +use super::instructions::mint_action::{ create_mint_action_instruction, DecompressMintParams, MintActionParams, MintActionType, MintToRecipient, }; @@ -79,7 +79,7 @@ pub async fn mint_action_comprehensive( update_mint_authority: Option, update_freeze_authority: Option, // Parameters for mint creation (required when creating a new mint) - new_mint: Option, + new_mint: Option, ) -> Result { // Derive addresses let address_tree_pubkey = rpc.get_address_tree_v2().tree; diff --git a/sdk-libs/token-client/src/actions/mint_to_compressed.rs b/program-tests/utils/src/actions/legacy/mint_to_compressed.rs similarity index 96% rename from sdk-libs/token-client/src/actions/mint_to_compressed.rs rename to program-tests/utils/src/actions/legacy/mint_to_compressed.rs index b4533ae4bf..0a6d7f030b 100644 --- a/sdk-libs/token-client/src/actions/mint_to_compressed.rs +++ b/program-tests/utils/src/actions/legacy/mint_to_compressed.rs @@ -8,7 +8,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::mint_to_compressed::mint_to_compressed_instruction; +use super::instructions::mint_to_compressed::mint_to_compressed_instruction; /// Mints compressed tokens to recipients using a higher-level action /// diff --git a/program-tests/utils/src/actions/legacy/mod.rs b/program-tests/utils/src/actions/legacy/mod.rs new file mode 100644 index 0000000000..5396521fdf --- /dev/null +++ b/program-tests/utils/src/actions/legacy/mod.rs @@ -0,0 +1,18 @@ +pub mod instructions; + +mod create_compressible_token_account; +mod create_mint; +mod mint_action; +mod mint_to_compressed; +mod spl_interface; +mod transfer; +pub mod transfer2; +mod update_compressed_mint; + +pub use create_compressible_token_account::*; +pub use create_mint::*; +pub use mint_action::*; +pub use mint_to_compressed::*; +pub use spl_interface::*; +pub use transfer::*; +pub use update_compressed_mint::*; diff --git a/sdk-libs/token-client/src/actions/spl_interface.rs b/program-tests/utils/src/actions/legacy/spl_interface.rs similarity index 100% rename from sdk-libs/token-client/src/actions/spl_interface.rs rename to program-tests/utils/src/actions/legacy/spl_interface.rs diff --git a/program-tests/utils/src/actions/legacy/transfer.rs b/program-tests/utils/src/actions/legacy/transfer.rs new file mode 100644 index 0000000000..2d32024fb0 --- /dev/null +++ b/program-tests/utils/src/actions/legacy/transfer.rs @@ -0,0 +1,78 @@ +use light_client::rpc::{Rpc, RpcError}; +use solana_instruction::{AccountMeta, Instruction}; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +const SYSTEM_PROGRAM_ID: [u8; 32] = [0u8; 32]; + +/// Transfer from one token account to another. +/// +/// # Arguments +/// * `rpc` - RPC client +/// * `source` - Source token account (decompressed compressed token account) +/// * `destination` - Destination token account +/// * `amount` - Amount of tokens to transfer +/// * `authority` - Authority that can spend from the source token account +/// * `payer` - Transaction fee payer keypair +/// +/// # Returns +/// `Result` - The transaction signature +pub async fn transfer( + rpc: &mut R, + source: Pubkey, + destination: Pubkey, + amount: u64, + authority: &Keypair, + payer: &Keypair, +) -> Result { + let transfer_instruction = + create_transfer_token_instruction(source, destination, amount, authority.pubkey())?; + + let mut signers = vec![payer]; + if authority.pubkey() != payer.pubkey() { + signers.push(authority); + } + + rpc.create_and_send_transaction(&[transfer_instruction], &payer.pubkey(), &signers) + .await +} + +// TODO: consume the variant from compressed-token-sdk instead +/// Create a token transfer instruction. +/// +/// # Arguments +/// * `source` - Source token account +/// * `destination` - Destination token account +/// * `amount` - Amount to transfer +/// * `authority` - Authority pubkey +/// +/// # Returns +/// `Result` +#[allow(clippy::result_large_err)] +pub fn create_transfer_token_instruction( + source: Pubkey, + destination: Pubkey, + amount: u64, + authority: Pubkey, +) -> Result { + let transfer_instruction = Instruction { + program_id: Pubkey::from(light_token_interface::LIGHT_TOKEN_PROGRAM_ID), + accounts: vec![ + AccountMeta::new(source, false), // Source token account + AccountMeta::new(destination, false), // Destination token account + AccountMeta::new(authority, true), // Authority must be writable for potential top-ups + AccountMeta::new_readonly(Pubkey::from(SYSTEM_PROGRAM_ID), false), // System program for rent top-ups + ], + data: { + // CTokenTransfer discriminator + let mut data = vec![3u8]; + // Add SPL Token Transfer instruction data exactly like SPL does + data.extend_from_slice(&amount.to_le_bytes()); // Amount as u64 little-endian + data + }, + }; + + Ok(transfer_instruction) +} diff --git a/sdk-libs/token-client/src/actions/transfer2/approve.rs b/program-tests/utils/src/actions/legacy/transfer2/approve.rs similarity index 97% rename from sdk-libs/token-client/src/actions/transfer2/approve.rs rename to program-tests/utils/src/actions/legacy/transfer2/approve.rs index 32d231df55..f4de5e3645 100644 --- a/sdk-libs/token-client/src/actions/transfer2/approve.rs +++ b/program-tests/utils/src/actions/legacy/transfer2/approve.rs @@ -7,7 +7,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::transfer2::{ +use super::super::instructions::transfer2::{ create_generic_transfer2_instruction, ApproveInput, Transfer2InstructionType, }; diff --git a/sdk-libs/token-client/src/actions/transfer2/compress.rs b/program-tests/utils/src/actions/legacy/transfer2/compress.rs similarity index 99% rename from sdk-libs/token-client/src/actions/transfer2/compress.rs rename to program-tests/utils/src/actions/legacy/transfer2/compress.rs index 745a9873c0..aed0d7de51 100644 --- a/sdk-libs/token-client/src/actions/transfer2/compress.rs +++ b/program-tests/utils/src/actions/legacy/transfer2/compress.rs @@ -10,7 +10,7 @@ use solana_signer::Signer; use spl_pod::bytemuck::pod_from_bytes; use spl_token_2022::pod::PodAccount; -use crate::instructions::transfer2::{ +use super::super::instructions::transfer2::{ create_generic_transfer2_instruction, CompressInput, Transfer2InstructionType, }; diff --git a/sdk-libs/token-client/src/actions/transfer2/compress_and_close.rs b/program-tests/utils/src/actions/legacy/transfer2/compress_and_close.rs similarity index 97% rename from sdk-libs/token-client/src/actions/transfer2/compress_and_close.rs rename to program-tests/utils/src/actions/legacy/transfer2/compress_and_close.rs index 096919411b..6dfc016485 100644 --- a/sdk-libs/token-client/src/actions/transfer2/compress_and_close.rs +++ b/program-tests/utils/src/actions/legacy/transfer2/compress_and_close.rs @@ -7,7 +7,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::transfer2::{ +use super::super::instructions::transfer2::{ create_generic_transfer2_instruction, CompressAndCloseInput, Transfer2InstructionType, }; diff --git a/sdk-libs/token-client/src/actions/transfer2/ctoken_to_spl.rs b/program-tests/utils/src/actions/legacy/transfer2/ctoken_to_spl.rs similarity index 100% rename from sdk-libs/token-client/src/actions/transfer2/ctoken_to_spl.rs rename to program-tests/utils/src/actions/legacy/transfer2/ctoken_to_spl.rs diff --git a/sdk-libs/token-client/src/actions/transfer2/decompress.rs b/program-tests/utils/src/actions/legacy/transfer2/decompress.rs similarity index 97% rename from sdk-libs/token-client/src/actions/transfer2/decompress.rs rename to program-tests/utils/src/actions/legacy/transfer2/decompress.rs index daf2503f8a..55bba47b5e 100644 --- a/sdk-libs/token-client/src/actions/transfer2/decompress.rs +++ b/program-tests/utils/src/actions/legacy/transfer2/decompress.rs @@ -7,7 +7,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::transfer2::{ +use super::super::instructions::transfer2::{ create_generic_transfer2_instruction, DecompressInput, Transfer2InstructionType, }; diff --git a/sdk-libs/token-client/src/actions/transfer2/mod.rs b/program-tests/utils/src/actions/legacy/transfer2/mod.rs similarity index 100% rename from sdk-libs/token-client/src/actions/transfer2/mod.rs rename to program-tests/utils/src/actions/legacy/transfer2/mod.rs diff --git a/sdk-libs/token-client/src/actions/transfer2/spl_to_ctoken.rs b/program-tests/utils/src/actions/legacy/transfer2/spl_to_ctoken.rs similarity index 100% rename from sdk-libs/token-client/src/actions/transfer2/spl_to_ctoken.rs rename to program-tests/utils/src/actions/legacy/transfer2/spl_to_ctoken.rs diff --git a/sdk-libs/token-client/src/actions/transfer2/transfer.rs b/program-tests/utils/src/actions/legacy/transfer2/transfer.rs similarity index 97% rename from sdk-libs/token-client/src/actions/transfer2/transfer.rs rename to program-tests/utils/src/actions/legacy/transfer2/transfer.rs index a39ab8dd2a..03d73d4144 100644 --- a/sdk-libs/token-client/src/actions/transfer2/transfer.rs +++ b/program-tests/utils/src/actions/legacy/transfer2/transfer.rs @@ -7,7 +7,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::transfer2::{ +use super::super::instructions::transfer2::{ create_generic_transfer2_instruction, Transfer2InstructionType, TransferInput, }; diff --git a/sdk-libs/token-client/src/actions/transfer2/transfer_delegated.rs b/program-tests/utils/src/actions/legacy/transfer2/transfer_delegated.rs similarity index 98% rename from sdk-libs/token-client/src/actions/transfer2/transfer_delegated.rs rename to program-tests/utils/src/actions/legacy/transfer2/transfer_delegated.rs index 5d3e264606..eb4a639f8a 100644 --- a/sdk-libs/token-client/src/actions/transfer2/transfer_delegated.rs +++ b/program-tests/utils/src/actions/legacy/transfer2/transfer_delegated.rs @@ -7,7 +7,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::transfer2::{ +use super::super::instructions::transfer2::{ create_generic_transfer2_instruction, Transfer2InstructionType, TransferInput, }; diff --git a/sdk-libs/token-client/src/actions/update_compressed_mint.rs b/program-tests/utils/src/actions/legacy/update_compressed_mint.rs similarity index 98% rename from sdk-libs/token-client/src/actions/update_compressed_mint.rs rename to program-tests/utils/src/actions/legacy/update_compressed_mint.rs index 48afb42748..2e394653cc 100644 --- a/sdk-libs/token-client/src/actions/update_compressed_mint.rs +++ b/program-tests/utils/src/actions/legacy/update_compressed_mint.rs @@ -8,7 +8,7 @@ use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::update_compressed_mint::update_compressed_mint_instruction; +use super::instructions::update_compressed_mint::update_compressed_mint_instruction; /// Update compressed mint authority action /// diff --git a/program-tests/utils/src/actions/mod.rs b/program-tests/utils/src/actions/mod.rs new file mode 100644 index 0000000000..579abafadd --- /dev/null +++ b/program-tests/utils/src/actions/mod.rs @@ -0,0 +1,6 @@ +/// Legacy actions module - contains actions moved from light-token-client +/// for backwards compatibility during the refactoring process. +pub mod legacy; + +// Re-export legacy module contents for backward compatibility +pub use legacy::*; diff --git a/program-tests/utils/src/assert_mint_action.rs b/program-tests/utils/src/assert_mint_action.rs index 680063e28e..bc1b66b715 100644 --- a/program-tests/utils/src/assert_mint_action.rs +++ b/program-tests/utils/src/assert_mint_action.rs @@ -5,10 +5,11 @@ use light_client::indexer::Indexer; use light_compressed_account::compressed_account::CompressedAccountData; use light_compressible::compression_info::CompressionInfo; use light_program_test::{LightProgramTest, Rpc}; -use light_token_client::instructions::mint_action::MintActionType; use light_token_interface::state::{extensions::AdditionalMetadata, ExtensionStruct, Mint, Token}; use solana_sdk::pubkey::Pubkey; +use crate::actions::legacy::instructions::mint_action::MintActionType; + /// Extract CompressionInfo from Light Token's Compressible extension fn get_ctoken_compression_info(ctoken: &Token) -> Option { ctoken diff --git a/program-tests/utils/src/assert_transfer2.rs b/program-tests/utils/src/assert_transfer2.rs index 907e35673f..76c8a8073a 100644 --- a/program-tests/utils/src/assert_transfer2.rs +++ b/program-tests/utils/src/assert_transfer2.rs @@ -3,13 +3,13 @@ use std::collections::HashMap; use anchor_spl::token_2022::spl_token_2022; use light_client::{indexer::Indexer, rpc::Rpc}; use light_program_test::LightProgramTest; -use light_token_client::instructions::transfer2::{ - CompressInput, DecompressInput, Transfer2InstructionType, TransferInput, -}; use light_token_interface::LIGHT_TOKEN_PROGRAM_ID; use solana_sdk::{program_pack::Pack, pubkey::Pubkey}; use crate::{ + actions::legacy::instructions::transfer2::{ + CompressInput, DecompressInput, Transfer2InstructionType, TransferInput, + }, assert_close_token_account::assert_close_token_account, assert_ctoken_transfer::assert_compressible_for_account, }; @@ -606,7 +606,7 @@ pub async fn assert_transfer2_compress(rpc: &mut LightProgramTest, compress_inpu /// Automatically retrieves pre-state from the cached context pub async fn assert_transfer2_compress_and_close( rpc: &mut LightProgramTest, - compress_and_close_input: light_token_client::instructions::transfer2::CompressAndCloseInput, + compress_and_close_input: crate::actions::legacy::instructions::transfer2::CompressAndCloseInput, ) { // Get the destination account let destination_pubkey = compress_and_close_input diff --git a/program-tests/utils/src/lib.rs b/program-tests/utils/src/lib.rs index 1eeaf67a37..9af83e2d03 100644 --- a/program-tests/utils/src/lib.rs +++ b/program-tests/utils/src/lib.rs @@ -16,6 +16,7 @@ use solana_sdk::{ signature::{Keypair, Signature, Signer}, transaction, }; +pub mod actions; pub mod address; pub mod address_tree_rollover; pub mod assert_claim; diff --git a/sdk-libs/token-client/src/actions/approve.rs b/sdk-libs/token-client/src/actions/approve.rs new file mode 100644 index 0000000000..875b19632d --- /dev/null +++ b/sdk-libs/token-client/src/actions/approve.rs @@ -0,0 +1,122 @@ +//! Approve delegation action for Light Token. +//! +//! Simple interface for approving a delegate on a Light Token account. + +use light_client::rpc::{Rpc, RpcError}; +use light_token::instruction::Approve as ApproveInstruction; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for approving a delegate for a Light Token account. +/// +/// If `owner` is `Some`, the owner keypair will be used as the signer. +/// If `owner` is `None`, the payer will be used as the owner. +/// +/// # Example +/// ```ignore +/// // Payer is the owner +/// Approve { +/// token_account, +/// delegate, +/// amount: 1000, +/// owner: None, +/// }.execute(&mut rpc, &payer).await?; +/// +/// // Separate owner +/// Approve { +/// token_account, +/// delegate, +/// amount: 1000, +/// owner: Some(owner_pubkey), +/// }.execute_with_owner(&mut rpc, &payer, &owner_keypair).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct Approve { + /// The token account to approve delegation for. + pub token_account: Pubkey, + /// The delegate public key. + pub delegate: Pubkey, + /// Amount of tokens to delegate. + pub amount: u64, + /// Optional owner public key (for separate owner scenario). + /// If None, the payer is used as the owner. + pub owner: Option, +} + +impl Approve { + /// Execute the approve action via RPC where payer is the owner. + /// + /// This method only supports cases where `owner == payer`. If you need a + /// separate owner and payer, use [`execute_with_owner`](Self::execute_with_owner). + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair (must also be the owner) + /// + /// # Returns + /// `Result` - The transaction signature + /// + /// # Errors + /// Returns an error if `self.owner` is `Some` and does not equal `payer.pubkey()`. + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + ) -> Result { + let owner_pubkey = self.owner.unwrap_or_else(|| payer.pubkey()); + + if owner_pubkey != payer.pubkey() { + return Err(RpcError::CustomError( + "owner does not match payer; use execute_with_owner for separate owner/payer" + .to_string(), + )); + } + + let ix = ApproveInstruction { + token_account: self.token_account, + delegate: self.delegate, + owner: owner_pubkey, + amount: self.amount, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[payer]) + .await + } + + /// Execute the approve action via RPC with a separate owner. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair + /// * `owner` - The owner of the token account (signer) + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute_with_owner( + self, + rpc: &mut R, + payer: &Keypair, + owner: &Keypair, + ) -> Result { + let ix = ApproveInstruction { + token_account: self.token_account, + delegate: self.delegate, + owner: owner.pubkey(), + amount: self.amount, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let mut signers: Vec<&Keypair> = vec![payer]; + if owner.pubkey() != payer.pubkey() { + signers.push(owner); + } + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } +} diff --git a/sdk-libs/token-client/src/actions/create_ata.rs b/sdk-libs/token-client/src/actions/create_ata.rs new file mode 100644 index 0000000000..8d5838cf10 --- /dev/null +++ b/sdk-libs/token-client/src/actions/create_ata.rs @@ -0,0 +1,99 @@ +//! Create Associated Token Account actions for Light Token. +//! +//! These actions provide clean interfaces for creating Light Token ATAs. + +use light_client::rpc::{Rpc, RpcError}; +use light_token::instruction::{ + derive_associated_token_account, get_associated_token_address, CreateAssociatedTokenAccount, +}; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for creating an associated token account for a Light Token mint. +/// +/// # Example +/// ```ignore +/// // Non-idempotent (fails if ATA exists) +/// CreateAta { +/// mint, +/// owner, +/// idempotent: false, +/// }.execute(&mut rpc, &payer).await?; +/// +/// // Idempotent (no-op if ATA exists) +/// CreateAta { +/// mint, +/// owner, +/// idempotent: true, +/// }.execute(&mut rpc, &payer).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct CreateAta { + /// The mint public key. + pub mint: Pubkey, + /// The owner of the ATA. + pub owner: Pubkey, + /// Whether to use idempotent mode (no-op if ATA exists). + pub idempotent: bool, +} + +impl CreateAta { + /// Execute the create_ata action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair + /// + /// # Returns + /// `Result<(Signature, Pubkey), RpcError>` - The transaction signature and ATA public key + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + ) -> Result<(Signature, Pubkey), RpcError> { + let mut instruction_builder = + CreateAssociatedTokenAccount::new(payer.pubkey(), self.owner, self.mint); + + if self.idempotent { + instruction_builder = instruction_builder.idempotent(); + } + + let ix = instruction_builder + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let signature = rpc + .create_and_send_transaction(&[ix], &payer.pubkey(), &[payer]) + .await?; + + Ok((signature, get_ata_address(&self.mint, &self.owner))) + } +} + +/// Get the associated token address for a given owner and mint. +/// +/// This is a pure function that computes the ATA address without any RPC calls. +/// +/// # Arguments +/// * `mint` - The mint public key +/// * `owner` - The owner public key +/// +/// # Returns +/// `Pubkey` - The ATA address +pub fn get_ata_address(mint: &Pubkey, owner: &Pubkey) -> Pubkey { + get_associated_token_address(owner, mint) +} + +/// Derive the associated token address with bump seed. +/// +/// # Arguments +/// * `mint` - The mint public key +/// * `owner` - The owner public key +/// +/// # Returns +/// `(Pubkey, u8)` - The ATA address and bump seed +pub fn derive_ata_address(mint: &Pubkey, owner: &Pubkey) -> (Pubkey, u8) { + derive_associated_token_account(owner, mint) +} diff --git a/sdk-libs/token-client/src/actions/create_mint.rs b/sdk-libs/token-client/src/actions/create_mint.rs index 25940c6013..e71a85d1a4 100644 --- a/sdk-libs/token-client/src/actions/create_mint.rs +++ b/sdk-libs/token-client/src/actions/create_mint.rs @@ -1,61 +1,180 @@ +//! Create mint action for Light Token. +//! +//! This action provides a clean interface for creating a new Light Token mint. + use light_client::{ - indexer::Indexer, + indexer::{AddressWithTree, Indexer}, rpc::{Rpc, RpcError}, }; -use light_token_interface::instructions::extensions::TokenMetadataInstructionData; +use light_token::instruction::{ + derive_mint_compressed_address, find_mint_address, CreateMint as CreateMintInstruction, + CreateMintParams as CreateMintInstructionParams, +}; +use light_token_interface::{ + instructions::extensions::{ExtensionInstructionData, TokenMetadataInstructionData}, + state::AdditionalMetadata, +}; use solana_keypair::Keypair; use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -use crate::instructions::create_mint::create_compressed_mint_instruction; +/// Token metadata for the mint. +#[derive(Clone, Debug, Default)] +pub struct TokenMetadata { + /// The longer name of the token. + pub name: String, + /// The shortened symbol for the token. + pub symbol: String, + /// The URI pointing to richer metadata. + pub uri: String, + /// Authority that can update the metadata. + pub update_authority: Option, + /// Additional metadata as key-value pairs. + pub additional_metadata: Option>, +} -/// Create a compressed mint and send the transaction. +/// Parameters for creating a new Light Token mint. /// -/// # Arguments -/// * `rpc` - RPC client with indexer capabilities -/// * `mint_seed` - Keypair used to derive the mint PDA (must sign the transaction) -/// * `decimals` - Number of decimal places for the token -/// * `mint_authority_keypair` - Authority keypair that can mint tokens (must sign the transaction) -/// * `freeze_authority` - Optional authority that can freeze tokens -/// * `payer` - Transaction fee payer keypair -/// * `metadata` - Optional metadata for the token +/// This creates both a compressed mint AND a decompressed Mint Solana account +/// in a single instruction. /// -/// # Returns -/// `Result` - The transaction signature -pub async fn create_mint( - rpc: &mut R, - mint_seed: &Keypair, - decimals: u8, - mint_authority_keypair: &Keypair, - freeze_authority: Option, - metadata: Option, - payer: &Keypair, -) -> Result { - // Create the instruction - let ix = create_compressed_mint_instruction( - rpc, - mint_seed, - decimals, - mint_authority_keypair.pubkey(), - freeze_authority, - payer.pubkey(), - metadata, - ) - .await?; - - // Determine signers (deduplicate if any keypairs are the same) - let mut signers = vec![payer]; - if mint_seed.pubkey() != payer.pubkey() { - signers.push(mint_seed); - } - if mint_authority_keypair.pubkey() != payer.pubkey() - && mint_authority_keypair.pubkey() != mint_seed.pubkey() - { - signers.push(mint_authority_keypair); - } +/// # Example +/// ```ignore +/// let (signature, mint) = CreateMint { +/// decimals: 9, +/// freeze_authority: Some(freeze_authority_pubkey), +/// token_metadata: Some(TokenMetadata { +/// name: "My Token".to_string(), +/// symbol: "MTK".to_string(), +/// uri: "https://example.com/metadata.json".to_string(), +/// ..Default::default() +/// }), +/// seed: None, // auto-generate, or Some(keypair) for deterministic address +/// }.execute(&mut rpc, &payer, &mint_authority).await?; +/// ``` +#[derive(Default, Debug)] +pub struct CreateMint { + /// Number of decimals for the token. + pub decimals: u8, + /// Optional authority that can freeze token accounts. + pub freeze_authority: Option, + /// Optional token metadata (name, symbol, uri). + pub token_metadata: Option, + /// Optional seed keypair for deterministic mint address. + /// If None, a new keypair is generated. + pub seed: Option, +} + +impl CreateMint { + /// Execute the create_mint action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client that implements both `Rpc` and `Indexer` traits + /// * `payer` - Transaction fee payer keypair + /// * `mint_authority` - Authority that can mint new tokens + /// + /// # Returns + /// `Result<(Signature, Pubkey), RpcError>` - The transaction signature and mint public key + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + mint_authority: &Keypair, + ) -> Result<(Signature, Pubkey), RpcError> { + let mint_seed = self.seed.unwrap_or_else(Keypair::new); + let address_tree = rpc.get_address_tree_v2(); + let output_queue = rpc.get_random_state_tree_info()?.queue; + + // Derive compression address + let compression_address = + derive_mint_compressed_address(&mint_seed.pubkey(), &address_tree.tree); - // Send the transaction - rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) - .await + // Find mint PDA + let (mint, bump) = find_mint_address(&mint_seed.pubkey()); + + // 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 + .map_err(|e| RpcError::CustomError(format!("Failed to get validity proof: {}", e)))? + .value; + + // Build extensions if token metadata is provided + let extensions = self.token_metadata.map(|metadata| { + let additional_metadata = metadata.additional_metadata.map(|items| { + items + .into_iter() + .map(|(key, value)| AdditionalMetadata { + key: key.into_bytes(), + value: value.into_bytes(), + }) + .collect() + }); + + vec![ExtensionInstructionData::TokenMetadata( + TokenMetadataInstructionData { + update_authority: Some( + metadata + .update_authority + .unwrap_or_else(|| mint_authority.pubkey()) + .to_bytes() + .into(), + ), + name: metadata.name.into_bytes(), + symbol: metadata.symbol.into_bytes(), + uri: metadata.uri.into_bytes(), + additional_metadata, + }, + )] + }); + + // Build params + let params = CreateMintInstructionParams { + decimals: self.decimals, + address_merkle_tree_root_index: rpc_result.addresses[0].root_index, + mint_authority: mint_authority.pubkey(), + proof: rpc_result.proof.0.ok_or_else(|| { + RpcError::CustomError("Validity proof is required for create_mint".to_string()) + })?, + compression_address, + mint, + bump, + freeze_authority: self.freeze_authority, + extensions, + rent_payment: 16, // ~24 hours rent + write_top_up: 766, // ~3 hours per write + }; + + // Create instruction + let instruction = CreateMintInstruction::new( + params, + mint_seed.pubkey(), + payer.pubkey(), + address_tree.tree, + output_queue, + ) + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + // Build signers list + let mut signers: Vec<&Keypair> = vec![payer, &mint_seed]; + if mint_authority.pubkey() != payer.pubkey() { + signers.push(mint_authority); + } + + // Send transaction + let signature = rpc + .create_and_send_transaction(&[instruction], &payer.pubkey(), &signers) + .await?; + + Ok((signature, mint)) + } } diff --git a/sdk-libs/token-client/src/actions/mint_to.rs b/sdk-libs/token-client/src/actions/mint_to.rs new file mode 100644 index 0000000000..af7d76403f --- /dev/null +++ b/sdk-libs/token-client/src/actions/mint_to.rs @@ -0,0 +1,75 @@ +//! Mint tokens action for Light Token. +//! +//! Simple interface for minting tokens to a Light Token account. + +use light_client::rpc::{Rpc, RpcError}; +use light_token::instruction::MintTo as MintToInstruction; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for minting tokens to a Light Token account. +/// +/// # Example +/// ```ignore +/// MintTo { +/// mint, +/// destination, +/// amount: 1000, +/// ..Default::default() +/// }.execute(&mut rpc, &payer, &mint_authority).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct MintTo { + /// The mint public key. + pub mint: Pubkey, + /// The destination token account. + pub destination: Pubkey, + /// Amount of tokens to mint. + pub amount: u64, +} + +impl MintTo { + /// Execute the mint_to action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair (also pays for rent top-ups) + /// * `authority` - The mint authority keypair + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + authority: &Keypair, + ) -> Result { + // Only set fee_payer if payer differs from authority + let fee_payer = if payer.pubkey() != authority.pubkey() { + Some(payer.pubkey()) + } else { + None + }; + + let ix = MintToInstruction { + mint: self.mint, + destination: self.destination, + amount: self.amount, + authority: authority.pubkey(), + max_top_up: None, + fee_payer, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let mut signers: Vec<&Keypair> = vec![payer]; + if authority.pubkey() != payer.pubkey() { + signers.push(authority); + } + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } +} diff --git a/sdk-libs/token-client/src/actions/mod.rs b/sdk-libs/token-client/src/actions/mod.rs index 712b0172af..7b902fb8f8 100644 --- a/sdk-libs/token-client/src/actions/mod.rs +++ b/sdk-libs/token-client/src/actions/mod.rs @@ -1,16 +1,36 @@ -mod create_compressible_token_account; -mod create_mint; -mod mint_action; -mod mint_to_compressed; -mod spl_interface; -mod transfer; -pub mod transfer2; -mod update_compressed_mint; +//! Clean action interfaces for Light Token operations. +//! +//! These actions provide simple, ergonomic interfaces for common Light Token operations. +//! +//! All actions use a params struct pattern with an `execute` method: +//! ```ignore +//! Transfer { +//! source, +//! destination, +//! amount: 1000, +//! ..Default::default() +//! }.execute(&mut rpc, &payer, &authority).await?; +//! ``` -pub use create_compressible_token_account::*; -pub use create_mint::*; -pub use mint_action::*; -pub use mint_to_compressed::*; -pub use spl_interface::*; -pub use transfer::*; -pub use update_compressed_mint::*; +pub mod approve; +pub mod create_ata; +pub mod create_mint; +pub mod mint_to; +pub mod revoke; +pub mod transfer; +pub mod transfer_checked; +pub mod transfer_interface; +pub mod unwrap; +pub mod wrap; + +// Re-export all action structs +pub use approve::Approve; +pub use create_ata::{derive_ata_address, get_ata_address, CreateAta}; +pub use create_mint::{CreateMint, TokenMetadata}; +pub use mint_to::MintTo; +pub use revoke::Revoke; +pub use transfer::Transfer; +pub use transfer_checked::TransferChecked; +pub use transfer_interface::TransferInterface; +pub use unwrap::Unwrap; +pub use wrap::Wrap; diff --git a/sdk-libs/token-client/src/actions/revoke.rs b/sdk-libs/token-client/src/actions/revoke.rs new file mode 100644 index 0000000000..803b4516ad --- /dev/null +++ b/sdk-libs/token-client/src/actions/revoke.rs @@ -0,0 +1,110 @@ +//! Revoke delegation action for Light Token. +//! +//! Simple interface for revoking a delegate on a Light Token account. + +use light_client::rpc::{Rpc, RpcError}; +use light_token::instruction::Revoke as RevokeInstruction; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for revoking delegation for a Light Token account. +/// +/// If `owner` is `Some`, the owner keypair will be used as the signer. +/// If `owner` is `None`, the payer will be used as the owner. +/// +/// # Example +/// ```ignore +/// // Payer is the owner +/// Revoke { +/// token_account, +/// owner: None, +/// }.execute(&mut rpc, &payer).await?; +/// +/// // Separate owner +/// Revoke { +/// token_account, +/// owner: Some(owner_pubkey), +/// }.execute_with_owner(&mut rpc, &payer, &owner_keypair).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct Revoke { + /// The token account to revoke delegation for. + pub token_account: Pubkey, + /// Optional owner public key (for separate owner scenario). + /// If None, the payer is used as the owner. + pub owner: Option, +} + +impl Revoke { + /// Execute the revoke action via RPC where payer is the owner. + /// + /// This method only supports cases where `owner == payer`. If you need a + /// separate owner and payer, use [`execute_with_owner`](Self::execute_with_owner). + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair (must also be the owner) + /// + /// # Returns + /// `Result` - The transaction signature + /// + /// # Errors + /// Returns an error if `self.owner` is `Some` and does not equal `payer.pubkey()`. + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + ) -> Result { + let owner_pubkey = self.owner.unwrap_or_else(|| payer.pubkey()); + + if owner_pubkey != payer.pubkey() { + return Err(RpcError::CustomError( + "owner does not match payer; use execute_with_owner for separate owner/payer" + .to_string(), + )); + } + + let ix = RevokeInstruction { + token_account: self.token_account, + owner: owner_pubkey, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &[payer]) + .await + } + + /// Execute the revoke action via RPC with a separate owner. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair + /// * `owner` - The owner of the token account (signer) + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute_with_owner( + self, + rpc: &mut R, + payer: &Keypair, + owner: &Keypair, + ) -> Result { + let ix = RevokeInstruction { + token_account: self.token_account, + owner: owner.pubkey(), + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let mut signers: Vec<&Keypair> = vec![payer]; + if owner.pubkey() != payer.pubkey() { + signers.push(owner); + } + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } +} diff --git a/sdk-libs/token-client/src/actions/transfer.rs b/sdk-libs/token-client/src/actions/transfer.rs index 2d32024fb0..de6089df55 100644 --- a/sdk-libs/token-client/src/actions/transfer.rs +++ b/sdk-libs/token-client/src/actions/transfer.rs @@ -1,78 +1,75 @@ +//! Transfer actions for Light Token. +//! +//! These actions provide clean interfaces for transferring Light Tokens. + use light_client::rpc::{Rpc, RpcError}; -use solana_instruction::{AccountMeta, Instruction}; +use light_token::instruction::Transfer as TransferInstruction; use solana_keypair::Keypair; use solana_pubkey::Pubkey; use solana_signature::Signature; use solana_signer::Signer; -const SYSTEM_PROGRAM_ID: [u8; 32] = [0u8; 32]; - -/// Transfer from one token account to another. -/// -/// # Arguments -/// * `rpc` - RPC client -/// * `source` - Source token account (decompressed compressed token account) -/// * `destination` - Destination token account -/// * `amount` - Amount of tokens to transfer -/// * `authority` - Authority that can spend from the source token account -/// * `payer` - Transaction fee payer keypair +/// Parameters for transferring Light Tokens between accounts. /// -/// # Returns -/// `Result` - The transaction signature -pub async fn transfer( - rpc: &mut R, - source: Pubkey, - destination: Pubkey, - amount: u64, - authority: &Keypair, - payer: &Keypair, -) -> Result { - let transfer_instruction = - create_transfer_token_instruction(source, destination, amount, authority.pubkey())?; +/// # Example +/// ```ignore +/// Transfer { +/// source, +/// destination, +/// amount: 1000, +/// ..Default::default() +/// }.execute(&mut rpc, &payer, &authority).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct Transfer { + /// Source token account. + pub source: Pubkey, + /// Destination token account. + pub destination: Pubkey, + /// Amount of tokens to transfer. + pub amount: u64, +} - let mut signers = vec![payer]; - if authority.pubkey() != payer.pubkey() { - signers.push(authority); - } +impl Transfer { + /// Execute the transfer action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair (also pays for rent top-ups) + /// * `authority` - Authority that can spend from the source account + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + authority: &Keypair, + ) -> Result { + // Only set fee_payer if payer differs from authority + let fee_payer = if payer.pubkey() != authority.pubkey() { + Some(payer.pubkey()) + } else { + None + }; - rpc.create_and_send_transaction(&[transfer_instruction], &payer.pubkey(), &signers) - .await -} + let ix = TransferInstruction { + source: self.source, + destination: self.destination, + amount: self.amount, + authority: authority.pubkey(), + max_top_up: None, + fee_payer, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; -// TODO: consume the variant from compressed-token-sdk instead -/// Create a token transfer instruction. -/// -/// # Arguments -/// * `source` - Source token account -/// * `destination` - Destination token account -/// * `amount` - Amount to transfer -/// * `authority` - Authority pubkey -/// -/// # Returns -/// `Result` -#[allow(clippy::result_large_err)] -pub fn create_transfer_token_instruction( - source: Pubkey, - destination: Pubkey, - amount: u64, - authority: Pubkey, -) -> Result { - let transfer_instruction = Instruction { - program_id: Pubkey::from(light_token_interface::LIGHT_TOKEN_PROGRAM_ID), - accounts: vec![ - AccountMeta::new(source, false), // Source token account - AccountMeta::new(destination, false), // Destination token account - AccountMeta::new(authority, true), // Authority must be writable for potential top-ups - AccountMeta::new_readonly(Pubkey::from(SYSTEM_PROGRAM_ID), false), // System program for rent top-ups - ], - data: { - // CTokenTransfer discriminator - let mut data = vec![3u8]; - // Add SPL Token Transfer instruction data exactly like SPL does - data.extend_from_slice(&amount.to_le_bytes()); // Amount as u64 little-endian - data - }, - }; + let mut signers = vec![payer]; + if authority.pubkey() != payer.pubkey() { + signers.push(authority); + } - Ok(transfer_instruction) + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } } diff --git a/sdk-libs/token-client/src/actions/transfer_checked.rs b/sdk-libs/token-client/src/actions/transfer_checked.rs new file mode 100644 index 0000000000..0a5e0f3d7b --- /dev/null +++ b/sdk-libs/token-client/src/actions/transfer_checked.rs @@ -0,0 +1,86 @@ +//! Transfer checked action for Light Token. +//! +//! This action provides a clean interface for transferring Light Tokens with decimal validation. + +use light_client::rpc::{Rpc, RpcError}; +use light_token::instruction::TransferChecked as TransferCheckedInstruction; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for transferring Light Tokens with decimal validation. +/// +/// Unlike the basic transfer, this validates the amount against +/// the token's decimals to ensure the transfer is using the correct precision. +/// +/// # Example +/// ```ignore +/// TransferChecked { +/// source, +/// mint, +/// destination, +/// amount: 1000, +/// decimals: 9, +/// ..Default::default() +/// }.execute(&mut rpc, &payer, &authority).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct TransferChecked { + /// Source token account. + pub source: Pubkey, + /// The mint public key. + pub mint: Pubkey, + /// Destination token account. + pub destination: Pubkey, + /// Amount of tokens to transfer. + pub amount: u64, + /// Expected decimals for the token. + pub decimals: u8, +} + +impl TransferChecked { + /// Execute the transfer_checked action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair (also pays for rent top-ups) + /// * `authority` - Authority that can spend from the source account + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + authority: &Keypair, + ) -> Result { + // Only set fee_payer if payer differs from authority + let fee_payer = if payer.pubkey() != authority.pubkey() { + Some(payer.pubkey()) + } else { + None + }; + + let ix = TransferCheckedInstruction { + source: self.source, + mint: self.mint, + destination: self.destination, + amount: self.amount, + decimals: self.decimals, + authority: authority.pubkey(), + max_top_up: None, + fee_payer, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let mut signers = vec![payer]; + if authority.pubkey() != payer.pubkey() { + signers.push(authority); + } + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } +} diff --git a/sdk-libs/token-client/src/actions/transfer_interface.rs b/sdk-libs/token-client/src/actions/transfer_interface.rs new file mode 100644 index 0000000000..9ecaf9ca1b --- /dev/null +++ b/sdk-libs/token-client/src/actions/transfer_interface.rs @@ -0,0 +1,122 @@ +//! Transfer interface action for Light Token. +//! +//! This action provides a clean interface for transferring tokens that auto-routes +//! based on the account types (Light or SPL). + +use light_client::rpc::{Rpc, RpcError}; +use light_token::{ + instruction::{SplInterface, TransferInterface as TransferInterfaceInstruction}, + spl_interface::find_spl_interface_pda_with_index, +}; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for transferring tokens using the interface that auto-routes based on account types. +/// +/// This automatically detects whether the source and destination are +/// Light token accounts or SPL token accounts and routes the transfer accordingly: +/// - Light -> Light: Direct transfer between Light accounts +/// - Light -> SPL: Decompress from Light to SPL account +/// - SPL -> Light: Compress from SPL to Light account +/// - SPL -> SPL: Pass-through to SPL token program +/// +/// # Example +/// ```ignore +/// TransferInterface { +/// source, +/// mint, +/// destination, +/// amount: 1000, +/// decimals: 9, +/// ..Default::default() +/// }.execute(&mut rpc, &payer, &authority).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct TransferInterface { + /// Source token account. + pub source: Pubkey, + /// The mint public key. + pub mint: Pubkey, + /// Destination token account. + pub destination: Pubkey, + /// Amount of tokens to transfer. + pub amount: u64, + /// Token decimals. + pub decimals: u8, + /// SPL token program (spl_token::ID or spl_token_2022::ID), required for cross-interface transfers. + pub spl_token_program: Option, + /// Whether the mint has restricted extensions (Token-2022 specific). + pub restricted: bool, +} + +impl TransferInterface { + /// Execute the transfer_interface action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair + /// * `authority` - Authority that can spend from the source account + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + authority: &Keypair, + ) -> Result { + // Fetch account info to determine owners + let source_account = rpc.get_account(self.source).await?.ok_or_else(|| { + RpcError::CustomError(format!("Source account {} not found", self.source)) + })?; + + let destination_account = rpc.get_account(self.destination).await?.ok_or_else(|| { + RpcError::CustomError(format!( + "Destination account {} not found", + self.destination + )) + })?; + + let source_owner = source_account.owner; + let destination_owner = destination_account.owner; + + // Build SplInterface if needed for cross-interface transfers + let spl_interface = if let Some(spl_program) = self.spl_token_program { + let (spl_interface_pda, spl_interface_pda_bump) = + find_spl_interface_pda_with_index(&self.mint, 0, self.restricted); + Some(SplInterface { + mint: self.mint, + spl_token_program: spl_program, + spl_interface_pda, + spl_interface_pda_bump, + }) + } else { + None + }; + + let ix = TransferInterfaceInstruction { + source: self.source, + destination: self.destination, + amount: self.amount, + decimals: self.decimals, + authority: authority.pubkey(), + payer: payer.pubkey(), + spl_interface, + max_top_up: None, + source_owner, + destination_owner, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let mut signers = vec![payer]; + if authority.pubkey() != payer.pubkey() { + signers.push(authority); + } + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } +} diff --git a/sdk-libs/token-client/src/actions/unwrap.rs b/sdk-libs/token-client/src/actions/unwrap.rs new file mode 100644 index 0000000000..72af63de42 --- /dev/null +++ b/sdk-libs/token-client/src/actions/unwrap.rs @@ -0,0 +1,84 @@ +//! Unwrap Light Token to SPL tokens action. +//! +//! Unwraps Light Token back to an SPL token account. + +use light_client::rpc::{Rpc, RpcError}; +use light_token::{ + constants::SPL_TOKEN_PROGRAM_ID, + instruction::{get_spl_interface_pda_and_bump, TransferToSpl}, +}; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for unwrapping Light Token back to SPL tokens. +/// +/// This transfers tokens from a Light Token account to an SPL token account. +/// +/// # Example +/// ```ignore +/// Unwrap { +/// source, +/// destination_spl_ata, +/// mint, +/// amount: 1000, +/// decimals: 9, +/// }.execute(&mut rpc, &payer, &authority).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct Unwrap { + /// Source Light Token account. + pub source: Pubkey, + /// Destination SPL token account. + pub destination_spl_ata: Pubkey, + /// The mint public key. + pub mint: Pubkey, + /// Amount of tokens to unwrap. + pub amount: u64, + /// Token decimals. + pub decimals: u8, +} + +impl Unwrap { + /// Execute the unwrap action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair + /// * `authority` - Authority for the source Light Token account + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + authority: &Keypair, + ) -> Result { + let (spl_interface_pda, bump) = get_spl_interface_pda_and_bump(&self.mint); + + let ix = TransferToSpl { + source: self.source, + destination_spl_token_account: self.destination_spl_ata, + amount: self.amount, + authority: authority.pubkey(), + mint: self.mint, + payer: payer.pubkey(), + spl_interface_pda, + spl_interface_pda_bump: bump, + decimals: self.decimals, + spl_token_program: SPL_TOKEN_PROGRAM_ID, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let mut signers: Vec<&Keypair> = vec![payer]; + if authority.pubkey() != payer.pubkey() { + signers.push(authority); + } + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } +} diff --git a/sdk-libs/token-client/src/actions/wrap.rs b/sdk-libs/token-client/src/actions/wrap.rs new file mode 100644 index 0000000000..89ca53ca82 --- /dev/null +++ b/sdk-libs/token-client/src/actions/wrap.rs @@ -0,0 +1,85 @@ +//! Wrap SPL tokens to Light Token action. +//! +//! Wraps SPL tokens into a Light Token account (rent-free storage). + +use light_client::rpc::{Rpc, RpcError}; +use light_token::{ + constants::SPL_TOKEN_PROGRAM_ID, + instruction::{get_spl_interface_pda_and_bump, TransferFromSpl}, +}; +use solana_keypair::Keypair; +use solana_pubkey::Pubkey; +use solana_signature::Signature; +use solana_signer::Signer; + +/// Parameters for wrapping SPL tokens into a Light Token account. +/// +/// This transfers tokens from an SPL token account to a Light Token account, +/// enabling rent-free storage. +/// +/// # Example +/// ```ignore +/// Wrap { +/// source_spl_ata, +/// destination, +/// mint, +/// amount: 1000, +/// decimals: 9, +/// }.execute(&mut rpc, &payer, &authority).await?; +/// ``` +#[derive(Default, Clone, Debug)] +pub struct Wrap { + /// Source SPL token account. + pub source_spl_ata: Pubkey, + /// Destination Light Token account. + pub destination: Pubkey, + /// The mint public key. + pub mint: Pubkey, + /// Amount of tokens to wrap. + pub amount: u64, + /// Token decimals. + pub decimals: u8, +} + +impl Wrap { + /// Execute the wrap action via RPC. + /// + /// # Arguments + /// * `rpc` - RPC client + /// * `payer` - Transaction fee payer keypair + /// * `authority` - Authority for the source SPL token account + /// + /// # Returns + /// `Result` - The transaction signature + pub async fn execute( + self, + rpc: &mut R, + payer: &Keypair, + authority: &Keypair, + ) -> Result { + let (spl_interface_pda, bump) = get_spl_interface_pda_and_bump(&self.mint); + + let ix = TransferFromSpl { + amount: self.amount, + spl_interface_pda_bump: bump, + decimals: self.decimals, + source_spl_token_account: self.source_spl_ata, + destination: self.destination, + authority: authority.pubkey(), + mint: self.mint, + payer: payer.pubkey(), + spl_interface_pda, + spl_token_program: SPL_TOKEN_PROGRAM_ID, + } + .instruction() + .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; + + let mut signers: Vec<&Keypair> = vec![payer]; + if authority.pubkey() != payer.pubkey() { + signers.push(authority); + } + + rpc.create_and_send_transaction(&[ix], &payer.pubkey(), &signers) + .await + } +} diff --git a/sdk-libs/token-client/src/lib.rs b/sdk-libs/token-client/src/lib.rs index e5e9399ef0..4368dfed4a 100644 --- a/sdk-libs/token-client/src/lib.rs +++ b/sdk-libs/token-client/src/lib.rs @@ -1,4 +1,4 @@ pub mod actions; -pub mod instructions; -// re-export -pub use light_token::instruction; + +// Re-export actions at crate root for convenience +pub use actions::*; diff --git a/sdk-libs/token-sdk/src/instruction/approve_checked.rs b/sdk-libs/token-sdk/src/instruction/approve_checked.rs deleted file mode 100644 index 4b1939fe3a..0000000000 --- a/sdk-libs/token-sdk/src/instruction/approve_checked.rs +++ /dev/null @@ -1,144 +0,0 @@ -use light_sdk_types::LIGHT_TOKEN_PROGRAM_ID; -use solana_account_info::AccountInfo; -use solana_cpi::{invoke, invoke_signed}; -use solana_instruction::{AccountMeta, Instruction}; -use solana_program_error::ProgramError; -use solana_pubkey::Pubkey; - -/// # Approve a delegate for a Light Token account with decimals validation: -/// ```rust -/// # use solana_pubkey::Pubkey; -/// # use light_token::instruction::ApproveChecked; -/// # let token_account = Pubkey::new_unique(); -/// # let mint = Pubkey::new_unique(); -/// # let delegate = Pubkey::new_unique(); -/// # let owner = Pubkey::new_unique(); -/// let instruction = ApproveChecked { -/// token_account, -/// mint, -/// delegate, -/// owner, -/// amount: 100, -/// decimals: 8, -/// max_top_up: None, -/// }.instruction()?; -/// # Ok::<(), solana_program_error::ProgramError>(()) -/// ``` -pub struct ApproveChecked { - /// Light Token account to approve delegation for - pub token_account: Pubkey, - /// Mint account (for decimals validation - may be skipped if Light Token has cached decimals) - pub mint: Pubkey, - /// Delegate to approve - pub delegate: Pubkey, - /// Owner of the Light Token account (signer, payer for top-up) - pub owner: Pubkey, - /// Amount of tokens to delegate - pub amount: u64, - /// Expected token decimals - pub decimals: u8, - /// Maximum lamports for rent top-up. Transaction fails if exceeded. (0 = no limit) - pub max_top_up: Option, -} - -/// # Approve Light Token via CPI with decimals validation: -/// ```rust,no_run -/// # use light_token::instruction::ApproveCheckedCpi; -/// # use solana_account_info::AccountInfo; -/// # let token_account: AccountInfo = todo!(); -/// # let mint: AccountInfo = todo!(); -/// # let delegate: AccountInfo = todo!(); -/// # let owner: AccountInfo = todo!(); -/// # let system_program: AccountInfo = todo!(); -/// ApproveCheckedCpi { -/// token_account, -/// mint, -/// delegate, -/// owner, -/// system_program, -/// amount: 100, -/// decimals: 8, -/// max_top_up: None, -/// } -/// .invoke()?; -/// # Ok::<(), solana_program_error::ProgramError>(()) -/// ``` -pub struct ApproveCheckedCpi<'info> { - pub token_account: AccountInfo<'info>, - pub mint: AccountInfo<'info>, - pub delegate: AccountInfo<'info>, - pub owner: AccountInfo<'info>, - pub system_program: AccountInfo<'info>, - pub amount: u64, - pub decimals: u8, - /// Maximum lamports for rent top-up. Transaction fails if exceeded. (0 = no limit) - pub max_top_up: Option, -} - -impl<'info> ApproveCheckedCpi<'info> { - pub fn instruction(&self) -> Result { - ApproveChecked::from(self).instruction() - } - - pub fn invoke(self) -> Result<(), ProgramError> { - let instruction = ApproveChecked::from(&self).instruction()?; - let account_infos = [ - self.token_account, - self.mint, - self.delegate, - self.owner, - self.system_program, - ]; - invoke(&instruction, &account_infos) - } - - pub fn invoke_signed(self, signer_seeds: &[&[&[u8]]]) -> Result<(), ProgramError> { - let instruction = ApproveChecked::from(&self).instruction()?; - let account_infos = [ - self.token_account, - self.mint, - self.delegate, - self.owner, - self.system_program, - ]; - invoke_signed(&instruction, &account_infos, signer_seeds) - } -} - -impl<'info> From<&ApproveCheckedCpi<'info>> for ApproveChecked { - fn from(cpi: &ApproveCheckedCpi<'info>) -> Self { - Self { - token_account: *cpi.token_account.key, - mint: *cpi.mint.key, - delegate: *cpi.delegate.key, - owner: *cpi.owner.key, - amount: cpi.amount, - decimals: cpi.decimals, - max_top_up: cpi.max_top_up, - } - } -} - -impl ApproveChecked { - pub fn instruction(self) -> Result { - let mut data = vec![13u8]; // CTokenApproveChecked discriminator (SPL compatible) - data.extend_from_slice(&self.amount.to_le_bytes()); - data.push(self.decimals); - // Include max_top_up if set (11-byte format) - if let Some(max_top_up) = self.max_top_up { - data.extend_from_slice(&max_top_up.to_le_bytes()); - } - - Ok(Instruction { - program_id: Pubkey::from(LIGHT_TOKEN_PROGRAM_ID), - accounts: vec![ - AccountMeta::new(self.token_account, false), - AccountMeta::new_readonly(self.mint, false), - AccountMeta::new_readonly(self.delegate, false), - AccountMeta::new(self.owner, true), - AccountMeta::new_readonly(Pubkey::default(), false), - ], - data, - }) - } -} diff --git a/sdk-libs/token-sdk/src/instruction/mod.rs b/sdk-libs/token-sdk/src/instruction/mod.rs index d5be2ca2f1..0babeb4475 100644 --- a/sdk-libs/token-sdk/src/instruction/mod.rs +++ b/sdk-libs/token-sdk/src/instruction/mod.rs @@ -93,7 +93,6 @@ //! mod approve; -mod approve_checked; mod burn; mod burn_checked; mod close; @@ -116,7 +115,6 @@ mod transfer_interface; mod transfer_to_spl; pub use approve::*; -pub use approve_checked::*; pub use burn::*; pub use burn_checked::*; pub use close::{CloseAccount, CloseAccountCpi}; diff --git a/sdk-tests/sdk-light-token-test/tests/shared.rs b/sdk-tests/sdk-light-token-test/tests/shared.rs index ab95972c50..aecc786261 100644 --- a/sdk-tests/sdk-light-token-test/tests/shared.rs +++ b/sdk-tests/sdk-light-token-test/tests/shared.rs @@ -409,10 +409,10 @@ pub async fn setup_create_compressed_only_mint( mint_authority: Pubkey, decimals: u8, ) -> (Pubkey, [u8; 32], Keypair) { - use light_token::instruction::{derive_mint_compressed_address, find_mint_address}; - use light_token_client::instructions::mint_action::{ + use light_test_utils::actions::legacy::instructions::mint_action::{ create_mint_action_instruction, MintActionParams, NewMint, }; + use light_token::instruction::{derive_mint_compressed_address, find_mint_address}; let mint_seed = Keypair::new(); let address_tree = rpc.get_address_tree_v2(); diff --git a/sdk-tests/sdk-light-token-test/tests/test_decompress_mint.rs b/sdk-tests/sdk-light-token-test/tests/test_decompress_mint.rs index e22111be8d..4f3613aac9 100644 --- a/sdk-tests/sdk-light-token-test/tests/test_decompress_mint.rs +++ b/sdk-tests/sdk-light-token-test/tests/test_decompress_mint.rs @@ -7,10 +7,10 @@ use borsh::BorshDeserialize; use light_client::{indexer::Indexer, rpc::Rpc}; use light_compressible::compression_info::CompressionInfo; use light_program_test::{LightProgramTest, ProgramTestConfig}; -use light_token::instruction::derive_mint_compressed_address; -use light_token_client::instructions::mint_action::{ +use light_test_utils::actions::legacy::instructions::mint_action::{ create_mint_action_instruction, MintActionParams, MintActionType, }; +use light_token::instruction::derive_mint_compressed_address; use light_token_interface::state::Mint; use solana_sdk::signer::Signer; diff --git a/sdk-tests/sdk-token-test/tests/decompress_full_cpi.rs b/sdk-tests/sdk-token-test/tests/decompress_full_cpi.rs index 26f9563c18..6ff8560390 100644 --- a/sdk-tests/sdk-token-test/tests/decompress_full_cpi.rs +++ b/sdk-tests/sdk-token-test/tests/decompress_full_cpi.rs @@ -9,8 +9,10 @@ use light_compressed_token_sdk::compressed_token::{ }; use light_program_test::{Indexer, LightProgramTest, ProgramTestConfig, Rpc}; use light_sdk::instruction::PackedAccounts; -use light_test_utils::airdrop_lamports; -use light_token_client::{actions::mint_action_comprehensive, instructions::mint_action::NewMint}; +use light_test_utils::{ + actions::{legacy::instructions::mint_action::NewMint, mint_action_comprehensive}, + airdrop_lamports, +}; use light_token_interface::instructions::mint_action::{MintWithContext, Recipient}; use sdk_token_test::mint_compressed_tokens_cpi_write::MintCompressedTokensCpiWriteParams; use solana_sdk::{ diff --git a/sdk-tests/sdk-token-test/tests/test_4_transfer2.rs b/sdk-tests/sdk-token-test/tests/test_4_transfer2.rs index 968107d32f..fd978aeba7 100644 --- a/sdk-tests/sdk-token-test/tests/test_4_transfer2.rs +++ b/sdk-tests/sdk-token-test/tests/test_4_transfer2.rs @@ -123,7 +123,7 @@ async fn create_compressed_mints_and_tokens( .expect("Compressed token account for mint1 should exist"); let decompress_instruction = - light_token_client::instructions::transfer2::create_decompress_instruction( + light_test_utils::actions::legacy::instructions::transfer2::create_decompress_instruction( rpc, std::slice::from_ref(mint1_token_account), decompress_amount, diff --git a/sdk-tests/sdk-token-test/tests/test_compress_full_and_close.rs b/sdk-tests/sdk-token-test/tests/test_compress_full_and_close.rs index a97a3cddc8..badb7dce42 100644 --- a/sdk-tests/sdk-token-test/tests/test_compress_full_and_close.rs +++ b/sdk-tests/sdk-token-test/tests/test_compress_full_and_close.rs @@ -8,11 +8,11 @@ use light_compressed_token_sdk::compressed_token::{ }; use light_program_test::{Indexer, LightProgramTest, ProgramTestConfig, Rpc}; use light_sdk::instruction::{PackedAccounts, SystemAccountMetaConfig}; +use light_test_utils::actions::legacy::instructions::transfer2::create_decompress_instruction; use light_token::instruction::{ config_pda, derive_token_ata, rent_sponsor_pda, CompressibleParams, CreateAssociatedTokenAccount, }; -use light_token_client::instructions::transfer2::create_decompress_instruction; use light_token_interface::{ instructions::mint_action::{MintWithContext, Recipient}, state::{BaseMint, Mint, MintMetadata, TokenDataVersion, ACCOUNT_TYPE_MINT}, diff --git a/sdk-tests/token-client-test/Cargo.toml b/sdk-tests/token-client-test/Cargo.toml new file mode 100644 index 0000000000..afad75afa6 --- /dev/null +++ b/sdk-tests/token-client-test/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "token-client-test" +version = "0.1.0" +description = "Integration tests for light-token-client actions" +repository = "https://github.com/Lightprotocol/light-protocol" +license = "Apache-2.0" +edition = "2021" + +[features] +test-sbf = [] + +[dev-dependencies] +light-program-test = { workspace = true, features = ["devenv"] } +light-client = { workspace = true, features = ["v2"] } +light-token-client = { workspace = true } +light-token = { workspace = true } +light-token-interface = { workspace = true } +light-test-utils = { workspace = true } +tokio = { workspace = true } +solana-sdk = { workspace = true } +borsh = { workspace = true } +spl-token = { workspace = true } + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = [ + 'cfg(target_os, values("solana"))', + 'cfg(feature, values("frozen-abi", "no-entrypoint"))', +] diff --git a/sdk-tests/token-client-test/tests/test_approve_revoke.rs b/sdk-tests/token-client-test/tests/test_approve_revoke.rs new file mode 100644 index 0000000000..974023fcef --- /dev/null +++ b/sdk-tests/token-client-test/tests/test_approve_revoke.rs @@ -0,0 +1,427 @@ +//! Tests for the approve and revoke actions in light-token-client. + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_token::instruction::derive_token_ata; +use light_token_client::actions::{Approve, CreateAta, CreateMint, MintTo, Revoke, Transfer}; +use light_token_interface::state::{AccountState, Token}; +use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer}; + +fn get_expected_token( + actual: &Token, + mint: Pubkey, + owner: Pubkey, + amount: u64, + delegate: Option, + delegated_amount: u64, +) -> Token { + Token { + mint: mint.to_bytes().into(), + owner: owner.to_bytes().into(), + amount, + delegate: delegate.map(|d| d.to_bytes().into()), + state: AccountState::Initialized, + is_native: None, + delegated_amount, + close_authority: None, + account_type: actual.account_type, + extensions: actual.extensions.clone(), + } +} + +/// Test approving a delegate for a token account. +#[tokio::test] +async fn test_approve_basic() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create ATA for payer + let owner = payer.pubkey(); + let (token_account, _) = derive_token_ata(&owner, &mint); + + CreateAta { + mint, + owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens + let mint_amount = 1000u64; + MintTo { + mint, + destination: token_account, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Approve delegate + let delegate = Pubkey::new_unique(); + let delegate_amount = 500u64; + + Approve { + token_account, + delegate, + amount: delegate_amount, + owner: None, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Verify delegation + let account_data = rpc.get_account(token_account).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let expected = get_expected_token( + &token_state, + mint, + owner, + mint_amount, + Some(delegate), + delegate_amount, + ); + assert_eq!(token_state, expected); +} + +/// Test approving with a separate owner keypair. +#[tokio::test] +async fn test_approve_with_separate_owner() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create ATA for a different owner + let owner = Keypair::new(); + let (token_account, _) = derive_token_ata(&owner.pubkey(), &mint); + + CreateAta { + mint, + owner: owner.pubkey(), + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens + let mint_amount = 1000u64; + MintTo { + mint, + destination: token_account, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Approve delegate with separate owner + let delegate = Pubkey::new_unique(); + let delegate_amount = 300u64; + + Approve { + token_account, + delegate, + amount: delegate_amount, + owner: Some(owner.pubkey()), + } + .execute_with_owner(&mut rpc, &payer, &owner) + .await + .unwrap(); + + // Verify delegation + let account_data = rpc.get_account(token_account).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let expected = get_expected_token( + &token_state, + mint, + owner.pubkey(), + mint_amount, + Some(delegate), + delegate_amount, + ); + assert_eq!(token_state, expected); +} + +/// Test revoking a delegate. +#[tokio::test] +async fn test_revoke_basic() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create ATA + let owner = payer.pubkey(); + let (token_account, _) = derive_token_ata(&owner, &mint); + + CreateAta { + mint, + owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens + let mint_amount = 1000u64; + MintTo { + mint, + destination: token_account, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Approve delegate first + let delegate = Pubkey::new_unique(); + let delegate_amount = 500u64; + + Approve { + token_account, + delegate, + amount: delegate_amount, + owner: None, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Verify delegation is set + let account_data = rpc.get_account(token_account).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let expected_with_delegate = get_expected_token( + &token_state, + mint, + owner, + mint_amount, + Some(delegate), + delegate_amount, + ); + assert_eq!(token_state, expected_with_delegate); + + // Revoke delegate + Revoke { + token_account, + owner: None, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Verify delegation is revoked + let account_data = rpc.get_account(token_account).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let expected_revoked = get_expected_token(&token_state, mint, owner, mint_amount, None, 0); + assert_eq!(token_state, expected_revoked); +} + +/// Test revoking with a separate owner keypair. +#[tokio::test] +async fn test_revoke_with_separate_owner() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create ATA for a different owner + let owner = Keypair::new(); + let (token_account, _) = derive_token_ata(&owner.pubkey(), &mint); + + CreateAta { + mint, + owner: owner.pubkey(), + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens + let mint_amount = 1000u64; + MintTo { + mint, + destination: token_account, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Approve delegate + let delegate = Pubkey::new_unique(); + Approve { + token_account, + delegate, + amount: 500, + owner: Some(owner.pubkey()), + } + .execute_with_owner(&mut rpc, &payer, &owner) + .await + .unwrap(); + + // Revoke with separate owner + Revoke { + token_account, + owner: Some(owner.pubkey()), + } + .execute_with_owner(&mut rpc, &payer, &owner) + .await + .unwrap(); + + // Verify delegation is revoked + let account_data = rpc.get_account(token_account).await.unwrap().unwrap(); + let token_state = Token::deserialize(&mut &account_data.data[..]).unwrap(); + let expected = get_expected_token(&token_state, mint, owner.pubkey(), mint_amount, None, 0); + assert_eq!(token_state, expected); +} + +/// Test delegate transfer using approved amount. +#[tokio::test] +async fn test_approve_and_delegate_transfer() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create source ATA + let source_owner = payer.pubkey(); + let (source_ata, _) = derive_token_ata(&source_owner, &mint); + + CreateAta { + mint, + owner: source_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Create destination ATA + let dest_owner = Pubkey::new_unique(); + let (dest_ata, _) = derive_token_ata(&dest_owner, &mint); + + CreateAta { + mint, + owner: dest_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens + let mint_amount = 1000u64; + MintTo { + mint, + destination: source_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create a delegate keypair + let delegate = Keypair::new(); + let delegate_amount = 500u64; + + // Approve the delegate + Approve { + token_account: source_ata, + delegate: delegate.pubkey(), + amount: delegate_amount, + owner: None, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Transfer using delegate authority + let transfer_amount = 300u64; + Transfer { + source: source_ata, + destination: dest_ata, + amount: transfer_amount, + } + .execute(&mut rpc, &payer, &delegate) + .await + .unwrap(); + + // Verify source account (delegated amount should be reduced) + let source_data = rpc.get_account(source_ata).await.unwrap().unwrap(); + let source_state = Token::deserialize(&mut &source_data.data[..]).unwrap(); + let expected_source = get_expected_token( + &source_state, + mint, + source_owner, + mint_amount - transfer_amount, + Some(delegate.pubkey()), + delegate_amount - transfer_amount, + ); + assert_eq!(source_state, expected_source); + + // Verify destination account + let dest_data = rpc.get_account(dest_ata).await.unwrap().unwrap(); + let dest_state = Token::deserialize(&mut &dest_data.data[..]).unwrap(); + let expected_dest = get_expected_token(&dest_state, mint, dest_owner, transfer_amount, None, 0); + assert_eq!(dest_state, expected_dest); +} diff --git a/sdk-tests/token-client-test/tests/test_create_mint.rs b/sdk-tests/token-client-test/tests/test_create_mint.rs new file mode 100644 index 0000000000..208c0e6328 --- /dev/null +++ b/sdk-tests/token-client-test/tests/test_create_mint.rs @@ -0,0 +1,160 @@ +//! Tests for the create_mint action in light-token-client. + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_token::instruction::find_mint_address; +use light_token_client::actions::{CreateMint, TokenMetadata}; +use light_token_interface::state::Mint; +use solana_sdk::{signature::Keypair, signer::Signer}; + +/// Test creating a new mint using the create_mint action with all fields. +#[tokio::test] +async fn test_create_mint_with_metadata() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + let freeze_authority = payer.pubkey(); + let seed = Keypair::new(); + + // Create mint with all fields + let (_, mint) = CreateMint { + decimals, + freeze_authority: Some(freeze_authority), + token_metadata: Some(TokenMetadata { + name: "Test Token".to_string(), + symbol: "TEST".to_string(), + uri: "https://example.com/metadata.json".to_string(), + update_authority: Some(payer.pubkey()), + additional_metadata: Some(vec![ + ("key1".to_string(), "value1".to_string()), + ("key2".to_string(), "value2".to_string()), + ]), + }), + seed: Some(seed), + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify the mint was created + let mint_account = rpc.get_account(mint).await.unwrap(); + assert!(mint_account.is_some(), "Mint account should exist"); + + let mint_data = mint_account.unwrap(); + let mint_state = Mint::deserialize(&mut &mint_data.data[..]).unwrap(); + + // Verify mint fields + assert_eq!(mint_state.base.decimals, decimals); + assert_eq!( + mint_state.base.mint_authority, + Some(payer.pubkey().to_bytes().into()) + ); + assert_eq!( + mint_state.base.freeze_authority, + Some(freeze_authority.to_bytes().into()) + ); + assert_eq!(mint_state.base.supply, 0); + assert!(mint_state.base.is_initialized); + + // Verify metadata + assert_eq!(mint_state.metadata.mint.to_bytes(), mint.to_bytes()); + assert!(mint_state.metadata.mint_decompressed); +} + +/// Test creating a mint with freeze authority. +#[tokio::test] +async fn test_create_mint_with_freeze_authority() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 6u8; + let freeze_authority = payer.pubkey(); + + // Create mint with freeze authority + let (_, mint) = CreateMint { + decimals, + freeze_authority: Some(freeze_authority), + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify the mint was created + let mint_account = rpc.get_account(mint).await.unwrap(); + assert!(mint_account.is_some(), "Mint account should exist"); + + let mint_data = mint_account.unwrap(); + let mint_state = Mint::deserialize(&mut &mint_data.data[..]).unwrap(); + + // Verify freeze authority + assert_eq!( + mint_state.base.freeze_authority, + Some(freeze_authority.to_bytes().into()) + ); +} + +/// Test creating a mint with deterministic seed. +#[tokio::test] +async fn test_create_mint_with_seed() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let seed = Keypair::new(); + let expected_mint = find_mint_address(&seed.pubkey()).0; + + // Create mint with explicit seed + let (_, mint) = CreateMint { + decimals: 9, + seed: Some(seed), + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify the mint address matches the expected derived address + assert_eq!(mint, expected_mint); + + // Verify the mint was created + let mint_account = rpc.get_account(mint).await.unwrap(); + assert!(mint_account.is_some(), "Mint account should exist"); +} + +/// Test creating multiple mints. +#[tokio::test] +async fn test_create_multiple_mints() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + // Create first mint + let (_, mint1) = CreateMint { + decimals: 9, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create second mint + let (_, mint2) = CreateMint { + decimals: 6, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify both mints are different + assert_ne!(mint1, mint2, "Mints should be different"); + + // Verify both mints exist + assert!(rpc.get_account(mint1).await.unwrap().is_some()); + assert!(rpc.get_account(mint2).await.unwrap().is_some()); +} diff --git a/sdk-tests/token-client-test/tests/test_transfer.rs b/sdk-tests/token-client-test/tests/test_transfer.rs new file mode 100644 index 0000000000..218037ffa2 --- /dev/null +++ b/sdk-tests/token-client-test/tests/test_transfer.rs @@ -0,0 +1,193 @@ +//! Tests for the transfer action in light-token-client. + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_token::instruction::derive_token_ata; +use light_token_client::actions::{CreateAta, CreateMint, MintTo, Transfer}; +use light_token_interface::state::{AccountState, Token}; +use solana_sdk::{pubkey::Pubkey, signer::Signer}; + +fn get_expected_token( + actual: &Token, + mint: Pubkey, + owner: Pubkey, + amount: u64, + delegate: Option, + delegated_amount: u64, +) -> Token { + Token { + mint: mint.to_bytes().into(), + owner: owner.to_bytes().into(), + amount, + delegate: delegate.map(|d| d.to_bytes().into()), + state: AccountState::Initialized, + is_native: None, + delegated_amount, + close_authority: None, + account_type: actual.account_type, + extensions: actual.extensions.clone(), + } +} + +/// Test transferring tokens between Light Token accounts. +#[tokio::test] +async fn test_transfer_basic() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create source and destination ATAs + let source_owner = payer.pubkey(); + let dest_owner = Pubkey::new_unique(); + + let (source_ata, _) = derive_token_ata(&source_owner, &mint); + let (dest_ata, _) = derive_token_ata(&dest_owner, &mint); + + CreateAta { + mint, + owner: source_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + CreateAta { + mint, + owner: dest_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens to source + let mint_amount = 1000u64; + MintTo { + mint, + destination: source_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Transfer tokens + let transfer_amount = 500u64; + Transfer { + source: source_ata, + destination: dest_ata, + amount: transfer_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify source account + let source_data = rpc.get_account(source_ata).await.unwrap().unwrap(); + let source_state = Token::deserialize(&mut &source_data.data[..]).unwrap(); + let expected_source = get_expected_token( + &source_state, + mint, + source_owner, + mint_amount - transfer_amount, + None, + 0, + ); + assert_eq!(source_state, expected_source); + + // Verify destination account + let dest_data = rpc.get_account(dest_ata).await.unwrap().unwrap(); + let dest_state = Token::deserialize(&mut &dest_data.data[..]).unwrap(); + let expected_dest = get_expected_token(&dest_state, mint, dest_owner, transfer_amount, None, 0); + assert_eq!(dest_state, expected_dest); +} + +/// Test transferring full balance. +#[tokio::test] +async fn test_transfer_full_balance() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create source and destination ATAs + let source_owner = payer.pubkey(); + let dest_owner = Pubkey::new_unique(); + + let (source_ata, _) = derive_token_ata(&source_owner, &mint); + let (dest_ata, _) = derive_token_ata(&dest_owner, &mint); + + CreateAta { + mint, + owner: source_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + CreateAta { + mint, + owner: dest_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens to source + let mint_amount = 1000u64; + MintTo { + mint, + destination: source_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Transfer full balance + Transfer { + source: source_ata, + destination: dest_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify source account (zero balance) + let source_data = rpc.get_account(source_ata).await.unwrap().unwrap(); + let source_state = Token::deserialize(&mut &source_data.data[..]).unwrap(); + let expected_source = get_expected_token(&source_state, mint, source_owner, 0, None, 0); + assert_eq!(source_state, expected_source); + + // Verify destination account + let dest_data = rpc.get_account(dest_ata).await.unwrap().unwrap(); + let dest_state = Token::deserialize(&mut &dest_data.data[..]).unwrap(); + let expected_dest = get_expected_token(&dest_state, mint, dest_owner, mint_amount, None, 0); + assert_eq!(dest_state, expected_dest); +} diff --git a/sdk-tests/token-client-test/tests/test_transfer_checked.rs b/sdk-tests/token-client-test/tests/test_transfer_checked.rs new file mode 100644 index 0000000000..070e3dcf04 --- /dev/null +++ b/sdk-tests/token-client-test/tests/test_transfer_checked.rs @@ -0,0 +1,206 @@ +//! Tests for the transfer_checked action in light-token-client. + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_token::instruction::derive_token_ata; +use light_token_client::actions::{CreateAta, CreateMint, MintTo, TransferChecked}; +use light_token_interface::state::{AccountState, Token}; +use solana_sdk::{pubkey::Pubkey, signer::Signer}; + +fn get_expected_token( + actual: &Token, + mint: Pubkey, + owner: Pubkey, + amount: u64, + delegate: Option, + delegated_amount: u64, +) -> Token { + Token { + mint: mint.to_bytes().into(), + owner: owner.to_bytes().into(), + amount, + delegate: delegate.map(|d| d.to_bytes().into()), + state: AccountState::Initialized, + is_native: None, + delegated_amount, + close_authority: None, + account_type: actual.account_type, + extensions: actual.extensions.clone(), + } +} + +/// Test transfer_checked with correct decimals. +#[tokio::test] +async fn test_transfer_checked_basic() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create source and destination ATAs + let source_owner = payer.pubkey(); + let dest_owner = Pubkey::new_unique(); + + let (source_ata, _) = derive_token_ata(&source_owner, &mint); + let (dest_ata, _) = derive_token_ata(&dest_owner, &mint); + + CreateAta { + mint, + owner: source_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + CreateAta { + mint, + owner: dest_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens to source + let mint_amount = 1000u64; + MintTo { + mint, + destination: source_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Transfer with checked decimals + let transfer_amount = 500u64; + TransferChecked { + source: source_ata, + mint, + destination: dest_ata, + amount: transfer_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify source account + let source_data = rpc.get_account(source_ata).await.unwrap().unwrap(); + let source_state = Token::deserialize(&mut &source_data.data[..]).unwrap(); + let expected_source = get_expected_token( + &source_state, + mint, + source_owner, + mint_amount - transfer_amount, + None, + 0, + ); + assert_eq!(source_state, expected_source); + + // Verify destination account + let dest_data = rpc.get_account(dest_ata).await.unwrap().unwrap(); + let dest_state = Token::deserialize(&mut &dest_data.data[..]).unwrap(); + let expected_dest = get_expected_token(&dest_state, mint, dest_owner, transfer_amount, None, 0); + assert_eq!(dest_state, expected_dest); +} + +/// Test transfer_checked with different decimals token. +#[tokio::test] +async fn test_transfer_checked_different_decimals() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + // Use 6 decimals (like USDC) + let decimals = 6u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create source and destination ATAs + let source_owner = payer.pubkey(); + let dest_owner = Pubkey::new_unique(); + + let (source_ata, _) = derive_token_ata(&source_owner, &mint); + let (dest_ata, _) = derive_token_ata(&dest_owner, &mint); + + CreateAta { + mint, + owner: source_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + CreateAta { + mint, + owner: dest_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens to source (1000 tokens with 6 decimals = 1_000_000_000 base units) + let mint_amount = 1_000_000_000u64; + MintTo { + mint, + destination: source_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Transfer 500 tokens (500_000_000 base units) + let transfer_amount = 500_000_000u64; + TransferChecked { + source: source_ata, + mint, + destination: dest_ata, + amount: transfer_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify source account + let source_data = rpc.get_account(source_ata).await.unwrap().unwrap(); + let source_state = Token::deserialize(&mut &source_data.data[..]).unwrap(); + let expected_source = get_expected_token( + &source_state, + mint, + source_owner, + mint_amount - transfer_amount, + None, + 0, + ); + assert_eq!(source_state, expected_source); + + // Verify destination account + let dest_data = rpc.get_account(dest_ata).await.unwrap().unwrap(); + let dest_state = Token::deserialize(&mut &dest_data.data[..]).unwrap(); + let expected_dest = get_expected_token(&dest_state, mint, dest_owner, transfer_amount, None, 0); + assert_eq!(dest_state, expected_dest); +} diff --git a/sdk-tests/token-client-test/tests/test_transfer_interface.rs b/sdk-tests/token-client-test/tests/test_transfer_interface.rs new file mode 100644 index 0000000000..a5f8d0cba8 --- /dev/null +++ b/sdk-tests/token-client-test/tests/test_transfer_interface.rs @@ -0,0 +1,215 @@ +//! Tests for the transfer_interface action in light-token-client. + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_token::instruction::derive_token_ata; +use light_token_client::actions::{CreateAta, CreateMint, MintTo, TransferInterface}; +use light_token_interface::state::{AccountState, Token}; +use solana_sdk::{pubkey::Pubkey, signer::Signer}; + +fn get_expected_token( + actual: &Token, + mint: Pubkey, + owner: Pubkey, + amount: u64, + delegate: Option, + delegated_amount: u64, +) -> Token { + Token { + mint: mint.to_bytes().into(), + owner: owner.to_bytes().into(), + amount, + delegate: delegate.map(|d| d.to_bytes().into()), + state: AccountState::Initialized, + is_native: None, + delegated_amount, + close_authority: None, + account_type: actual.account_type, + extensions: actual.extensions.clone(), + } +} + +/// Test transfer_interface for Light -> Light transfer. +#[tokio::test] +async fn test_transfer_interface_light_to_light() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create source and destination ATAs + let source_owner = payer.pubkey(); + let dest_owner = Pubkey::new_unique(); + + let (source_ata, _) = derive_token_ata(&source_owner, &mint); + let (dest_ata, _) = derive_token_ata(&dest_owner, &mint); + + CreateAta { + mint, + owner: source_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + CreateAta { + mint, + owner: dest_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens to source + let mint_amount = 1000u64; + MintTo { + mint, + destination: source_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Transfer using interface (Light -> Light, no SPL token program needed) + let transfer_amount = 500u64; + TransferInterface { + source: source_ata, + mint, + destination: dest_ata, + amount: transfer_amount, + decimals, + spl_token_program: None, // No SPL token program needed for Light -> Light + restricted: false, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify source account + let source_data = rpc.get_account(source_ata).await.unwrap().unwrap(); + let source_state = Token::deserialize(&mut &source_data.data[..]).unwrap(); + let expected_source = get_expected_token( + &source_state, + mint, + source_owner, + mint_amount - transfer_amount, + None, + 0, + ); + assert_eq!(source_state, expected_source); + + // Verify destination account + let dest_data = rpc.get_account(dest_ata).await.unwrap().unwrap(); + let dest_state = Token::deserialize(&mut &dest_data.data[..]).unwrap(); + let expected_dest = get_expected_token(&dest_state, mint, dest_owner, transfer_amount, None, 0); + assert_eq!(dest_state, expected_dest); +} + +/// Test transfer_interface for multiple Light -> Light transfers. +#[tokio::test] +async fn test_transfer_interface_multiple_transfers() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = 9u8; + + // Create mint + let (_, mint) = CreateMint { + decimals, + ..Default::default() + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Create source and destination ATAs + let source_owner = payer.pubkey(); + let dest_owner = Pubkey::new_unique(); + + let (source_ata, _) = derive_token_ata(&source_owner, &mint); + let (dest_ata, _) = derive_token_ata(&dest_owner, &mint); + + CreateAta { + mint, + owner: source_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + CreateAta { + mint, + owner: dest_owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Mint tokens to source + let mint_amount = 1000u64; + MintTo { + mint, + destination: source_ata, + amount: mint_amount, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Transfer 300 + TransferInterface { + source: source_ata, + mint, + destination: dest_ata, + amount: 300, + decimals, + spl_token_program: None, + restricted: false, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Transfer 200 + TransferInterface { + source: source_ata, + mint, + destination: dest_ata, + amount: 200, + decimals, + spl_token_program: None, + restricted: false, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify source account (1000 - 300 - 200 = 500) + let source_data = rpc.get_account(source_ata).await.unwrap().unwrap(); + let source_state = Token::deserialize(&mut &source_data.data[..]).unwrap(); + let expected_source = get_expected_token(&source_state, mint, source_owner, 500, None, 0); + assert_eq!(source_state, expected_source); + + // Verify destination account (300 + 200 = 500) + let dest_data = rpc.get_account(dest_ata).await.unwrap().unwrap(); + let dest_state = Token::deserialize(&mut &dest_data.data[..]).unwrap(); + let expected_dest = get_expected_token(&dest_state, mint, dest_owner, 500, None, 0); + assert_eq!(dest_state, expected_dest); +} diff --git a/sdk-tests/token-client-test/tests/test_wrap_unwrap.rs b/sdk-tests/token-client-test/tests/test_wrap_unwrap.rs new file mode 100644 index 0000000000..aa5a212f7e --- /dev/null +++ b/sdk-tests/token-client-test/tests/test_wrap_unwrap.rs @@ -0,0 +1,328 @@ +//! Tests for the wrap and unwrap actions in light-token-client. +//! +//! These tests verify: +//! - Wrapping SPL tokens into Light Token accounts +//! - Unwrapping Light Tokens back to SPL token accounts + +use borsh::BorshDeserialize; +use light_client::rpc::Rpc; +use light_program_test::{LightProgramTest, ProgramTestConfig}; +use light_test_utils::spl::{ + create_mint_helper, create_token_account, mint_spl_tokens, CREATE_MINT_HELPER_DECIMALS, +}; +use light_token::instruction::derive_token_ata; +use light_token_client::actions::{CreateAta, Unwrap, Wrap}; +use light_token_interface::state::Token; +use solana_sdk::{program_pack::Pack, signature::Keypair, signer::Signer}; +use spl_token::state::Account as SplTokenAccount; + +/// Test wrapping SPL tokens into a Light Token account. +#[tokio::test] +async fn test_wrap_basic() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = CREATE_MINT_HELPER_DECIMALS; + + // Create SPL mint + let mint = create_mint_helper(&mut rpc, &payer).await; + + // Create SPL token account for payer + let spl_token_account = Keypair::new(); + create_token_account(&mut rpc, &mint, &spl_token_account, &payer) + .await + .unwrap(); + + // Mint SPL tokens + let mint_amount = 1000u64; + mint_spl_tokens( + &mut rpc, + &mint, + &spl_token_account.pubkey(), + &payer.pubkey(), + &payer, + mint_amount, + false, + ) + .await + .unwrap(); + + // Create Light Token ATA for destination + let owner = payer.pubkey(); + let (light_token_ata, _) = derive_token_ata(&owner, &mint); + + CreateAta { + mint, + owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Wrap SPL tokens to Light Token + let wrap_amount = 500u64; + Wrap { + source_spl_ata: spl_token_account.pubkey(), + destination: light_token_ata, + mint, + amount: wrap_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify Light Token balance + let light_token_data = rpc.get_account(light_token_ata).await.unwrap().unwrap(); + let light_token_state = Token::deserialize(&mut &light_token_data.data[..]).unwrap(); + assert_eq!(light_token_state.amount, wrap_amount); + + // Verify SPL token balance decreased + let spl_token_data = rpc + .get_account(spl_token_account.pubkey()) + .await + .unwrap() + .unwrap(); + let spl_state = SplTokenAccount::unpack(&spl_token_data.data).unwrap(); + assert_eq!(spl_state.amount, mint_amount - wrap_amount); +} + +/// Test unwrapping Light Tokens back to SPL tokens. +#[tokio::test] +async fn test_unwrap_basic() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = CREATE_MINT_HELPER_DECIMALS; + + // Create SPL mint + let mint = create_mint_helper(&mut rpc, &payer).await; + + // Create SPL token account + let spl_token_account = Keypair::new(); + create_token_account(&mut rpc, &mint, &spl_token_account, &payer) + .await + .unwrap(); + + // Mint SPL tokens + let mint_amount = 1000u64; + mint_spl_tokens( + &mut rpc, + &mint, + &spl_token_account.pubkey(), + &payer.pubkey(), + &payer, + mint_amount, + false, + ) + .await + .unwrap(); + + // Create Light Token ATA + let owner = payer.pubkey(); + let (light_token_ata, _) = derive_token_ata(&owner, &mint); + + CreateAta { + mint, + owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Wrap all SPL tokens to Light Token first + Wrap { + source_spl_ata: spl_token_account.pubkey(), + destination: light_token_ata, + mint, + amount: mint_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify Light Token has all tokens + let light_token_data = rpc.get_account(light_token_ata).await.unwrap().unwrap(); + let light_token_state = Token::deserialize(&mut &light_token_data.data[..]).unwrap(); + assert_eq!(light_token_state.amount, mint_amount); + + // Unwrap some tokens back to SPL + let unwrap_amount = 300u64; + Unwrap { + source: light_token_ata, + destination_spl_ata: spl_token_account.pubkey(), + mint, + amount: unwrap_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify Light Token balance decreased + let light_token_data = rpc.get_account(light_token_ata).await.unwrap().unwrap(); + let light_token_state = Token::deserialize(&mut &light_token_data.data[..]).unwrap(); + assert_eq!(light_token_state.amount, mint_amount - unwrap_amount); + + // Verify SPL token balance increased + let spl_token_data = rpc + .get_account(spl_token_account.pubkey()) + .await + .unwrap() + .unwrap(); + let spl_state = SplTokenAccount::unpack(&spl_token_data.data).unwrap(); + assert_eq!(spl_state.amount, unwrap_amount); +} + +/// Test wrap and unwrap round trip. +#[tokio::test] +async fn test_wrap_unwrap_round_trip() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = CREATE_MINT_HELPER_DECIMALS; + + // Create SPL mint + let mint = create_mint_helper(&mut rpc, &payer).await; + + // Create SPL token account + let spl_token_account = Keypair::new(); + create_token_account(&mut rpc, &mint, &spl_token_account, &payer) + .await + .unwrap(); + + // Mint SPL tokens + let mint_amount = 1000u64; + mint_spl_tokens( + &mut rpc, + &mint, + &spl_token_account.pubkey(), + &payer.pubkey(), + &payer, + mint_amount, + false, + ) + .await + .unwrap(); + + // Create Light Token ATA + let owner = payer.pubkey(); + let (light_token_ata, _) = derive_token_ata(&owner, &mint); + + CreateAta { + mint, + owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Wrap all tokens + Wrap { + source_spl_ata: spl_token_account.pubkey(), + destination: light_token_ata, + mint, + amount: mint_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Unwrap all tokens back + Unwrap { + source: light_token_ata, + destination_spl_ata: spl_token_account.pubkey(), + mint, + amount: mint_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify Light Token has 0 balance + let light_token_data = rpc.get_account(light_token_ata).await.unwrap().unwrap(); + let light_token_state = Token::deserialize(&mut &light_token_data.data[..]).unwrap(); + assert_eq!(light_token_state.amount, 0); + + // Verify SPL token has original balance + let spl_token_data = rpc + .get_account(spl_token_account.pubkey()) + .await + .unwrap() + .unwrap(); + let spl_state = SplTokenAccount::unpack(&spl_token_data.data).unwrap(); + assert_eq!(spl_state.amount, mint_amount); +} + +/// Test wrapping with large amounts. +#[tokio::test] +async fn test_wrap_large_amount() { + let config = ProgramTestConfig::new_v2(true, None); + let mut rpc = LightProgramTest::new(config).await.unwrap(); + let payer = rpc.get_payer().insecure_clone(); + + let decimals = CREATE_MINT_HELPER_DECIMALS; + + // Create SPL mint + let mint = create_mint_helper(&mut rpc, &payer).await; + + // Create SPL token account + let spl_token_account = Keypair::new(); + create_token_account(&mut rpc, &mint, &spl_token_account, &payer) + .await + .unwrap(); + + // Mint large amount of SPL tokens + let mint_amount = 1_000_000_000u64; + mint_spl_tokens( + &mut rpc, + &mint, + &spl_token_account.pubkey(), + &payer.pubkey(), + &payer, + mint_amount, + false, + ) + .await + .unwrap(); + + // Create Light Token ATA + let owner = payer.pubkey(); + let (light_token_ata, _) = derive_token_ata(&owner, &mint); + + CreateAta { + mint, + owner, + idempotent: false, + } + .execute(&mut rpc, &payer) + .await + .unwrap(); + + // Wrap half the tokens + let wrap_amount = 500_000_000u64; + Wrap { + source_spl_ata: spl_token_account.pubkey(), + destination: light_token_ata, + mint, + amount: wrap_amount, + decimals, + } + .execute(&mut rpc, &payer, &payer) + .await + .unwrap(); + + // Verify Light Token balance + let light_token_data = rpc.get_account(light_token_ata).await.unwrap().unwrap(); + let light_token_state = Token::deserialize(&mut &light_token_data.data[..]).unwrap(); + assert_eq!(light_token_state.amount, wrap_amount); +} From 5a405743286c85b4d5bb62109f210180239062a5 Mon Sep 17 00:00:00 2001 From: ananas Date: Fri, 23 Jan 2026 20:49:02 +0000 Subject: [PATCH 2/7] fix: wrap unwrap for any spl program, add check in approve --- sdk-libs/token-client/src/actions/approve.rs | 14 +++++++++ sdk-libs/token-client/src/actions/unwrap.rs | 30 +++++++++++++++++--- sdk-libs/token-client/src/actions/wrap.rs | 27 +++++++++++++++--- 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/sdk-libs/token-client/src/actions/approve.rs b/sdk-libs/token-client/src/actions/approve.rs index 875b19632d..547acb1b1d 100644 --- a/sdk-libs/token-client/src/actions/approve.rs +++ b/sdk-libs/token-client/src/actions/approve.rs @@ -96,12 +96,26 @@ impl Approve { /// /// # Returns /// `Result` - The transaction signature + /// + /// # Errors + /// Returns an error if `self.owner` is `Some` and does not equal `owner.pubkey()`. pub async fn execute_with_owner( self, rpc: &mut R, payer: &Keypair, owner: &Keypair, ) -> Result { + // Guard: if self.owner is set, it must match the provided owner keypair + if let Some(expected_owner) = self.owner { + if expected_owner != owner.pubkey() { + return Err(RpcError::CustomError(format!( + "owner mismatch: self.owner ({}) does not match owner.pubkey() ({})", + expected_owner, + owner.pubkey() + ))); + } + } + let ix = ApproveInstruction { token_account: self.token_account, delegate: self.delegate, diff --git a/sdk-libs/token-client/src/actions/unwrap.rs b/sdk-libs/token-client/src/actions/unwrap.rs index 72af63de42..db92a315a8 100644 --- a/sdk-libs/token-client/src/actions/unwrap.rs +++ b/sdk-libs/token-client/src/actions/unwrap.rs @@ -4,8 +4,9 @@ use light_client::rpc::{Rpc, RpcError}; use light_token::{ - constants::SPL_TOKEN_PROGRAM_ID, - instruction::{get_spl_interface_pda_and_bump, TransferToSpl}, + constants::SPL_TOKEN_2022_PROGRAM_ID, + instruction::TransferToSpl, + spl_interface::{find_spl_interface_pda, has_restricted_extensions}, }; use solana_keypair::Keypair; use solana_pubkey::Pubkey; @@ -56,7 +57,28 @@ impl Unwrap { payer: &Keypair, authority: &Keypair, ) -> Result { - let (spl_interface_pda, bump) = get_spl_interface_pda_and_bump(&self.mint); + // Get the destination account to determine the token program + let destination_account_info = rpc + .get_account(self.destination_spl_ata) + .await? + .ok_or_else(|| { + RpcError::CustomError("Destination SPL token account not found".to_string()) + })?; + + let spl_token_program = destination_account_info.owner; + + // Check for restricted extensions if using Token-2022 + let restricted = if spl_token_program == SPL_TOKEN_2022_PROGRAM_ID { + let mint_account = rpc + .get_account(self.mint) + .await? + .ok_or_else(|| RpcError::CustomError("Mint account not found".to_string()))?; + has_restricted_extensions(&mint_account.data) + } else { + false + }; + + let (spl_interface_pda, bump) = find_spl_interface_pda(&self.mint, restricted); let ix = TransferToSpl { source: self.source, @@ -68,7 +90,7 @@ impl Unwrap { spl_interface_pda, spl_interface_pda_bump: bump, decimals: self.decimals, - spl_token_program: SPL_TOKEN_PROGRAM_ID, + spl_token_program, } .instruction() .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; diff --git a/sdk-libs/token-client/src/actions/wrap.rs b/sdk-libs/token-client/src/actions/wrap.rs index 89ca53ca82..200076958a 100644 --- a/sdk-libs/token-client/src/actions/wrap.rs +++ b/sdk-libs/token-client/src/actions/wrap.rs @@ -4,8 +4,9 @@ use light_client::rpc::{Rpc, RpcError}; use light_token::{ - constants::SPL_TOKEN_PROGRAM_ID, - instruction::{get_spl_interface_pda_and_bump, TransferFromSpl}, + constants::SPL_TOKEN_2022_PROGRAM_ID, + instruction::TransferFromSpl, + spl_interface::{find_spl_interface_pda, has_restricted_extensions}, }; use solana_keypair::Keypair; use solana_pubkey::Pubkey; @@ -57,7 +58,25 @@ impl Wrap { payer: &Keypair, authority: &Keypair, ) -> Result { - let (spl_interface_pda, bump) = get_spl_interface_pda_and_bump(&self.mint); + // Get the source account to determine the token program + let source_account_info = rpc.get_account(self.source_spl_ata).await?.ok_or_else(|| { + RpcError::CustomError("Source SPL token account not found".to_string()) + })?; + + let spl_token_program = source_account_info.owner; + + // Check for restricted extensions if using Token-2022 + let restricted = if spl_token_program == SPL_TOKEN_2022_PROGRAM_ID { + let mint_account = rpc + .get_account(self.mint) + .await? + .ok_or_else(|| RpcError::CustomError("Mint account not found".to_string()))?; + has_restricted_extensions(&mint_account.data) + } else { + false + }; + + let (spl_interface_pda, bump) = find_spl_interface_pda(&self.mint, restricted); let ix = TransferFromSpl { amount: self.amount, @@ -69,7 +88,7 @@ impl Wrap { mint: self.mint, payer: payer.pubkey(), spl_interface_pda, - spl_token_program: SPL_TOKEN_PROGRAM_ID, + spl_token_program, } .instruction() .map_err(|e| RpcError::CustomError(format!("Failed to create instruction: {}", e)))?; From e73e5015b51909e94080add4cf421f514a6cf688 Mon Sep 17 00:00:00 2001 From: ananas Date: Fri, 23 Jan 2026 22:26:33 +0000 Subject: [PATCH 3/7] fix: remove light-test-utils from forester, fix actions --- Cargo.lock | 3 + forester-utils/Cargo.toml | 3 + .../instructions/compress_and_close_mint.rs | 118 ++++++++++++++++++ forester-utils/src/instructions/mod.rs | 3 + forester/Cargo.toml | 1 - forester/src/compressible/mint/compressor.rs | 65 +++++----- scripts/check-dependency-constraints.sh | 17 +++ sdk-libs/token-client/src/actions/unwrap.rs | 16 ++- sdk-libs/token-client/src/actions/wrap.rs | 16 ++- 9 files changed, 203 insertions(+), 39 deletions(-) create mode 100644 forester-utils/src/instructions/compress_and_close_mint.rs diff --git a/Cargo.lock b/Cargo.lock index b53dd361f8..2527e72705 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2364,11 +2364,14 @@ dependencies = [ "anchor-lang", "async-trait", "bb8", + "borsh 0.10.4", "governor 0.8.1", "light-account-checks", "light-batched-merkle-tree", "light-client", "light-compressed-account", + "light-compressed-token-sdk", + "light-compressible", "light-concurrent-merkle-tree", "light-hash-set", "light-hasher", diff --git a/forester-utils/Cargo.toml b/forester-utils/Cargo.toml index 72c92b7e64..b03aa100c3 100644 --- a/forester-utils/Cargo.toml +++ b/forester-utils/Cargo.toml @@ -28,6 +28,9 @@ light-prover-client = { workspace = true } light-registry = { workspace = true, features = ["cpi"] } account-compression = { workspace = true, features = ["cpi"] } light-token-interface = { workspace = true } +light-compressed-token-sdk = { workspace = true } +light-compressible = { workspace = true } +borsh = { workspace = true } solana-instruction = { workspace = true } solana-pubkey = { workspace = true } diff --git a/forester-utils/src/instructions/compress_and_close_mint.rs b/forester-utils/src/instructions/compress_and_close_mint.rs new file mode 100644 index 0000000000..4dcd3c2639 --- /dev/null +++ b/forester-utils/src/instructions/compress_and_close_mint.rs @@ -0,0 +1,118 @@ +use borsh::BorshDeserialize; +use light_client::{ + indexer::Indexer, + rpc::{Rpc, RpcError}, +}; +use light_compressed_account::instruction_data::traits::LightInstructionData; +use light_compressed_token_sdk::compressed_token::{ + create_compressed_mint::find_mint_address, mint_action::MintActionMetaConfig, +}; +use light_compressible::config::CompressibleConfig; +use light_token_interface::{ + instructions::mint_action::{ + CompressAndCloseMintAction, MintActionCompressedInstructionData, MintWithContext, + }, + state::Mint, + LIGHT_TOKEN_PROGRAM_ID, +}; +use solana_instruction::Instruction; +use solana_pubkey::Pubkey; + +/// Creates a CompressAndCloseMint instruction by fetching required data from RPC/indexer. +/// +/// This is permissionless - anyone can call when the mint is compressible (rent expired). +/// +/// # Parameters +/// - `rpc`: RPC client that also implements Indexer +/// - `payer`: Account paying for transaction fees +/// - `compressed_mint_address`: The 32-byte compressed address of the mint +/// - `mint_seed`: The seed pubkey used to derive the mint PDA +/// - `idempotent`: If true, succeed silently when Mint doesn't exist +pub async fn create_compress_and_close_mint_instruction( + rpc: &mut R, + payer: Pubkey, + compressed_mint_address: [u8; 32], + mint_seed: Pubkey, + idempotent: bool, +) -> Result { + // Derive the mint PDA from mint_seed + let (mint_pda, _bump) = find_mint_address(&mint_seed); + + // Get the compressed mint account + let compressed_mint_account = rpc + .get_compressed_account(compressed_mint_address, None) + .await? + .value + .ok_or_else(|| RpcError::AccountDoesNotExist(format!("{:?}", compressed_mint_address)))?; + + // Try to deserialize the compressed mint - may be None if Mint is already decompressed + let compressed_mint: Option = compressed_mint_account + .data + .as_ref() + .and_then(|d| BorshDeserialize::deserialize(&mut d.data.as_slice()).ok()); + + // Get validity proof for the compressed mint + let rpc_proof_result = rpc + .get_validity_proof(vec![compressed_mint_account.hash], vec![], None) + .await? + .value; + + // Build MintWithContext + let compressed_mint_inputs = MintWithContext { + prove_by_index: rpc_proof_result.accounts[0].root_index.proof_by_index(), + leaf_index: compressed_mint_account.leaf_index, + root_index: rpc_proof_result.accounts[0] + .root_index + .root_index() + .unwrap_or_default(), + address: compressed_mint_address, + mint: compressed_mint.map(|m| m.try_into().unwrap()), + }; + + // Build instruction data with CompressAndCloseMint action + let instruction_data = MintActionCompressedInstructionData::new( + compressed_mint_inputs, + rpc_proof_result.proof.into(), + ) + .with_compress_and_close_mint(CompressAndCloseMintAction { + idempotent: if idempotent { 1 } else { 0 }, + }); + + // Get CompressibleConfig for rent_sponsor + let config_address = CompressibleConfig::light_token_v1_config_pda(); + let compressible_config: CompressibleConfig = rpc + .get_anchor_account(&config_address) + .await? + .ok_or_else(|| { + RpcError::CustomError(format!( + "CompressibleConfig not found at {}", + config_address + )) + })?; + + // Build account metas configuration + let state_tree_info = rpc_proof_result.accounts[0].tree_info; + let config = MintActionMetaConfig::new( + payer, + payer, // authority - permissionless, using payer + state_tree_info.tree, + state_tree_info.queue, + state_tree_info.queue, + ) + .with_compressible_mint(mint_pda, config_address, compressible_config.rent_sponsor); + + // Get account metas + let account_metas = config.to_account_metas(); + + // Serialize instruction data + let data = instruction_data + .data() + .map_err(|e| RpcError::CustomError(format!("Failed to serialize instruction: {:?}", e)))?; + + // Build final instruction + Ok(Instruction { + program_id: LIGHT_TOKEN_PROGRAM_ID.into(), + accounts: account_metas, + data, + }) +} diff --git a/forester-utils/src/instructions/mod.rs b/forester-utils/src/instructions/mod.rs index 4173dcc027..493e2d3eca 100644 --- a/forester-utils/src/instructions/mod.rs +++ b/forester-utils/src/instructions/mod.rs @@ -3,4 +3,7 @@ pub mod create_account; pub use create_account::create_account_instruction; pub mod claim; +pub mod compress_and_close_mint; pub mod withdraw_funding_pool; + +pub use compress_and_close_mint::create_compress_and_close_mint_instruction; diff --git a/forester/Cargo.toml b/forester/Cargo.toml index c648a54156..5b23dc2855 100644 --- a/forester/Cargo.toml +++ b/forester/Cargo.toml @@ -31,7 +31,6 @@ light-compressible = { workspace = true, default-features = false, features = [" light-token-interface = { workspace = true } light-token-client = { workspace = true } light-token = { workspace = true } -light-test-utils = { workspace = true } light-compressed-token-sdk = { workspace = true } solana-rpc-client-api = { workspace = true } solana-transaction-status = { workspace = true } diff --git a/forester/src/compressible/mint/compressor.rs b/forester/src/compressible/mint/compressor.rs index db3d4bd6d2..1c2cd6e317 100644 --- a/forester/src/compressible/mint/compressor.rs +++ b/forester/src/compressible/mint/compressor.rs @@ -3,12 +3,11 @@ use std::sync::{ Arc, }; -use forester_utils::rpc_pool::SolanaRpcPool; +use forester_utils::{ + instructions::create_compress_and_close_mint_instruction, rpc_pool::SolanaRpcPool, +}; use futures::StreamExt; use light_client::{indexer::Indexer, rpc::Rpc}; -use light_test_utils::actions::legacy::instructions::mint_action::{ - create_mint_action_instruction, MintActionParams, MintActionType, -}; use solana_sdk::{ instruction::Instruction, signature::{Keypair, Signature}, @@ -71,24 +70,21 @@ impl MintCompressor { async move { let mut rpc = rpc_pool.get_connection().await?; - let params = MintActionParams { - compressed_mint_address: compressed_address, - mint_seed, - authority: payer, + let ix = create_compress_and_close_mint_instruction( + &mut *rpc, payer, - actions: vec![MintActionType::CompressAndCloseMint { idempotent: true }], - new_mint: None, - }; - - let ix = create_mint_action_instruction(&mut *rpc, params) - .await - .map_err(|e| { - anyhow::anyhow!( - "Failed to build CompressAndCloseMint instruction for {}: {:?}", - mint_pda, - e - ) - })?; + compressed_address, + mint_seed, + true, // idempotent + ) + .await + .map_err(|e| { + anyhow::anyhow!( + "Failed to build CompressAndCloseMint instruction for {}: {:?}", + mint_pda, + e + ) + })?; Ok::(ix) } @@ -219,22 +215,19 @@ impl MintCompressor { let mut rpc = self.rpc_pool.get_connection().await?; - // Build the CompressAndCloseMint instruction using the mint action builder + // Build the CompressAndCloseMint instruction // This is idempotent - succeeds silently if mint doesn't exist or is already compressed - let params = MintActionParams { - compressed_mint_address: compressed_address, - mint_seed: *mint_seed, - authority: self.payer_keypair.pubkey(), - payer: self.payer_keypair.pubkey(), - actions: vec![MintActionType::CompressAndCloseMint { idempotent: true }], - new_mint: None, - }; - - let ix = create_mint_action_instruction(&mut *rpc, params) - .await - .map_err(|e| { - anyhow::anyhow!("Failed to build CompressAndCloseMint instruction: {:?}", e) - })?; + let ix = create_compress_and_close_mint_instruction( + &mut *rpc, + self.payer_keypair.pubkey(), + compressed_address, + *mint_seed, + true, // idempotent + ) + .await + .map_err(|e| { + anyhow::anyhow!("Failed to build CompressAndCloseMint instruction: {:?}", e) + })?; debug!( "Built CompressAndCloseMint instruction for Mint {}", diff --git a/scripts/check-dependency-constraints.sh b/scripts/check-dependency-constraints.sh index 1238aea38d..303b18e666 100755 --- a/scripts/check-dependency-constraints.sh +++ b/scripts/check-dependency-constraints.sh @@ -90,4 +90,21 @@ if [ "$CONSTRAINT_FAILED" -eq 1 ]; then exit 1 fi +# Check that no crates have light-test-utils as a regular dependency +# (dev-dependencies are allowed, --edges normal excludes them) +# Excludes: program-tests/*, sdk-tests/*, xtask (these are test/build crates) +echo "" +echo "Checking that no crates depend on light-test-utils (dev-deps allowed)..." + +# Use inverse lookup to find what depends on light-test-utils +# Skip the first line (light-test-utils itself) and filter out test crates +dependents=$(cargo tree --workspace --edges normal -i light-test-utils 2>/dev/null | tail -n +2 | grep -v "program-tests/" | grep -v "sdk-tests/" | grep -v "xtask" || true) +if [ -n "$dependents" ]; then + echo "ERROR: Found crates with light-test-utils as a regular dependency:" + echo "$dependents" + echo "" + echo "FAILED: light-test-utils should only be used as a dev-dependency." + exit 1 +fi + echo "All dependency constraints satisfied." diff --git a/sdk-libs/token-client/src/actions/unwrap.rs b/sdk-libs/token-client/src/actions/unwrap.rs index db92a315a8..1ac030c075 100644 --- a/sdk-libs/token-client/src/actions/unwrap.rs +++ b/sdk-libs/token-client/src/actions/unwrap.rs @@ -4,7 +4,7 @@ use light_client::rpc::{Rpc, RpcError}; use light_token::{ - constants::SPL_TOKEN_2022_PROGRAM_ID, + constants::{SPL_TOKEN_2022_PROGRAM_ID, SPL_TOKEN_PROGRAM_ID}, instruction::TransferToSpl, spl_interface::{find_spl_interface_pda, has_restricted_extensions}, }; @@ -67,6 +67,20 @@ impl Unwrap { let spl_token_program = destination_account_info.owner; + // Validate that the destination account is owned by a supported SPL token program + if spl_token_program != SPL_TOKEN_PROGRAM_ID + && spl_token_program != SPL_TOKEN_2022_PROGRAM_ID + { + return Err(RpcError::CustomError(format!( + "Destination SPL token account {} is owned by an unsupported program {}. \ + Expected SPL Token ({}) or Token-2022 ({}).", + self.destination_spl_ata, + destination_account_info.owner, + SPL_TOKEN_PROGRAM_ID, + SPL_TOKEN_2022_PROGRAM_ID + ))); + } + // Check for restricted extensions if using Token-2022 let restricted = if spl_token_program == SPL_TOKEN_2022_PROGRAM_ID { let mint_account = rpc diff --git a/sdk-libs/token-client/src/actions/wrap.rs b/sdk-libs/token-client/src/actions/wrap.rs index 200076958a..17a058f895 100644 --- a/sdk-libs/token-client/src/actions/wrap.rs +++ b/sdk-libs/token-client/src/actions/wrap.rs @@ -4,7 +4,7 @@ use light_client::rpc::{Rpc, RpcError}; use light_token::{ - constants::SPL_TOKEN_2022_PROGRAM_ID, + constants::{SPL_TOKEN_2022_PROGRAM_ID, SPL_TOKEN_PROGRAM_ID}, instruction::TransferFromSpl, spl_interface::{find_spl_interface_pda, has_restricted_extensions}, }; @@ -65,6 +65,20 @@ impl Wrap { let spl_token_program = source_account_info.owner; + // Validate that the source account is owned by a supported SPL token program + if spl_token_program != SPL_TOKEN_PROGRAM_ID + && spl_token_program != SPL_TOKEN_2022_PROGRAM_ID + { + return Err(RpcError::CustomError(format!( + "Source SPL token account {} is owned by an unsupported program {}. \ + Expected SPL Token ({}) or Token-2022 ({}).", + self.source_spl_ata, + source_account_info.owner, + SPL_TOKEN_PROGRAM_ID, + SPL_TOKEN_2022_PROGRAM_ID + ))); + } + // Check for restricted extensions if using Token-2022 let restricted = if spl_token_program == SPL_TOKEN_2022_PROGRAM_ID { let mint_account = rpc From d07db073054ec3a9bf1b6f47f341db62372bd1b4 Mon Sep 17 00:00:00 2001 From: ananas Date: Sat, 24 Jan 2026 20:12:15 +0000 Subject: [PATCH 4/7] chore: remove new ata named functions --- .../token-client/src/actions/create_ata.rs | 32 ++----------------- sdk-libs/token-client/src/actions/mod.rs | 6 +++- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/sdk-libs/token-client/src/actions/create_ata.rs b/sdk-libs/token-client/src/actions/create_ata.rs index 8d5838cf10..57ab4e0bb2 100644 --- a/sdk-libs/token-client/src/actions/create_ata.rs +++ b/sdk-libs/token-client/src/actions/create_ata.rs @@ -3,9 +3,7 @@ //! These actions provide clean interfaces for creating Light Token ATAs. use light_client::rpc::{Rpc, RpcError}; -use light_token::instruction::{ - derive_associated_token_account, get_associated_token_address, CreateAssociatedTokenAccount, -}; +use light_token::instruction::{get_associated_token_address, CreateAssociatedTokenAccount}; use solana_keypair::Keypair; use solana_pubkey::Pubkey; use solana_signature::Signature; @@ -68,32 +66,6 @@ impl CreateAta { .create_and_send_transaction(&[ix], &payer.pubkey(), &[payer]) .await?; - Ok((signature, get_ata_address(&self.mint, &self.owner))) + Ok((signature, get_associated_token_address(&self.owner, &self.mint))) } } - -/// Get the associated token address for a given owner and mint. -/// -/// This is a pure function that computes the ATA address without any RPC calls. -/// -/// # Arguments -/// * `mint` - The mint public key -/// * `owner` - The owner public key -/// -/// # Returns -/// `Pubkey` - The ATA address -pub fn get_ata_address(mint: &Pubkey, owner: &Pubkey) -> Pubkey { - get_associated_token_address(owner, mint) -} - -/// Derive the associated token address with bump seed. -/// -/// # Arguments -/// * `mint` - The mint public key -/// * `owner` - The owner public key -/// -/// # Returns -/// `(Pubkey, u8)` - The ATA address and bump seed -pub fn derive_ata_address(mint: &Pubkey, owner: &Pubkey) -> (Pubkey, u8) { - derive_associated_token_account(owner, mint) -} diff --git a/sdk-libs/token-client/src/actions/mod.rs b/sdk-libs/token-client/src/actions/mod.rs index 7b902fb8f8..c4ba800d60 100644 --- a/sdk-libs/token-client/src/actions/mod.rs +++ b/sdk-libs/token-client/src/actions/mod.rs @@ -25,7 +25,11 @@ pub mod wrap; // Re-export all action structs pub use approve::Approve; -pub use create_ata::{derive_ata_address, get_ata_address, CreateAta}; +pub use create_ata::CreateAta; +pub use light_token::instruction::{ + derive_associated_token_account, get_associated_token_address, + get_associated_token_address_and_bump, +}; pub use create_mint::{CreateMint, TokenMetadata}; pub use mint_to::MintTo; pub use revoke::Revoke; From 4ac111f46f4c900a52b8a16b129238854a16e214 Mon Sep 17 00:00:00 2001 From: ananas Date: Tue, 27 Jan 2026 01:24:31 +0000 Subject: [PATCH 5/7] fmt --- sdk-libs/token-client/src/actions/create_ata.rs | 5 ++++- sdk-libs/token-client/src/actions/mod.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk-libs/token-client/src/actions/create_ata.rs b/sdk-libs/token-client/src/actions/create_ata.rs index 57ab4e0bb2..fbffe29650 100644 --- a/sdk-libs/token-client/src/actions/create_ata.rs +++ b/sdk-libs/token-client/src/actions/create_ata.rs @@ -66,6 +66,9 @@ impl CreateAta { .create_and_send_transaction(&[ix], &payer.pubkey(), &[payer]) .await?; - Ok((signature, get_associated_token_address(&self.owner, &self.mint))) + Ok(( + signature, + get_associated_token_address(&self.owner, &self.mint), + )) } } diff --git a/sdk-libs/token-client/src/actions/mod.rs b/sdk-libs/token-client/src/actions/mod.rs index c4ba800d60..448bc0d459 100644 --- a/sdk-libs/token-client/src/actions/mod.rs +++ b/sdk-libs/token-client/src/actions/mod.rs @@ -26,11 +26,11 @@ pub mod wrap; // Re-export all action structs pub use approve::Approve; pub use create_ata::CreateAta; +pub use create_mint::{CreateMint, TokenMetadata}; pub use light_token::instruction::{ derive_associated_token_account, get_associated_token_address, get_associated_token_address_and_bump, }; -pub use create_mint::{CreateMint, TokenMetadata}; pub use mint_to::MintTo; pub use revoke::Revoke; pub use transfer::Transfer; From ec9f0dcb97bfcbc45f39982ee35f88c7820a54c6 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Wed, 28 Jan 2026 23:42:34 +0000 Subject: [PATCH 6/7] add token client doc --- Cargo.lock | 751 +++++++++--------- sdk-libs/token-client/CLAUDE.md | 65 ++ .../target/idl/sdk_anchor_test.json | 726 ----------------- .../target/types/sdk_anchor_test.ts | 732 ----------------- 4 files changed, 448 insertions(+), 1826 deletions(-) create mode 100644 sdk-libs/token-client/CLAUDE.md delete mode 100644 sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json delete mode 100644 sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts diff --git a/Cargo.lock b/Cargo.lock index 2527e72705..0e4ea85402 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,7 +188,7 @@ version = "1.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -620,7 +620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -646,7 +646,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -721,7 +721,7 @@ checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -827,22 +827,21 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.36" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ec5f6c2f8bc326c994cb9e241cc257ddaba9afa8555a43cffbb5dd86efaa37" +checksum = "d10e4f991a553474232bc0a31799f6d24b034a84c0971d80d2e2f78b2e576e40" dependencies = [ "compression-codecs", "compression-core", - "futures-core", "pin-project-lite", "tokio", ] [[package]] name = "async-lock" -version = "3.4.1" +version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" dependencies = [ "event-listener 5.4.1", "event-listener-strategy", @@ -857,7 +856,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -977,15 +976,16 @@ dependencies = [ [[package]] name = "blake3" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", + "cpufeatures", "digest 0.10.7", ] @@ -1050,7 +1050,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1144,7 +1144,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1183,9 +1183,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.49" +version = "1.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" +checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583" dependencies = [ "find-msvc-tools", "jobserver", @@ -1219,14 +1219,14 @@ checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "chrono" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ "iana-time-zone", "js-sys", @@ -1263,9 +1263,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.53" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +checksum = "3e34525d5bbbd55da2bb745d34b36121baac88d07619a9a09cfcf4a6c0832785" dependencies = [ "clap_builder", "clap_derive", @@ -1273,9 +1273,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.53" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +checksum = "59a20016a20a3da95bef50ec7238dbd09baeef4311dcdd38ec15aba69812fb61" dependencies = [ "anstream", "anstyle", @@ -1285,21 +1285,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.49" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "clap_lex" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "client-test" @@ -1415,9 +1415,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.35" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f7ac3e5b97fdce45e8922fb05cae2c37f7bbd63d30dd94821dacfd8f3f2bf2" +checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" dependencies = [ "brotli", "compression-core", @@ -1475,9 +1475,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" [[package]] name = "core-foundation" @@ -1703,7 +1703,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1727,7 +1727,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1738,7 +1738,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1770,9 +1770,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" +checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" [[package]] name = "der-parser" @@ -1897,7 +1897,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1920,7 +1920,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2012,7 +2012,7 @@ dependencies = [ "enum-ordinalize 4.3.2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2053,7 +2053,7 @@ checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2066,7 +2066,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2086,7 +2086,7 @@ checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2170,14 +2170,14 @@ dependencies = [ [[package]] name = "fastbloom" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c1ddb9231d8554c2d6bdf4cfaabf0c59251658c68b6c95cd52dd0c513a912a" +checksum = "4e7f34442dbe69c60fe8eaf58a8cafff81a1f278816d8ab4db255b3bef4ac3c4" dependencies = [ "getrandom 0.3.4", "libm", "rand 0.9.2", - "siphasher 1.0.1", + "siphasher 1.0.2", ] [[package]] @@ -2200,9 +2200,9 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "find-msvc-tools" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" +checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" [[package]] name = "five8" @@ -2254,9 +2254,9 @@ checksum = "059c31d7d36c43fe39d89e55711858b4da8be7eb6dabac23c7289b1a19489406" [[package]] name = "flate2" -version = "1.1.5" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" +checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" dependencies = [ "crc32fast", "miniz_oxide", @@ -2302,7 +2302,7 @@ dependencies = [ "bb8", "borsh 0.10.4", "bs58", - "clap 4.5.53", + "clap 4.5.55", "create-address-test-program", "csdk-anchor-full-derived-test", "dashmap 6.1.0", @@ -2335,7 +2335,7 @@ dependencies = [ "photon-api", "prometheus", "rand 0.8.5", - "reqwest 0.12.26", + "reqwest 0.12.28", "scopeguard", "serde", "serde_json", @@ -2348,7 +2348,7 @@ dependencies = [ "solana-rpc-client-api", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tracing", "tracing-appender", @@ -2386,7 +2386,7 @@ dependencies = [ "solana-instruction", "solana-pubkey 2.4.0", "solana-sdk", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tracing", ] @@ -2462,7 +2462,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2536,9 +2536,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "js-sys", @@ -2637,18 +2637,18 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.12.1", + "indexmap 2.13.0", "slab", "tokio", - "tokio-util 0.7.17", + "tokio-util 0.7.18", "tracing", ] [[package]] name = "h2" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", "bytes", @@ -2656,10 +2656,10 @@ dependencies = [ "futures-core", "futures-sink", "http 1.4.0", - "indexmap 2.12.1", + "indexmap 2.13.0", "slab", "tokio", - "tokio-util 0.7.17", + "tokio-util 0.7.18", "tracing", ] @@ -2772,9 +2772,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hidapi" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b876ecf37e86b359573c16c8366bc3eba52b689884a0fc42ba3f67203d2a8b" +checksum = "565dd4c730b8f8b2c0fb36df6be12e5470ae10895ddcc4e9dcfbfb495de202b0" dependencies = [ "cc", "cfg-if", @@ -2926,7 +2926,7 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "h2 0.4.12", + "h2 0.4.13", "http 1.4.0", "http-body 1.0.1", "httparse", @@ -2962,12 +2962,12 @@ dependencies = [ "http 1.4.0", "hyper 1.8.1", "hyper-util", - "rustls 0.23.35", + "rustls 0.23.36", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.4", + "webpki-roots 1.0.5", ] [[package]] @@ -3017,7 +3017,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.1", + "socket2 0.6.2", "system-configuration 0.6.1", "tokio", "tower-service", @@ -3027,9 +3027,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.64" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3170,9 +3170,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -3210,9 +3210,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" dependencies = [ "memchr", "serde", @@ -3262,15 +3262,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jiff" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" +checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50" dependencies = [ "jiff-static", "log", @@ -3281,13 +3281,13 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" +checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3324,9 +3324,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -3374,21 +3374,21 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.178" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libm" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df15f6eac291ed1cf25865b1ee60399f57e7c227e7f51bdbd4c5270396a9ed50" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ "bitflags 2.10.0", "libc", @@ -3454,7 +3454,7 @@ dependencies = [ "solana-program-error 2.2.2", "solana-pubkey 2.4.0", "solana-sysvar", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3503,7 +3503,7 @@ dependencies = [ "solana-program-error 2.2.2", "solana-pubkey 2.4.0", "solana-sysvar", - "thiserror 2.0.17", + "thiserror 2.0.18", "zerocopy", ] @@ -3518,7 +3518,7 @@ dependencies = [ "rand 0.8.5", "solana-nostd-keccak", "solana-program-error 2.2.2", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3582,7 +3582,7 @@ dependencies = [ "solana-transaction-status-client-types", "spl-pod", "spl-token-2022-interface", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tracing", ] @@ -3608,7 +3608,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "solana-pubkey 2.4.0", - "thiserror 2.0.17", + "thiserror 2.0.18", "tinyvec", "zerocopy", ] @@ -3671,7 +3671,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "solana-pubkey 2.4.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3697,7 +3697,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-rent", "solana-sysvar", - "thiserror 2.0.17", + "thiserror 2.0.18", "zerocopy", ] @@ -3718,7 +3718,7 @@ dependencies = [ "pinocchio", "rand 0.8.5", "solana-program-error 2.2.2", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] @@ -3731,7 +3731,7 @@ dependencies = [ "light-hasher", "light-zero-copy", "rand 0.8.5", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3745,7 +3745,7 @@ dependencies = [ "num-traits", "rand 0.8.5", "solana-program-error 2.2.2", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3763,7 +3763,7 @@ dependencies = [ "sha3", "solana-program-error 2.2.2", "solana-pubkey 2.4.0", - "thiserror 2.0.17", + "thiserror 2.0.18", "tinyvec", "zerocopy", ] @@ -3783,7 +3783,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3800,7 +3800,7 @@ dependencies = [ "pinocchio", "rand 0.8.5", "solana-program-error 2.2.2", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3830,7 +3830,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3841,7 +3841,7 @@ dependencies = [ "proc-macro2", "quote", "solana-pubkey 2.4.0", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3856,7 +3856,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "solana-sysvar", - "thiserror 2.0.17", + "thiserror 2.0.18", "zerocopy", ] @@ -3869,7 +3869,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -3904,7 +3904,7 @@ checksum = "0a8be18fe4de58a6f754caa74a3fbc6d8a758a26f1f3c24d5b0f5b55df5f5408" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3955,7 +3955,7 @@ dependencies = [ "num-traits", "photon-api", "rand 0.8.5", - "reqwest 0.12.26", + "reqwest 0.12.28", "serde", "serde_json", "solana-account", @@ -3994,7 +3994,7 @@ dependencies = [ "serde_json", "serial_test", "solana-bn254", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tracing", ] @@ -4053,7 +4053,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-system-interface 1.0.0", "solana-sysvar", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4072,7 +4072,7 @@ dependencies = [ "proc-macro2", "quote", "solana-pubkey 2.4.0", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4088,7 +4088,7 @@ dependencies = [ "light-sdk-macros", "light-sdk-types", "pinocchio", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4103,7 +4103,7 @@ dependencies = [ "light-macros", "solana-msg 2.2.1", "solana-pubkey 2.4.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4116,7 +4116,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4157,7 +4157,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-pubkey 2.4.0", "solana-security-txt", - "thiserror 2.0.17", + "thiserror 2.0.18", "zerocopy", ] @@ -4201,7 +4201,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "reqwest 0.12.26", + "reqwest 0.12.28", "solana-banks-client", "solana-instruction", "solana-keypair", @@ -4214,7 +4214,7 @@ dependencies = [ "spl-pod", "spl-token 7.0.0", "spl-token-2022 7.0.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4246,7 +4246,7 @@ dependencies = [ "solana-program-error 2.2.2", "solana-pubkey 2.4.0", "spl-pod", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4304,7 +4304,7 @@ dependencies = [ "spl-pod", "spl-token-2022 7.0.0", "spl-token-metadata-interface 0.6.0", - "thiserror 2.0.17", + "thiserror 2.0.18", "tinyvec", "zerocopy", ] @@ -4320,7 +4320,7 @@ dependencies = [ "light-macros", "light-sdk-types", "solana-msg 2.2.1", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4332,7 +4332,7 @@ dependencies = [ "pinocchio", "solana-msg 2.2.1", "solana-program-error 2.2.2", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4356,7 +4356,7 @@ dependencies = [ "proc-macro2", "quote", "rand 0.8.5", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4382,7 +4382,7 @@ dependencies = [ "agave-reserved-account-keys", "ansi_term", "bincode", - "indexmap 2.12.1", + "indexmap 2.13.0", "itertools 0.14.0", "log", "solana-account", @@ -4431,7 +4431,7 @@ dependencies = [ "solana-transaction-context", "solana-transaction-error", "solana-vote-program", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -4565,7 +4565,7 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.6", "openssl-sys", "schannel", "security-framework 2.11.1", @@ -4666,9 +4666,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" [[package]] name = "num-derive" @@ -4689,7 +4689,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4762,7 +4762,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4821,7 +4821,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4830,11 +4830,17 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + [[package]] name = "openssl-src" -version = "300.5.4+3.5.4" +version = "300.5.5+3.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507b3792995dae9b0df8a1c1e3771e8418b7c2d9f0baeba32e6fe8b06c7cb72" +checksum = "3f1787d533e03597a7934fd0a765f0d28e94ecc5fb7789f8053b1e699a56f709" dependencies = [ "cc", ] @@ -4969,7 +4975,7 @@ dependencies = [ name = "photon-api" version = "0.54.0" dependencies = [ - "reqwest 0.12.26", + "reqwest 0.12.28", "serde", "serde_derive", "serde_json", @@ -4995,7 +5001,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5099,9 +5105,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" [[package]] name = "portable-atomic-util" @@ -5149,7 +5155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5189,14 +5195,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -5213,7 +5219,7 @@ dependencies = [ "memchr", "parking_lot", "protobuf", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -5253,7 +5259,7 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5283,9 +5289,9 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.1.1", - "rustls 0.23.35", - "socket2 0.6.1", - "thiserror 2.0.17", + "rustls 0.23.36", + "socket2 0.6.2", + "thiserror 2.0.18", "tokio", "tracing", "web-time", @@ -5304,11 +5310,11 @@ dependencies = [ "rand 0.9.2", "ring", "rustc-hash 2.1.1", - "rustls 0.23.35", + "rustls 0.23.36", "rustls-pki-types", "rustls-platform-verifier", "slab", - "thiserror 2.0.17", + "thiserror 2.0.18", "tinyvec", "tracing", "web-time", @@ -5323,16 +5329,16 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.1", + "socket2 0.6.2", "tracing", "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.42" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] @@ -5380,7 +5386,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -5410,7 +5416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -5428,14 +5434,14 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", ] [[package]] name = "rand_core" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ "getrandom 0.3.4", ] @@ -5493,7 +5499,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", "libredox", "thiserror 1.0.69", ] @@ -5504,9 +5510,9 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", "libredox", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -5526,7 +5532,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5633,9 +5639,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.26" +version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ "base64 0.22.1", "bytes", @@ -5643,7 +5649,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.12", + "h2 0.4.13", "http 1.4.0", "http-body 1.0.1", "http-body-util", @@ -5659,7 +5665,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.35", + "rustls 0.23.36", "rustls-pki-types", "serde", "serde_json", @@ -5675,7 +5681,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.4", + "webpki-roots 1.0.5", ] [[package]] @@ -5687,7 +5693,7 @@ dependencies = [ "anyhow", "async-trait", "http 1.4.0", - "reqwest 0.12.26", + "reqwest 0.12.28", "serde", "thiserror 1.0.69", "tower-service", @@ -5701,7 +5707,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.16", + "getrandom 0.2.17", "libc", "untrusted", "windows-sys 0.52.0", @@ -5730,9 +5736,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" [[package]] name = "rustc-hash" @@ -5766,9 +5772,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ "bitflags 2.10.0", "errno", @@ -5791,25 +5797,25 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.35" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.8", + "rustls-webpki 0.103.9", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9980d917ebb0c0536119ba501e90834767bffc3d60641457fd84a1f3fd337923" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ - "openssl-probe", + "openssl-probe 0.2.1", "rustls-pki-types", "schannel", "security-framework 3.5.1", @@ -5826,9 +5832,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "web-time", "zeroize", @@ -5845,10 +5851,10 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.35", + "rustls 0.23.36", "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.103.8", + "rustls-webpki 0.103.9", "security-framework 3.5.1", "security-framework-sys", "webpki-root-certs", @@ -5873,9 +5879,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.8" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -5890,9 +5896,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "same-file" @@ -5935,9 +5941,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" +checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2" dependencies = [ "dyn-clone", "ref-cast", @@ -6205,20 +6211,20 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "serde_json" -version = "1.0.145" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] [[package]] @@ -6261,9 +6267,9 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.12.1", + "indexmap 2.13.0", "schemars 0.9.0", - "schemars 1.1.0", + "schemars 1.2.0", "serde_core", "serde_json", "serde_with_macros", @@ -6279,7 +6285,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6288,7 +6294,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.12.1", + "indexmap 2.13.0", "itoa", "ryu", "serde", @@ -6297,11 +6303,12 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.2.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9" +checksum = "0d0b343e184fc3b7bb44dff0705fffcf4b3756ba6aff420dddd8b24ca145e555" dependencies = [ - "futures", + "futures-executor", + "futures-util", "log", "once_cell", "parking_lot", @@ -6311,13 +6318,13 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "3.2.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" +checksum = "6f50427f258fb77356e4cd4aa0e87e2bd2c66dbcee41dc405282cae2bfc26c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6404,10 +6411,11 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.7" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] @@ -6559,9 +6567,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "siphasher" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" +checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" [[package]] name = "slab" @@ -6587,9 +6595,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" dependencies = [ "libc", "windows-sys 0.60.2", @@ -6652,7 +6660,7 @@ dependencies = [ "spl-token-2022 8.0.1", "spl-token-group-interface 0.6.0", "spl-token-metadata-interface 0.7.0", - "thiserror 2.0.17", + "thiserror 2.0.18", "zstd", ] @@ -6767,7 +6775,7 @@ dependencies = [ "solana-transaction-context", "solana-transaction-error", "tarpc", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tokio-serde", ] @@ -6839,7 +6847,7 @@ dependencies = [ "ark-serialize 0.4.2", "bytemuck", "solana-define-syscall 2.3.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -6895,7 +6903,7 @@ dependencies = [ "solana-timings", "solana-transaction-context", "solana-type-overrides", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -6961,7 +6969,7 @@ dependencies = [ "solana-seed-phrase", "solana-signature", "solana-signer", - "thiserror 2.0.17", + "thiserror 2.0.18", "tiny-bip39", "uriparse", "url", @@ -7036,7 +7044,7 @@ dependencies = [ "dashmap 5.5.3", "futures", "futures-util", - "indexmap 2.12.1", + "indexmap 2.13.0", "indicatif", "log", "quinn", @@ -7067,7 +7075,7 @@ dependencies = [ "solana-transaction", "solana-transaction-error", "solana-udp-client", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] @@ -7154,7 +7162,7 @@ dependencies = [ "solana-sdk-ids", "solana-svm-transaction", "solana-transaction-error", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -7202,7 +7210,7 @@ dependencies = [ "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.12.1", + "indexmap 2.13.0", "log", "rand 0.8.5", "rayon", @@ -7211,7 +7219,7 @@ dependencies = [ "solana-metrics", "solana-time-utils", "solana-transaction-error", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] @@ -7240,7 +7248,7 @@ dependencies = [ "curve25519-dalek 4.1.3", "solana-define-syscall 2.3.0", "subtle", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -7367,7 +7375,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-sdk-ids", "solana-system-interface 1.0.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -7519,7 +7527,7 @@ checksum = "bab5682934bd1f65f8d2c16f21cb532526fcc1a09f796e2cacdb091eee5774ad" dependencies = [ "bincode", "borsh 1.6.0", - "getrandom 0.2.16", + "getrandom 0.2.17", "js-sys", "num-traits", "serde", @@ -7720,11 +7728,11 @@ dependencies = [ "crossbeam-channel", "gethostname", "log", - "reqwest 0.12.26", + "reqwest 0.12.28", "solana-cluster-type", "solana-sha256-hasher 2.3.0", "solana-time-utils", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -7894,7 +7902,7 @@ dependencies = [ "ark-bn254 0.4.0", "light-poseidon 0.2.0", "solana-define-syscall 2.3.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -7949,7 +7957,7 @@ dependencies = [ "bytemuck", "console_error_panic_hook", "console_log", - "getrandom 0.2.16", + "getrandom 0.2.17", "lazy_static", "log", "memoffset", @@ -8011,7 +8019,7 @@ dependencies = [ "solana-sysvar", "solana-sysvar-id", "solana-vote-interface", - "thiserror 2.0.17", + "thiserror 2.0.18", "wasm-bindgen", ] @@ -8114,7 +8122,7 @@ dependencies = [ "solana-timings", "solana-transaction-context", "solana-type-overrides", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -8130,7 +8138,7 @@ dependencies = [ "curve25519-dalek 4.1.3", "five8 0.2.1", "five8_const 0.1.4", - "getrandom 0.2.16", + "getrandom 0.2.17", "js-sys", "num-traits", "rand 0.8.5", @@ -8172,7 +8180,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-rpc-client-types", "solana-signature", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tokio-stream", "tokio-tungstenite", @@ -8193,7 +8201,7 @@ dependencies = [ "log", "quinn", "quinn-proto", - "rustls 0.23.35", + "rustls 0.23.36", "solana-connection-cache", "solana-keypair", "solana-measure", @@ -8206,7 +8214,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "solana-transaction-error", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] @@ -8248,7 +8256,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-signature", "solana-signer", - "thiserror 2.0.17", + "thiserror 2.0.18", "uriparse", ] @@ -8327,7 +8335,7 @@ dependencies = [ "futures", "indicatif", "log", - "reqwest 0.12.26", + "reqwest 0.12.28", "reqwest-middleware", "semver", "serde", @@ -8362,7 +8370,7 @@ checksum = "2dbc138685c79d88a766a8fd825057a74ea7a21e1dd7f8de275ada899540fff7" dependencies = [ "anyhow", "jsonrpc-core", - "reqwest 0.12.26", + "reqwest 0.12.28", "reqwest-middleware", "serde", "serde_derive", @@ -8373,7 +8381,7 @@ dependencies = [ "solana-signer", "solana-transaction-error", "solana-transaction-status-client-types", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -8390,7 +8398,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-rpc-client", "solana-sdk-ids", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -8416,7 +8424,7 @@ dependencies = [ "solana-transaction-status-client-types", "solana-version", "spl-generic-token", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -8444,7 +8452,7 @@ dependencies = [ "log", "rand 0.8.5", "rustc-demangle", - "thiserror 2.0.17", + "thiserror 2.0.18", "winapi", ] @@ -8515,7 +8523,7 @@ dependencies = [ "solana-transaction-context", "solana-transaction-error", "solana-validator-exit", - "thiserror 2.0.17", + "thiserror 2.0.18", "wasm-bindgen", ] @@ -8537,7 +8545,7 @@ dependencies = [ "bs58", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -8568,7 +8576,7 @@ dependencies = [ "borsh 1.6.0", "libsecp256k1", "solana-define-syscall 2.3.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -8811,7 +8819,7 @@ dependencies = [ "futures-util", "governor 0.6.3", "histogram", - "indexmap 2.12.1", + "indexmap 2.13.0", "itertools 0.12.1", "libc", "log", @@ -8821,7 +8829,7 @@ dependencies = [ "quinn", "quinn-proto", "rand 0.8.5", - "rustls 0.23.35", + "rustls 0.23.36", "smallvec", "socket2 0.5.10", "solana-keypair", @@ -8838,9 +8846,9 @@ dependencies = [ "solana-tls-utils", "solana-transaction-error", "solana-transaction-metrics-tracker", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", - "tokio-util 0.7.17", + "tokio-util 0.7.18", "x509-parser", ] @@ -9044,7 +9052,7 @@ version = "2.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14494aa87a75a883d1abcfee00f1278a28ecc594a2f030084879eb40570728f6" dependencies = [ - "rustls 0.23.35", + "rustls 0.23.36", "solana-keypair", "solana-pubkey 2.4.0", "solana-signer", @@ -9060,7 +9068,7 @@ dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.12.1", + "indexmap 2.13.0", "indicatif", "log", "rayon", @@ -9081,7 +9089,7 @@ dependencies = [ "solana-signer", "solana-transaction", "solana-transaction-error", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] @@ -9198,7 +9206,7 @@ dependencies = [ "spl-token-2022 8.0.1", "spl-token-group-interface 0.6.0", "spl-token-metadata-interface 0.7.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9221,7 +9229,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9245,7 +9253,7 @@ dependencies = [ "solana-net-utils", "solana-streamer", "solana-transaction-error", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", ] @@ -9325,7 +9333,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-vote-interface", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9376,7 +9384,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.17", + "thiserror 2.0.18", "wasm-bindgen", "zeroize", ] @@ -9429,7 +9437,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.17", + "thiserror 2.0.18", "zeroize", ] @@ -9471,7 +9479,7 @@ dependencies = [ "spl-associated-token-account-client", "spl-token 8.0.0", "spl-token-2022 8.0.1", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9504,7 +9512,7 @@ checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -9516,7 +9524,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.111", + "syn 2.0.114", "thiserror 1.0.69", ] @@ -9597,7 +9605,7 @@ dependencies = [ "solana-program-option", "solana-pubkey 2.4.0", "solana-zk-sdk", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9625,7 +9633,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "spl-program-error-derive 0.5.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9637,7 +9645,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -9649,7 +9657,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -9693,7 +9701,7 @@ dependencies = [ "spl-pod", "spl-program-error 0.7.0", "spl-type-length-value 0.8.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9736,7 +9744,7 @@ dependencies = [ "solana-rent", "solana-sdk-ids", "solana-sysvar", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9792,7 +9800,7 @@ dependencies = [ "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", + "thiserror 2.0.18", ] [[package]] @@ -9836,7 +9844,7 @@ dependencies = [ "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", + "thiserror 2.0.18", ] [[package]] @@ -9866,7 +9874,7 @@ dependencies = [ "spl-token-group-interface 0.6.0", "spl-token-metadata-interface 0.7.0", "spl-type-length-value 0.8.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9904,7 +9912,7 @@ dependencies = [ "solana-program", "solana-zk-sdk", "spl-pod", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9924,7 +9932,7 @@ dependencies = [ "solana-sdk-ids", "solana-zk-sdk", "spl-pod", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9944,7 +9952,7 @@ dependencies = [ "solana-sdk-ids", "solana-zk-sdk", "spl-pod", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9966,7 +9974,7 @@ checksum = "0e3597628b0d2fe94e7900fd17cdb4cfbb31ee35c66f82809d27d86e44b2848b" dependencies = [ "curve25519-dalek 4.1.3", "solana-zk-sdk", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -9977,7 +9985,7 @@ checksum = "fa27b9174bea869a7ebf31e0be6890bce90b1a4288bc2bbf24bd413f80ae3fde" dependencies = [ "curve25519-dalek 4.1.3", "solana-zk-sdk", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -10015,7 +10023,7 @@ dependencies = [ "solana-pubkey 2.4.0", "spl-discriminator", "spl-pod", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -10057,7 +10065,7 @@ dependencies = [ "spl-discriminator", "spl-pod", "spl-type-length-value 0.8.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -10107,7 +10115,7 @@ dependencies = [ "spl-program-error 0.7.0", "spl-tlv-account-resolution 0.10.0", "spl-type-length-value 0.8.0", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -10143,7 +10151,7 @@ dependencies = [ "solana-program-error 2.2.2", "spl-discriminator", "spl-pod", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -10189,9 +10197,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.111" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -10233,7 +10241,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -10390,7 +10398,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -10442,9 +10450,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.23.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" dependencies = [ "fastrand", "getrandom 0.3.4", @@ -10491,11 +10499,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.17", + "thiserror-impl 2.0.18", ] [[package]] @@ -10506,18 +10514,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "thiserror-impl" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -10531,30 +10539,30 @@ dependencies = [ [[package]] name = "time" -version = "0.3.44" +version = "0.3.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" +checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5" dependencies = [ "deranged", "itoa", "num-conv", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" -version = "0.2.24" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +checksum = "78cc610bac2dcee56805c99642447d4c5dbde4d01f752ffea0199aee1f601dc4" dependencies = [ "num-conv", "time-core", @@ -10622,9 +10630,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.48.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ "bytes", "libc", @@ -10632,7 +10640,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.1", + "socket2 0.6.2", "tokio-macros", "windows-sys 0.61.2", ] @@ -10645,7 +10653,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -10674,7 +10682,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.35", + "rustls 0.23.36", "tokio", ] @@ -10696,9 +10704,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -10737,9 +10745,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.17" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -10771,14 +10779,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.9+spec-1.0.0" +version = "0.9.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5238e643fc34a1d5d7e753e1532a91912d74b63b92b3ea51fde8d1b7bc79dd" +checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" dependencies = [ - "indexmap 2.12.1", + "indexmap 2.13.0", "serde_core", "serde_spanned 1.0.4", - "toml_datetime 0.7.4+spec-1.0.0", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", "winnow", @@ -10795,9 +10803,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.4+spec-1.0.0" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe3cea6b2aa3b910092f6abd4053ea464fab5f9c170ba5e9a6aead16ec4af2b6" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ "serde_core", ] @@ -10808,7 +10816,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.12.1", + "indexmap 2.13.0", "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.11", @@ -10822,17 +10830,17 @@ version = "0.23.10+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ - "indexmap 2.12.1", - "toml_datetime 0.7.4+spec-1.0.0", + "indexmap 2.13.0", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "winnow", ] [[package]] name = "toml_parser" -version = "1.0.5+spec-1.0.0" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c03bee5ce3696f31250db0bbaff18bc43301ce0e8db2ed1f07cbb2acf89984c" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ "winnow", ] @@ -10845,15 +10853,15 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.0.5+spec-1.0.0" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9cd6190959dce0994aa8970cd32ab116d1851ead27e866039acaf2524ce44fa" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "tower" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", @@ -10881,7 +10889,7 @@ dependencies = [ "iri-string", "pin-project-lite", "tokio", - "tokio-util 0.7.17", + "tokio-util 0.7.18", "tower", "tower-layer", "tower-service", @@ -10901,9 +10909,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -10918,7 +10926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" dependencies = [ "crossbeam-channel", - "thiserror 2.0.17", + "thiserror 2.0.18", "time", "tracing-subscriber", ] @@ -10931,14 +10939,14 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "tracing-core" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -11017,7 +11025,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 0.9.9+spec-1.0.0", + "toml 0.9.11+spec-1.1.0", ] [[package]] @@ -11049,9 +11057,9 @@ checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unicase" -version = "2.8.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-ident" @@ -11135,9 +11143,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.7" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", @@ -11165,9 +11173,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" +checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" dependencies = [ "getrandom 0.3.4", "js-sys", @@ -11248,7 +11256,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", - "tokio-util 0.7.17", + "tokio-util 0.7.18", "tower-service", "tracing", ] @@ -11267,18 +11275,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -11289,11 +11297,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.56" +version = "0.4.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -11302,9 +11311,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -11312,31 +11321,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", @@ -11354,9 +11363,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee3e3b5f5e80bc89f30ce8d0343bf4e5f12341c51f3e26cbeecbc7c85443e85b" +checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc" dependencies = [ "rustls-pki-types", ] @@ -11378,9 +11387,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" dependencies = [ "rustls-pki-types", ] @@ -11437,7 +11446,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -11448,7 +11457,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -11804,9 +11813,9 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.46.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" [[package]] name = "writeable" @@ -11852,7 +11861,7 @@ dependencies = [ "ark-ff 0.5.0", "base64 0.13.1", "chrono", - "clap 4.5.53", + "clap 4.5.55", "dirs", "groth16-solana", "light-batched-merkle-tree", @@ -11900,7 +11909,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure 0.13.2", ] @@ -11918,22 +11927,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.31" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +checksum = "fdea86ddd5568519879b8187e1cf04e24fce28f7fe046ceecbce472ff19a2572" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.31" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +checksum = "0c15e1b46eff7c6c91195752e0eeed8ef040e391cdece7c25376957d5f15df22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -11953,7 +11962,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure 0.13.2", ] @@ -11968,13 +11977,13 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -12007,9 +12016,15 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] +[[package]] +name = "zmij" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439" + [[package]] name = "zstd" version = "0.13.3" diff --git a/sdk-libs/token-client/CLAUDE.md b/sdk-libs/token-client/CLAUDE.md new file mode 100644 index 0000000000..d7d548e71f --- /dev/null +++ b/sdk-libs/token-client/CLAUDE.md @@ -0,0 +1,65 @@ +# light-token-client + +Rust client for light-token. Each action is a struct with an +async `execute` method that builds, signs, and sends the transaction. + +## Actions + +| Struct | Fields | `execute` signers | +|--------|--------|-------------------| +| `CreateMint` | `decimals`, `freeze_authority?`, `token_metadata?`, `seed?` | `payer`, `mint_authority` | +| `CreateAta` | `mint`, `owner`, `idempotent` | `payer` | +| `MintTo` | `mint`, `destination`, `amount` | `payer`, `authority` | +| `Transfer` | `source`, `destination`, `amount` | `payer`, `authority` | +| `TransferChecked` | `source`, `mint`, `destination`, `amount`, `decimals` | `payer`, `authority` | +| `TransferInterface` | `source`, `mint`, `destination`, `amount`, `decimals`, `spl_token_program?`, `restricted` | `payer`, `authority` | +| `Approve` | `token_account`, `delegate`, `amount`, `owner?` | `payer` (or `payer` + `owner`) | +| `Revoke` | `token_account`, `owner?` | `payer` (or `payer` + `owner`) | +| `Wrap` | `source_spl_ata`, `destination`, `mint`, `amount`, `decimals` | `payer`, `authority` | +| `Unwrap` | `source`, `destination_spl_ata`, `mint`, `amount`, `decimals` | `payer`, `authority` | + +`?` = `Option`. All structs derive `Default`, `Clone`, `Debug`. + +`CreateMint::execute` requires `R: Rpc + Indexer` (needs address proof). +All others require `R: Rpc`. + +`Approve` and `Revoke` also expose `execute_with_owner` for when +owner differs from payer. + +## Re-exports + +From `light_token::instruction`: +- `derive_associated_token_account` +- `get_associated_token_address` +- `get_associated_token_address_and_bump` + +## Supporting types + +```rust +pub struct TokenMetadata { + pub name: String, + pub symbol: String, + pub uri: String, + pub update_authority: Option, + pub additional_metadata: Option>, +} +``` + +## Source layout + +``` +src/ + lib.rs -- re-exports actions::* + actions/ + mod.rs -- submodule declarations, re-exports + create_mint.rs -- CreateMint, TokenMetadata + create_ata.rs -- CreateAta + mint_to.rs -- MintTo + transfer.rs -- Transfer + transfer_checked.rs -- TransferChecked + transfer_interface.rs -- TransferInterface + approve.rs -- Approve + revoke.rs -- Revoke + wrap.rs -- Wrap + unwrap.rs -- Unwrap +``` \ No newline at end of file diff --git a/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json b/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json deleted file mode 100644 index 0e4e427c40..0000000000 --- a/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json +++ /dev/null @@ -1,726 +0,0 @@ -{ - "address": "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", - "metadata": { - "name": "sdk_anchor_test", - "version": "0.7.0", - "spec": "0.1.0", - "description": "Test program for Light SDK and Light Macros" - }, - "instructions": [ - { - "name": "close_compressed_account", - "discriminator": [ - 55, - 108, - 99, - 108, - 119, - 228, - 247, - 203 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "my_compressed_account", - "type": { - "defined": { - "name": "MyCompressedAccount" - } - } - }, - { - "name": "account_meta", - "type": { - "defined": { - "name": "CompressedAccountMeta" - } - } - } - ] - }, - { - "name": "close_compressed_account_permanent", - "discriminator": [ - 117, - 145, - 242, - 98, - 46, - 187, - 118, - 125 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "account_meta", - "type": { - "defined": { - "name": "CompressedAccountMetaBurn" - } - } - } - ] - }, - { - "name": "close_compressed_account_v2", - "discriminator": [ - 12, - 21, - 104, - 30, - 185, - 99, - 10, - 30 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "my_compressed_account", - "type": { - "defined": { - "name": "MyCompressedAccount" - } - } - }, - { - "name": "account_meta", - "type": { - "defined": { - "name": "CompressedAccountMeta" - } - } - } - ] - }, - { - "name": "create_compressed_account", - "discriminator": [ - 74, - 87, - 131, - 150, - 204, - 209, - 66, - 94 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "address_tree_info", - "type": { - "defined": { - "name": "PackedAddressTreeInfo" - } - } - }, - { - "name": "output_tree_index", - "type": "u8" - }, - { - "name": "name", - "type": "string" - } - ] - }, - { - "name": "create_compressed_account_v2", - "discriminator": [ - 16, - 69, - 137, - 87, - 207, - 37, - 81, - 138 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "address_tree_info", - "type": { - "defined": { - "name": "PackedAddressTreeInfo" - } - } - }, - { - "name": "output_tree_index", - "type": "u8" - }, - { - "name": "name", - "type": "string" - } - ] - }, - { - "name": "reinit_closed_account", - "discriminator": [ - 100, - 26, - 249, - 27, - 243, - 0, - 206, - 64 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "account_meta", - "type": { - "defined": { - "name": "CompressedAccountMeta" - } - } - } - ] - }, - { - "name": "update_compressed_account", - "discriminator": [ - 3, - 98, - 6, - 60, - 116, - 45, - 88, - 166 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "my_compressed_account", - "type": { - "defined": { - "name": "MyCompressedAccount" - } - } - }, - { - "name": "account_meta", - "type": { - "defined": { - "name": "CompressedAccountMeta" - } - } - }, - { - "name": "nested_data", - "type": { - "defined": { - "name": "NestedData" - } - } - } - ] - }, - { - "name": "update_compressed_account_v2", - "discriminator": [ - 100, - 134, - 47, - 184, - 220, - 7, - 96, - 236 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "ValidityProof" - } - } - }, - { - "name": "my_compressed_account", - "type": { - "defined": { - "name": "MyCompressedAccount" - } - } - }, - { - "name": "account_meta", - "type": { - "defined": { - "name": "CompressedAccountMeta" - } - } - }, - { - "name": "nested_data", - "type": { - "defined": { - "name": "NestedData" - } - } - } - ] - }, - { - "name": "without_compressed_account", - "discriminator": [ - 68, - 84, - 81, - 196, - 24, - 131, - 208, - 209 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - }, - { - "name": "my_regular_account", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [ - 99, - 111, - 109, - 112, - 114, - 101, - 115, - 115, - 101, - 100 - ] - }, - { - "kind": "arg", - "path": "name" - } - ] - } - }, - { - "name": "system_program", - "address": "11111111111111111111111111111111" - } - ], - "args": [ - { - "name": "name", - "type": "string" - } - ] - } - ], - "accounts": [ - { - "name": "MyRegularAccount", - "discriminator": [ - 186, - 181, - 76, - 117, - 61, - 130, - 63, - 14 - ] - } - ], - "events": [ - { - "name": "MyCompressedAccount", - "discriminator": [ - 147, - 40, - 99, - 80, - 53, - 44, - 10, - 210 - ] - } - ], - "types": [ - { - "name": "CompressedAccountMeta", - "type": { - "kind": "struct", - "fields": [ - { - "name": "tree_info", - "docs": [ - "Merkle tree context." - ], - "type": { - "defined": { - "name": "PackedStateTreeInfo" - } - } - }, - { - "name": "address", - "docs": [ - "Address." - ], - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "output_state_tree_index", - "docs": [ - "Output merkle tree index." - ], - "type": "u8" - } - ] - } - }, - { - "name": "CompressedAccountMetaBurn", - "type": { - "kind": "struct", - "fields": [ - { - "name": "tree_info", - "docs": [ - "State Merkle tree context." - ], - "type": { - "defined": { - "name": "PackedStateTreeInfo" - } - } - }, - { - "name": "address", - "docs": [ - "Address." - ], - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "CompressedProof", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "a", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "b", - "type": { - "array": [ - "u8", - 64 - ] - } - }, - { - "name": "c", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "MyCompressedAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - }, - { - "name": "nested", - "type": { - "defined": { - "name": "NestedData" - } - } - } - ] - } - }, - { - "name": "MyRegularAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - } - ] - } - }, - { - "name": "NestedData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "one", - "type": "u16" - }, - { - "name": "two", - "type": "u16" - }, - { - "name": "three", - "type": "u16" - }, - { - "name": "four", - "type": "u16" - }, - { - "name": "five", - "type": "u16" - }, - { - "name": "six", - "type": "u16" - }, - { - "name": "seven", - "type": "u16" - }, - { - "name": "eight", - "type": "u16" - }, - { - "name": "nine", - "type": "u16" - }, - { - "name": "ten", - "type": "u16" - }, - { - "name": "eleven", - "type": "u16" - }, - { - "name": "twelve", - "type": "u16" - } - ] - } - }, - { - "name": "PackedAddressTreeInfo", - "type": { - "kind": "struct", - "fields": [ - { - "name": "address_merkle_tree_pubkey_index", - "type": "u8" - }, - { - "name": "address_queue_pubkey_index", - "type": "u8" - }, - { - "name": "root_index", - "type": "u16" - } - ] - } - }, - { - "name": "PackedStateTreeInfo", - "type": { - "kind": "struct", - "fields": [ - { - "name": "root_index", - "type": "u16" - }, - { - "name": "prove_by_index", - "type": "bool" - }, - { - "name": "merkle_tree_pubkey_index", - "type": "u8" - }, - { - "name": "queue_pubkey_index", - "type": "u8" - }, - { - "name": "leaf_index", - "type": "u32" - } - ] - } - }, - { - "name": "ValidityProof", - "type": { - "kind": "struct", - "fields": [ - { - "option": { - "defined": { - "name": "CompressedProof" - } - } - } - ] - } - } - ] -} \ No newline at end of file diff --git a/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts b/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts deleted file mode 100644 index e805730cc1..0000000000 --- a/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts +++ /dev/null @@ -1,732 +0,0 @@ -/** - * Program IDL in camelCase format in order to be used in JS/TS. - * - * Note that this is only a type helper and is not the actual IDL. The original - * IDL can be found at `target/idl/sdk_anchor_test.json`. - */ -export type SdkAnchorTest = { - "address": "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", - "metadata": { - "name": "sdkAnchorTest", - "version": "0.7.0", - "spec": "0.1.0", - "description": "Test program for Light SDK and Light Macros" - }, - "instructions": [ - { - "name": "closeCompressedAccount", - "discriminator": [ - 55, - 108, - 99, - 108, - 119, - 228, - 247, - 203 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "myCompressedAccount", - "type": { - "defined": { - "name": "myCompressedAccount" - } - } - }, - { - "name": "accountMeta", - "type": { - "defined": { - "name": "compressedAccountMeta" - } - } - } - ] - }, - { - "name": "closeCompressedAccountPermanent", - "discriminator": [ - 117, - 145, - 242, - 98, - 46, - 187, - 118, - 125 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "accountMeta", - "type": { - "defined": { - "name": "compressedAccountMetaBurn" - } - } - } - ] - }, - { - "name": "closeCompressedAccountV2", - "discriminator": [ - 12, - 21, - 104, - 30, - 185, - 99, - 10, - 30 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "myCompressedAccount", - "type": { - "defined": { - "name": "myCompressedAccount" - } - } - }, - { - "name": "accountMeta", - "type": { - "defined": { - "name": "compressedAccountMeta" - } - } - } - ] - }, - { - "name": "createCompressedAccount", - "discriminator": [ - 74, - 87, - 131, - 150, - 204, - 209, - 66, - 94 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "addressTreeInfo", - "type": { - "defined": { - "name": "packedAddressTreeInfo" - } - } - }, - { - "name": "outputTreeIndex", - "type": "u8" - }, - { - "name": "name", - "type": "string" - } - ] - }, - { - "name": "createCompressedAccountV2", - "discriminator": [ - 16, - 69, - 137, - 87, - 207, - 37, - 81, - 138 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "addressTreeInfo", - "type": { - "defined": { - "name": "packedAddressTreeInfo" - } - } - }, - { - "name": "outputTreeIndex", - "type": "u8" - }, - { - "name": "name", - "type": "string" - } - ] - }, - { - "name": "reinitClosedAccount", - "discriminator": [ - 100, - 26, - 249, - 27, - 243, - 0, - 206, - 64 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "accountMeta", - "type": { - "defined": { - "name": "compressedAccountMeta" - } - } - } - ] - }, - { - "name": "updateCompressedAccount", - "discriminator": [ - 3, - 98, - 6, - 60, - 116, - 45, - 88, - 166 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "myCompressedAccount", - "type": { - "defined": { - "name": "myCompressedAccount" - } - } - }, - { - "name": "accountMeta", - "type": { - "defined": { - "name": "compressedAccountMeta" - } - } - }, - { - "name": "nestedData", - "type": { - "defined": { - "name": "nestedData" - } - } - } - ] - }, - { - "name": "updateCompressedAccountV2", - "discriminator": [ - 100, - 134, - 47, - 184, - 220, - 7, - 96, - 236 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "proof", - "type": { - "defined": { - "name": "validityProof" - } - } - }, - { - "name": "myCompressedAccount", - "type": { - "defined": { - "name": "myCompressedAccount" - } - } - }, - { - "name": "accountMeta", - "type": { - "defined": { - "name": "compressedAccountMeta" - } - } - }, - { - "name": "nestedData", - "type": { - "defined": { - "name": "nestedData" - } - } - } - ] - }, - { - "name": "withoutCompressedAccount", - "discriminator": [ - 68, - 84, - 81, - 196, - 24, - 131, - 208, - 209 - ], - "accounts": [ - { - "name": "signer", - "writable": true, - "signer": true - }, - { - "name": "myRegularAccount", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [ - 99, - 111, - 109, - 112, - 114, - 101, - 115, - 115, - 101, - 100 - ] - }, - { - "kind": "arg", - "path": "name" - } - ] - } - }, - { - "name": "systemProgram", - "address": "11111111111111111111111111111111" - } - ], - "args": [ - { - "name": "name", - "type": "string" - } - ] - } - ], - "accounts": [ - { - "name": "myRegularAccount", - "discriminator": [ - 186, - 181, - 76, - 117, - 61, - 130, - 63, - 14 - ] - } - ], - "events": [ - { - "name": "myCompressedAccount", - "discriminator": [ - 147, - 40, - 99, - 80, - 53, - 44, - 10, - 210 - ] - } - ], - "types": [ - { - "name": "compressedAccountMeta", - "type": { - "kind": "struct", - "fields": [ - { - "name": "treeInfo", - "docs": [ - "Merkle tree context." - ], - "type": { - "defined": { - "name": "packedStateTreeInfo" - } - } - }, - { - "name": "address", - "docs": [ - "Address." - ], - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "outputStateTreeIndex", - "docs": [ - "Output merkle tree index." - ], - "type": "u8" - } - ] - } - }, - { - "name": "compressedAccountMetaBurn", - "type": { - "kind": "struct", - "fields": [ - { - "name": "treeInfo", - "docs": [ - "State Merkle tree context." - ], - "type": { - "defined": { - "name": "packedStateTreeInfo" - } - } - }, - { - "name": "address", - "docs": [ - "Address." - ], - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "compressedProof", - "repr": { - "kind": "c" - }, - "type": { - "kind": "struct", - "fields": [ - { - "name": "a", - "type": { - "array": [ - "u8", - 32 - ] - } - }, - { - "name": "b", - "type": { - "array": [ - "u8", - 64 - ] - } - }, - { - "name": "c", - "type": { - "array": [ - "u8", - 32 - ] - } - } - ] - } - }, - { - "name": "myCompressedAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - }, - { - "name": "nested", - "type": { - "defined": { - "name": "nestedData" - } - } - } - ] - } - }, - { - "name": "myRegularAccount", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "string" - } - ] - } - }, - { - "name": "nestedData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "one", - "type": "u16" - }, - { - "name": "two", - "type": "u16" - }, - { - "name": "three", - "type": "u16" - }, - { - "name": "four", - "type": "u16" - }, - { - "name": "five", - "type": "u16" - }, - { - "name": "six", - "type": "u16" - }, - { - "name": "seven", - "type": "u16" - }, - { - "name": "eight", - "type": "u16" - }, - { - "name": "nine", - "type": "u16" - }, - { - "name": "ten", - "type": "u16" - }, - { - "name": "eleven", - "type": "u16" - }, - { - "name": "twelve", - "type": "u16" - } - ] - } - }, - { - "name": "packedAddressTreeInfo", - "type": { - "kind": "struct", - "fields": [ - { - "name": "addressMerkleTreePubkeyIndex", - "type": "u8" - }, - { - "name": "addressQueuePubkeyIndex", - "type": "u8" - }, - { - "name": "rootIndex", - "type": "u16" - } - ] - } - }, - { - "name": "packedStateTreeInfo", - "type": { - "kind": "struct", - "fields": [ - { - "name": "rootIndex", - "type": "u16" - }, - { - "name": "proveByIndex", - "type": "bool" - }, - { - "name": "merkleTreePubkeyIndex", - "type": "u8" - }, - { - "name": "queuePubkeyIndex", - "type": "u8" - }, - { - "name": "leafIndex", - "type": "u32" - } - ] - } - }, - { - "name": "validityProof", - "type": { - "kind": "struct", - "fields": [ - { - "option": { - "defined": { - "name": "compressedProof" - } - } - } - ] - } - } - ] -}; From 62914dc665a5450d8acae67de70c7cd4b395ade9 Mon Sep 17 00:00:00 2001 From: tilo-14 Date: Wed, 28 Jan 2026 23:44:36 +0000 Subject: [PATCH 7/7] restore --- Cargo.lock | 751 +++++++++--------- .../target/idl/sdk_anchor_test.json | 726 +++++++++++++++++ .../target/types/sdk_anchor_test.ts | 732 +++++++++++++++++ 3 files changed, 1826 insertions(+), 383 deletions(-) create mode 100644 sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json create mode 100644 sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts diff --git a/Cargo.lock b/Cargo.lock index 0e4ea85402..2527e72705 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,7 +188,7 @@ version = "1.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -620,7 +620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -646,7 +646,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -721,7 +721,7 @@ checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -827,21 +827,22 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.37" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10e4f991a553474232bc0a31799f6d24b034a84c0971d80d2e2f78b2e576e40" +checksum = "98ec5f6c2f8bc326c994cb9e241cc257ddaba9afa8555a43cffbb5dd86efaa37" dependencies = [ "compression-codecs", "compression-core", + "futures-core", "pin-project-lite", "tokio", ] [[package]] name = "async-lock" -version = "3.4.2" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" dependencies = [ "event-listener 5.4.1", "event-listener-strategy", @@ -856,7 +857,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -976,16 +977,15 @@ dependencies = [ [[package]] name = "blake3" -version = "1.8.3" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "cpufeatures", "digest 0.10.7", ] @@ -1050,7 +1050,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -1144,7 +1144,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -1183,9 +1183,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.54" +version = "1.2.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" dependencies = [ "find-msvc-tools", "jobserver", @@ -1219,14 +1219,14 @@ checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] name = "chrono" -version = "0.4.43" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ "iana-time-zone", "js-sys", @@ -1263,9 +1263,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.55" +version = "4.5.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e34525d5bbbd55da2bb745d34b36121baac88d07619a9a09cfcf4a6c0832785" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" dependencies = [ "clap_builder", "clap_derive", @@ -1273,9 +1273,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.55" +version = "4.5.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a20016a20a3da95bef50ec7238dbd09baeef4311dcdd38ec15aba69812fb61" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" dependencies = [ "anstream", "anstyle", @@ -1285,21 +1285,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.55" +version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] name = "clap_lex" -version = "0.7.7" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "client-test" @@ -1415,9 +1415,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.36" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" +checksum = "b0f7ac3e5b97fdce45e8922fb05cae2c37f7bbd63d30dd94821dacfd8f3f2bf2" dependencies = [ "brotli", "compression-core", @@ -1475,9 +1475,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.4.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" @@ -1703,7 +1703,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -1727,7 +1727,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -1738,7 +1738,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -1770,9 +1770,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.10.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "der-parser" @@ -1897,7 +1897,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -1920,7 +1920,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -2012,7 +2012,7 @@ dependencies = [ "enum-ordinalize 4.3.2", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -2053,7 +2053,7 @@ checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -2066,7 +2066,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -2086,7 +2086,7 @@ checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -2170,14 +2170,14 @@ dependencies = [ [[package]] name = "fastbloom" -version = "0.14.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7f34442dbe69c60fe8eaf58a8cafff81a1f278816d8ab4db255b3bef4ac3c4" +checksum = "18c1ddb9231d8554c2d6bdf4cfaabf0c59251658c68b6c95cd52dd0c513a912a" dependencies = [ "getrandom 0.3.4", "libm", "rand 0.9.2", - "siphasher 1.0.2", + "siphasher 1.0.1", ] [[package]] @@ -2200,9 +2200,9 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "find-msvc-tools" -version = "0.1.8" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" [[package]] name = "five8" @@ -2254,9 +2254,9 @@ checksum = "059c31d7d36c43fe39d89e55711858b4da8be7eb6dabac23c7289b1a19489406" [[package]] name = "flate2" -version = "1.1.8" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "miniz_oxide", @@ -2302,7 +2302,7 @@ dependencies = [ "bb8", "borsh 0.10.4", "bs58", - "clap 4.5.55", + "clap 4.5.53", "create-address-test-program", "csdk-anchor-full-derived-test", "dashmap 6.1.0", @@ -2335,7 +2335,7 @@ dependencies = [ "photon-api", "prometheus", "rand 0.8.5", - "reqwest 0.12.28", + "reqwest 0.12.26", "scopeguard", "serde", "serde_json", @@ -2348,7 +2348,7 @@ dependencies = [ "solana-rpc-client-api", "solana-sdk", "solana-transaction-status", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", "tracing", "tracing-appender", @@ -2386,7 +2386,7 @@ dependencies = [ "solana-instruction", "solana-pubkey 2.4.0", "solana-sdk", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", "tracing", ] @@ -2462,7 +2462,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -2536,9 +2536,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", @@ -2637,18 +2637,18 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.13.0", + "indexmap 2.12.1", "slab", "tokio", - "tokio-util 0.7.18", + "tokio-util 0.7.17", "tracing", ] [[package]] name = "h2" -version = "0.4.13" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" dependencies = [ "atomic-waker", "bytes", @@ -2656,10 +2656,10 @@ dependencies = [ "futures-core", "futures-sink", "http 1.4.0", - "indexmap 2.13.0", + "indexmap 2.12.1", "slab", "tokio", - "tokio-util 0.7.18", + "tokio-util 0.7.17", "tracing", ] @@ -2772,9 +2772,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hidapi" -version = "2.6.4" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565dd4c730b8f8b2c0fb36df6be12e5470ae10895ddcc4e9dcfbfb495de202b0" +checksum = "03b876ecf37e86b359573c16c8366bc3eba52b689884a0fc42ba3f67203d2a8b" dependencies = [ "cc", "cfg-if", @@ -2926,7 +2926,7 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "h2 0.4.13", + "h2 0.4.12", "http 1.4.0", "http-body 1.0.1", "httparse", @@ -2962,12 +2962,12 @@ dependencies = [ "http 1.4.0", "hyper 1.8.1", "hyper-util", - "rustls 0.23.36", + "rustls 0.23.35", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.5", + "webpki-roots 1.0.4", ] [[package]] @@ -3017,7 +3017,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.2", + "socket2 0.6.1", "system-configuration 0.6.1", "tokio", "tower-service", @@ -3027,9 +3027,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.65" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3170,9 +3170,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -3210,9 +3210,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.10" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" dependencies = [ "memchr", "serde", @@ -3262,15 +3262,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.17" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50" +checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" dependencies = [ "jiff-static", "log", @@ -3281,13 +3281,13 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78" +checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -3324,9 +3324,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.85" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -3374,21 +3374,21 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.180" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" [[package]] name = "libm" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +checksum = "df15f6eac291ed1cf25865b1ee60399f57e7c227e7f51bdbd4c5270396a9ed50" dependencies = [ "bitflags 2.10.0", "libc", @@ -3454,7 +3454,7 @@ dependencies = [ "solana-program-error 2.2.2", "solana-pubkey 2.4.0", "solana-sysvar", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3503,7 +3503,7 @@ dependencies = [ "solana-program-error 2.2.2", "solana-pubkey 2.4.0", "solana-sysvar", - "thiserror 2.0.18", + "thiserror 2.0.17", "zerocopy", ] @@ -3518,7 +3518,7 @@ dependencies = [ "rand 0.8.5", "solana-nostd-keccak", "solana-program-error 2.2.2", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3582,7 +3582,7 @@ dependencies = [ "solana-transaction-status-client-types", "spl-pod", "spl-token-2022-interface", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", "tracing", ] @@ -3608,7 +3608,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "solana-pubkey 2.4.0", - "thiserror 2.0.18", + "thiserror 2.0.17", "tinyvec", "zerocopy", ] @@ -3671,7 +3671,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "solana-pubkey 2.4.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3697,7 +3697,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-rent", "solana-sysvar", - "thiserror 2.0.18", + "thiserror 2.0.17", "zerocopy", ] @@ -3718,7 +3718,7 @@ dependencies = [ "pinocchio", "rand 0.8.5", "solana-program-error 2.2.2", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", ] @@ -3731,7 +3731,7 @@ dependencies = [ "light-hasher", "light-zero-copy", "rand 0.8.5", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3745,7 +3745,7 @@ dependencies = [ "num-traits", "rand 0.8.5", "solana-program-error 2.2.2", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3763,7 +3763,7 @@ dependencies = [ "sha3", "solana-program-error 2.2.2", "solana-pubkey 2.4.0", - "thiserror 2.0.18", + "thiserror 2.0.17", "tinyvec", "zerocopy", ] @@ -3783,7 +3783,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3800,7 +3800,7 @@ dependencies = [ "pinocchio", "rand 0.8.5", "solana-program-error 2.2.2", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3830,7 +3830,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -3841,7 +3841,7 @@ dependencies = [ "proc-macro2", "quote", "solana-pubkey 2.4.0", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -3856,7 +3856,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "solana-sysvar", - "thiserror 2.0.18", + "thiserror 2.0.17", "zerocopy", ] @@ -3869,7 +3869,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -3904,7 +3904,7 @@ checksum = "0a8be18fe4de58a6f754caa74a3fbc6d8a758a26f1f3c24d5b0f5b55df5f5408" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -3955,7 +3955,7 @@ dependencies = [ "num-traits", "photon-api", "rand 0.8.5", - "reqwest 0.12.28", + "reqwest 0.12.26", "serde", "serde_json", "solana-account", @@ -3994,7 +3994,7 @@ dependencies = [ "serde_json", "serial_test", "solana-bn254", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", "tracing", ] @@ -4053,7 +4053,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-system-interface 1.0.0", "solana-sysvar", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4072,7 +4072,7 @@ dependencies = [ "proc-macro2", "quote", "solana-pubkey 2.4.0", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -4088,7 +4088,7 @@ dependencies = [ "light-sdk-macros", "light-sdk-types", "pinocchio", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4103,7 +4103,7 @@ dependencies = [ "light-macros", "solana-msg 2.2.1", "solana-pubkey 2.4.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4116,7 +4116,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4157,7 +4157,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-pubkey 2.4.0", "solana-security-txt", - "thiserror 2.0.18", + "thiserror 2.0.17", "zerocopy", ] @@ -4201,7 +4201,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "rand 0.8.5", - "reqwest 0.12.28", + "reqwest 0.12.26", "solana-banks-client", "solana-instruction", "solana-keypair", @@ -4214,7 +4214,7 @@ dependencies = [ "spl-pod", "spl-token 7.0.0", "spl-token-2022 7.0.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4246,7 +4246,7 @@ dependencies = [ "solana-program-error 2.2.2", "solana-pubkey 2.4.0", "spl-pod", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4304,7 +4304,7 @@ dependencies = [ "spl-pod", "spl-token-2022 7.0.0", "spl-token-metadata-interface 0.6.0", - "thiserror 2.0.18", + "thiserror 2.0.17", "tinyvec", "zerocopy", ] @@ -4320,7 +4320,7 @@ dependencies = [ "light-macros", "light-sdk-types", "solana-msg 2.2.1", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4332,7 +4332,7 @@ dependencies = [ "pinocchio", "solana-msg 2.2.1", "solana-program-error 2.2.2", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4356,7 +4356,7 @@ dependencies = [ "proc-macro2", "quote", "rand 0.8.5", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -4382,7 +4382,7 @@ dependencies = [ "agave-reserved-account-keys", "ansi_term", "bincode", - "indexmap 2.13.0", + "indexmap 2.12.1", "itertools 0.14.0", "log", "solana-account", @@ -4431,7 +4431,7 @@ dependencies = [ "solana-transaction-context", "solana-transaction-error", "solana-vote-program", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -4565,7 +4565,7 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe 0.1.6", + "openssl-probe", "openssl-sys", "schannel", "security-framework 2.11.1", @@ -4666,9 +4666,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-derive" @@ -4689,7 +4689,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -4762,7 +4762,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -4821,7 +4821,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -4830,17 +4830,11 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - [[package]] name = "openssl-src" -version = "300.5.5+3.5.5" +version = "300.5.4+3.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1787d533e03597a7934fd0a765f0d28e94ecc5fb7789f8053b1e699a56f709" +checksum = "a507b3792995dae9b0df8a1c1e3771e8418b7c2d9f0baeba32e6fe8b06c7cb72" dependencies = [ "cc", ] @@ -4975,7 +4969,7 @@ dependencies = [ name = "photon-api" version = "0.54.0" dependencies = [ - "reqwest 0.12.28", + "reqwest 0.12.26", "serde", "serde_derive", "serde_json", @@ -5001,7 +4995,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -5105,9 +5099,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.13.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portable-atomic-util" @@ -5155,7 +5149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -5195,14 +5189,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] @@ -5219,7 +5213,7 @@ dependencies = [ "memchr", "parking_lot", "protobuf", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -5259,7 +5253,7 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -5289,9 +5283,9 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.1.1", - "rustls 0.23.36", - "socket2 0.6.2", - "thiserror 2.0.18", + "rustls 0.23.35", + "socket2 0.6.1", + "thiserror 2.0.17", "tokio", "tracing", "web-time", @@ -5310,11 +5304,11 @@ dependencies = [ "rand 0.9.2", "ring", "rustc-hash 2.1.1", - "rustls 0.23.36", + "rustls 0.23.35", "rustls-pki-types", "rustls-platform-verifier", "slab", - "thiserror 2.0.18", + "thiserror 2.0.17", "tinyvec", "tracing", "web-time", @@ -5329,16 +5323,16 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.2", + "socket2 0.6.1", "tracing", "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.44" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] @@ -5386,7 +5380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.5", + "rand_core 0.9.3", ] [[package]] @@ -5416,7 +5410,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.5", + "rand_core 0.9.3", ] [[package]] @@ -5434,14 +5428,14 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.17", + "getrandom 0.2.16", ] [[package]] name = "rand_core" -version = "0.9.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom 0.3.4", ] @@ -5499,7 +5493,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.17", + "getrandom 0.2.16", "libredox", "thiserror 1.0.69", ] @@ -5510,9 +5504,9 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ - "getrandom 0.2.17", + "getrandom 0.2.16", "libredox", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -5532,7 +5526,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -5639,9 +5633,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.28" +version = "0.12.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ "base64 0.22.1", "bytes", @@ -5649,7 +5643,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.13", + "h2 0.4.12", "http 1.4.0", "http-body 1.0.1", "http-body-util", @@ -5665,7 +5659,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.36", + "rustls 0.23.35", "rustls-pki-types", "serde", "serde_json", @@ -5681,7 +5675,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.5", + "webpki-roots 1.0.4", ] [[package]] @@ -5693,7 +5687,7 @@ dependencies = [ "anyhow", "async-trait", "http 1.4.0", - "reqwest 0.12.28", + "reqwest 0.12.26", "serde", "thiserror 1.0.69", "tower-service", @@ -5707,7 +5701,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.17", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -5736,9 +5730,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.27" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -5772,9 +5766,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ "bitflags 2.10.0", "errno", @@ -5797,25 +5791,25 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.36" +version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.9", + "rustls-webpki 0.103.8", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +checksum = "9980d917ebb0c0536119ba501e90834767bffc3d60641457fd84a1f3fd337923" dependencies = [ - "openssl-probe 0.2.1", + "openssl-probe", "rustls-pki-types", "schannel", "security-framework 3.5.1", @@ -5832,9 +5826,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.14.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" dependencies = [ "web-time", "zeroize", @@ -5851,10 +5845,10 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.36", + "rustls 0.23.35", "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.103.9", + "rustls-webpki 0.103.8", "security-framework 3.5.1", "security-framework-sys", "webpki-root-certs", @@ -5879,9 +5873,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.9" +version = "0.103.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" +checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" dependencies = [ "ring", "rustls-pki-types", @@ -5896,9 +5890,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.22" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -5941,9 +5935,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2" +checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" dependencies = [ "dyn-clone", "ref-cast", @@ -6211,20 +6205,20 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", + "ryu", "serde", "serde_core", - "zmij", ] [[package]] @@ -6267,9 +6261,9 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.13.0", + "indexmap 2.12.1", "schemars 0.9.0", - "schemars 1.2.0", + "schemars 1.1.0", "serde_core", "serde_json", "serde_with_macros", @@ -6285,7 +6279,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -6294,7 +6288,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.12.1", "itoa", "ryu", "serde", @@ -6303,12 +6297,11 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.3.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0b343e184fc3b7bb44dff0705fffcf4b3756ba6aff420dddd8b24ca145e555" +checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9" dependencies = [ - "futures-executor", - "futures-util", + "futures", "log", "once_cell", "parking_lot", @@ -6318,13 +6311,13 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "3.3.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f50427f258fb77356e4cd4aa0e87e2bd2c66dbcee41dc405282cae2bfc26c83" +checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -6411,11 +6404,10 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.8" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ - "errno", "libc", ] @@ -6567,9 +6559,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "siphasher" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" @@ -6595,9 +6587,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", "windows-sys 0.60.2", @@ -6660,7 +6652,7 @@ dependencies = [ "spl-token-2022 8.0.1", "spl-token-group-interface 0.6.0", "spl-token-metadata-interface 0.7.0", - "thiserror 2.0.18", + "thiserror 2.0.17", "zstd", ] @@ -6775,7 +6767,7 @@ dependencies = [ "solana-transaction-context", "solana-transaction-error", "tarpc", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", "tokio-serde", ] @@ -6847,7 +6839,7 @@ dependencies = [ "ark-serialize 0.4.2", "bytemuck", "solana-define-syscall 2.3.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -6903,7 +6895,7 @@ dependencies = [ "solana-timings", "solana-transaction-context", "solana-type-overrides", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -6969,7 +6961,7 @@ dependencies = [ "solana-seed-phrase", "solana-signature", "solana-signer", - "thiserror 2.0.18", + "thiserror 2.0.17", "tiny-bip39", "uriparse", "url", @@ -7044,7 +7036,7 @@ dependencies = [ "dashmap 5.5.3", "futures", "futures-util", - "indexmap 2.13.0", + "indexmap 2.12.1", "indicatif", "log", "quinn", @@ -7075,7 +7067,7 @@ dependencies = [ "solana-transaction", "solana-transaction-error", "solana-udp-client", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", ] @@ -7162,7 +7154,7 @@ dependencies = [ "solana-sdk-ids", "solana-svm-transaction", "solana-transaction-error", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -7210,7 +7202,7 @@ dependencies = [ "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.13.0", + "indexmap 2.12.1", "log", "rand 0.8.5", "rayon", @@ -7219,7 +7211,7 @@ dependencies = [ "solana-metrics", "solana-time-utils", "solana-transaction-error", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", ] @@ -7248,7 +7240,7 @@ dependencies = [ "curve25519-dalek 4.1.3", "solana-define-syscall 2.3.0", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -7375,7 +7367,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-sdk-ids", "solana-system-interface 1.0.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -7527,7 +7519,7 @@ checksum = "bab5682934bd1f65f8d2c16f21cb532526fcc1a09f796e2cacdb091eee5774ad" dependencies = [ "bincode", "borsh 1.6.0", - "getrandom 0.2.17", + "getrandom 0.2.16", "js-sys", "num-traits", "serde", @@ -7728,11 +7720,11 @@ dependencies = [ "crossbeam-channel", "gethostname", "log", - "reqwest 0.12.28", + "reqwest 0.12.26", "solana-cluster-type", "solana-sha256-hasher 2.3.0", "solana-time-utils", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -7902,7 +7894,7 @@ dependencies = [ "ark-bn254 0.4.0", "light-poseidon 0.2.0", "solana-define-syscall 2.3.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -7957,7 +7949,7 @@ dependencies = [ "bytemuck", "console_error_panic_hook", "console_log", - "getrandom 0.2.17", + "getrandom 0.2.16", "lazy_static", "log", "memoffset", @@ -8019,7 +8011,7 @@ dependencies = [ "solana-sysvar", "solana-sysvar-id", "solana-vote-interface", - "thiserror 2.0.18", + "thiserror 2.0.17", "wasm-bindgen", ] @@ -8122,7 +8114,7 @@ dependencies = [ "solana-timings", "solana-transaction-context", "solana-type-overrides", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -8138,7 +8130,7 @@ dependencies = [ "curve25519-dalek 4.1.3", "five8 0.2.1", "five8_const 0.1.4", - "getrandom 0.2.17", + "getrandom 0.2.16", "js-sys", "num-traits", "rand 0.8.5", @@ -8180,7 +8172,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-rpc-client-types", "solana-signature", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", "tokio-stream", "tokio-tungstenite", @@ -8201,7 +8193,7 @@ dependencies = [ "log", "quinn", "quinn-proto", - "rustls 0.23.36", + "rustls 0.23.35", "solana-connection-cache", "solana-keypair", "solana-measure", @@ -8214,7 +8206,7 @@ dependencies = [ "solana-streamer", "solana-tls-utils", "solana-transaction-error", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", ] @@ -8256,7 +8248,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-signature", "solana-signer", - "thiserror 2.0.18", + "thiserror 2.0.17", "uriparse", ] @@ -8335,7 +8327,7 @@ dependencies = [ "futures", "indicatif", "log", - "reqwest 0.12.28", + "reqwest 0.12.26", "reqwest-middleware", "semver", "serde", @@ -8370,7 +8362,7 @@ checksum = "2dbc138685c79d88a766a8fd825057a74ea7a21e1dd7f8de275ada899540fff7" dependencies = [ "anyhow", "jsonrpc-core", - "reqwest 0.12.28", + "reqwest 0.12.26", "reqwest-middleware", "serde", "serde_derive", @@ -8381,7 +8373,7 @@ dependencies = [ "solana-signer", "solana-transaction-error", "solana-transaction-status-client-types", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -8398,7 +8390,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-rpc-client", "solana-sdk-ids", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -8424,7 +8416,7 @@ dependencies = [ "solana-transaction-status-client-types", "solana-version", "spl-generic-token", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -8452,7 +8444,7 @@ dependencies = [ "log", "rand 0.8.5", "rustc-demangle", - "thiserror 2.0.18", + "thiserror 2.0.17", "winapi", ] @@ -8523,7 +8515,7 @@ dependencies = [ "solana-transaction-context", "solana-transaction-error", "solana-validator-exit", - "thiserror 2.0.18", + "thiserror 2.0.17", "wasm-bindgen", ] @@ -8545,7 +8537,7 @@ dependencies = [ "bs58", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -8576,7 +8568,7 @@ dependencies = [ "borsh 1.6.0", "libsecp256k1", "solana-define-syscall 2.3.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -8819,7 +8811,7 @@ dependencies = [ "futures-util", "governor 0.6.3", "histogram", - "indexmap 2.13.0", + "indexmap 2.12.1", "itertools 0.12.1", "libc", "log", @@ -8829,7 +8821,7 @@ dependencies = [ "quinn", "quinn-proto", "rand 0.8.5", - "rustls 0.23.36", + "rustls 0.23.35", "smallvec", "socket2 0.5.10", "solana-keypair", @@ -8846,9 +8838,9 @@ dependencies = [ "solana-tls-utils", "solana-transaction-error", "solana-transaction-metrics-tracker", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", - "tokio-util 0.7.18", + "tokio-util 0.7.17", "x509-parser", ] @@ -9052,7 +9044,7 @@ version = "2.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14494aa87a75a883d1abcfee00f1278a28ecc594a2f030084879eb40570728f6" dependencies = [ - "rustls 0.23.36", + "rustls 0.23.35", "solana-keypair", "solana-pubkey 2.4.0", "solana-signer", @@ -9068,7 +9060,7 @@ dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.13.0", + "indexmap 2.12.1", "indicatif", "log", "rayon", @@ -9089,7 +9081,7 @@ dependencies = [ "solana-signer", "solana-transaction", "solana-transaction-error", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", ] @@ -9206,7 +9198,7 @@ dependencies = [ "spl-token-2022 8.0.1", "spl-token-group-interface 0.6.0", "spl-token-metadata-interface 0.7.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9229,7 +9221,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9253,7 +9245,7 @@ dependencies = [ "solana-net-utils", "solana-streamer", "solana-transaction-error", - "thiserror 2.0.18", + "thiserror 2.0.17", "tokio", ] @@ -9333,7 +9325,7 @@ dependencies = [ "solana-transaction", "solana-transaction-context", "solana-vote-interface", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9384,7 +9376,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.17", "wasm-bindgen", "zeroize", ] @@ -9437,7 +9429,7 @@ dependencies = [ "solana-signature", "solana-signer", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.17", "zeroize", ] @@ -9479,7 +9471,7 @@ dependencies = [ "spl-associated-token-account-client", "spl-token 8.0.0", "spl-token-2022 8.0.1", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9512,7 +9504,7 @@ checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -9524,7 +9516,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.114", + "syn 2.0.111", "thiserror 1.0.69", ] @@ -9605,7 +9597,7 @@ dependencies = [ "solana-program-option", "solana-pubkey 2.4.0", "solana-zk-sdk", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9633,7 +9625,7 @@ dependencies = [ "solana-msg 2.2.1", "solana-program-error 2.2.2", "spl-program-error-derive 0.5.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9645,7 +9637,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -9657,7 +9649,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -9701,7 +9693,7 @@ dependencies = [ "spl-pod", "spl-program-error 0.7.0", "spl-type-length-value 0.8.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9744,7 +9736,7 @@ dependencies = [ "solana-rent", "solana-sdk-ids", "solana-sysvar", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9800,7 +9792,7 @@ dependencies = [ "spl-token-metadata-interface 0.6.0", "spl-transfer-hook-interface 0.9.0", "spl-type-length-value 0.7.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9844,7 +9836,7 @@ dependencies = [ "spl-token-metadata-interface 0.7.0", "spl-transfer-hook-interface 0.10.0", "spl-type-length-value 0.8.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9874,7 +9866,7 @@ dependencies = [ "spl-token-group-interface 0.6.0", "spl-token-metadata-interface 0.7.0", "spl-type-length-value 0.8.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9912,7 +9904,7 @@ dependencies = [ "solana-program", "solana-zk-sdk", "spl-pod", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9932,7 +9924,7 @@ dependencies = [ "solana-sdk-ids", "solana-zk-sdk", "spl-pod", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9952,7 +9944,7 @@ dependencies = [ "solana-sdk-ids", "solana-zk-sdk", "spl-pod", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9974,7 +9966,7 @@ checksum = "0e3597628b0d2fe94e7900fd17cdb4cfbb31ee35c66f82809d27d86e44b2848b" dependencies = [ "curve25519-dalek 4.1.3", "solana-zk-sdk", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -9985,7 +9977,7 @@ checksum = "fa27b9174bea869a7ebf31e0be6890bce90b1a4288bc2bbf24bd413f80ae3fde" dependencies = [ "curve25519-dalek 4.1.3", "solana-zk-sdk", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -10023,7 +10015,7 @@ dependencies = [ "solana-pubkey 2.4.0", "spl-discriminator", "spl-pod", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -10065,7 +10057,7 @@ dependencies = [ "spl-discriminator", "spl-pod", "spl-type-length-value 0.8.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -10115,7 +10107,7 @@ dependencies = [ "spl-program-error 0.7.0", "spl-tlv-account-resolution 0.10.0", "spl-type-length-value 0.8.0", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -10151,7 +10143,7 @@ dependencies = [ "solana-program-error 2.2.2", "spl-discriminator", "spl-pod", - "thiserror 2.0.18", + "thiserror 2.0.17", ] [[package]] @@ -10197,9 +10189,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.114" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -10241,7 +10233,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -10398,7 +10390,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -10450,9 +10442,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.24.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", "getrandom 0.3.4", @@ -10499,11 +10491,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.18", + "thiserror-impl 2.0.17", ] [[package]] @@ -10514,18 +10506,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -10539,30 +10531,30 @@ dependencies = [ [[package]] name = "time" -version = "0.3.46" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "itoa", "num-conv", "powerfmt", - "serde_core", + "serde", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "time-macros" -version = "0.2.26" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc610bac2dcee56805c99642447d4c5dbde4d01f752ffea0199aee1f601dc4" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ "num-conv", "time-core", @@ -10630,9 +10622,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.49.0" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ "bytes", "libc", @@ -10640,7 +10632,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.2", + "socket2 0.6.1", "tokio-macros", "windows-sys 0.61.2", ] @@ -10653,7 +10645,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -10682,7 +10674,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.36", + "rustls 0.23.35", "tokio", ] @@ -10704,9 +10696,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.18" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -10745,9 +10737,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.18" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" dependencies = [ "bytes", "futures-core", @@ -10779,14 +10771,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.11+spec-1.1.0" +version = "0.9.9+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" +checksum = "eb5238e643fc34a1d5d7e753e1532a91912d74b63b92b3ea51fde8d1b7bc79dd" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.12.1", "serde_core", "serde_spanned 1.0.4", - "toml_datetime 0.7.5+spec-1.1.0", + "toml_datetime 0.7.4+spec-1.0.0", "toml_parser", "toml_writer", "winnow", @@ -10803,9 +10795,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.5+spec-1.1.0" +version = "0.7.4+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +checksum = "fe3cea6b2aa3b910092f6abd4053ea464fab5f9c170ba5e9a6aead16ec4af2b6" dependencies = [ "serde_core", ] @@ -10816,7 +10808,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.12.1", "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.11", @@ -10830,17 +10822,17 @@ version = "0.23.10+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ - "indexmap 2.13.0", - "toml_datetime 0.7.5+spec-1.1.0", + "indexmap 2.12.1", + "toml_datetime 0.7.4+spec-1.0.0", "toml_parser", "winnow", ] [[package]] name = "toml_parser" -version = "1.0.6+spec-1.1.0" +version = "1.0.5+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +checksum = "4c03bee5ce3696f31250db0bbaff18bc43301ce0e8db2ed1f07cbb2acf89984c" dependencies = [ "winnow", ] @@ -10853,15 +10845,15 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.0.6+spec-1.1.0" +version = "1.0.5+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" +checksum = "a9cd6190959dce0994aa8970cd32ab116d1851ead27e866039acaf2524ce44fa" [[package]] name = "tower" -version = "0.5.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", @@ -10889,7 +10881,7 @@ dependencies = [ "iri-string", "pin-project-lite", "tokio", - "tokio-util 0.7.18", + "tokio-util 0.7.17", "tower", "tower-layer", "tower-service", @@ -10909,9 +10901,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" dependencies = [ "log", "pin-project-lite", @@ -10926,7 +10918,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" dependencies = [ "crossbeam-channel", - "thiserror 2.0.18", + "thiserror 2.0.17", "time", "tracing-subscriber", ] @@ -10939,14 +10931,14 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] name = "tracing-core" -version = "0.1.36" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" dependencies = [ "once_cell", "valuable", @@ -11025,7 +11017,7 @@ dependencies = [ "serde_json", "target-triple", "termcolor", - "toml 0.9.11+spec-1.1.0", + "toml 0.9.9+spec-1.0.0", ] [[package]] @@ -11057,9 +11049,9 @@ checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unicase" -version = "2.9.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" @@ -11143,9 +11135,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.8" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", @@ -11173,9 +11165,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.20.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ "getrandom 0.3.4", "js-sys", @@ -11256,7 +11248,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", - "tokio-util 0.7.18", + "tokio-util 0.7.17", "tower-service", "tracing", ] @@ -11275,18 +11267,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.108" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", @@ -11297,12 +11289,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.58" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", - "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -11311,9 +11302,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.108" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -11321,31 +11312,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.108" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.108" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.85" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -11363,9 +11354,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc" +checksum = "ee3e3b5f5e80bc89f30ce8d0343bf4e5f12341c51f3e26cbeecbc7c85443e85b" dependencies = [ "rustls-pki-types", ] @@ -11387,9 +11378,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "1.0.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" dependencies = [ "rustls-pki-types", ] @@ -11446,7 +11437,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -11457,7 +11448,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -11813,9 +11804,9 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.51.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" @@ -11861,7 +11852,7 @@ dependencies = [ "ark-ff 0.5.0", "base64 0.13.1", "chrono", - "clap 4.5.55", + "clap 4.5.53", "dirs", "groth16-solana", "light-batched-merkle-tree", @@ -11909,7 +11900,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", "synstructure 0.13.2", ] @@ -11927,22 +11918,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.35" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdea86ddd5568519879b8187e1cf04e24fce28f7fe046ceecbce472ff19a2572" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.35" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c15e1b46eff7c6c91195752e0eeed8ef040e391cdece7c25376957d5f15df22" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -11962,7 +11953,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", "synstructure 0.13.2", ] @@ -11977,13 +11968,13 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.4.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] [[package]] @@ -12016,15 +12007,9 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.111", ] -[[package]] -name = "zmij" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439" - [[package]] name = "zstd" version = "0.13.3" diff --git a/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json b/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json new file mode 100644 index 0000000000..0e4e427c40 --- /dev/null +++ b/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json @@ -0,0 +1,726 @@ +{ + "address": "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + "metadata": { + "name": "sdk_anchor_test", + "version": "0.7.0", + "spec": "0.1.0", + "description": "Test program for Light SDK and Light Macros" + }, + "instructions": [ + { + "name": "close_compressed_account", + "discriminator": [ + 55, + 108, + 99, + 108, + 119, + 228, + 247, + 203 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + } + ] + }, + { + "name": "close_compressed_account_permanent", + "discriminator": [ + 117, + 145, + 242, + 98, + 46, + 187, + 118, + 125 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMetaBurn" + } + } + } + ] + }, + { + "name": "close_compressed_account_v2", + "discriminator": [ + 12, + 21, + 104, + 30, + 185, + 99, + 10, + 30 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + } + ] + }, + { + "name": "create_compressed_account", + "discriminator": [ + 74, + 87, + 131, + 150, + 204, + 209, + 66, + 94 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "address_tree_info", + "type": { + "defined": { + "name": "PackedAddressTreeInfo" + } + } + }, + { + "name": "output_tree_index", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "create_compressed_account_v2", + "discriminator": [ + 16, + 69, + 137, + 87, + 207, + 37, + 81, + 138 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "address_tree_info", + "type": { + "defined": { + "name": "PackedAddressTreeInfo" + } + } + }, + { + "name": "output_tree_index", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "reinit_closed_account", + "discriminator": [ + 100, + 26, + 249, + 27, + 243, + 0, + 206, + 64 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + } + ] + }, + { + "name": "update_compressed_account", + "discriminator": [ + 3, + 98, + 6, + 60, + 116, + 45, + 88, + 166 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + }, + { + "name": "nested_data", + "type": { + "defined": { + "name": "NestedData" + } + } + } + ] + }, + { + "name": "update_compressed_account_v2", + "discriminator": [ + 100, + 134, + 47, + 184, + 220, + 7, + 96, + 236 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + }, + { + "name": "nested_data", + "type": { + "defined": { + "name": "NestedData" + } + } + } + ] + }, + { + "name": "without_compressed_account", + "discriminator": [ + 68, + 84, + 81, + 196, + 24, + 131, + 208, + 209 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "my_regular_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 111, + 109, + 112, + 114, + 101, + 115, + 115, + 101, + 100 + ] + }, + { + "kind": "arg", + "path": "name" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "name", + "type": "string" + } + ] + } + ], + "accounts": [ + { + "name": "MyRegularAccount", + "discriminator": [ + 186, + 181, + 76, + 117, + 61, + 130, + 63, + 14 + ] + } + ], + "events": [ + { + "name": "MyCompressedAccount", + "discriminator": [ + 147, + 40, + 99, + 80, + 53, + 44, + 10, + 210 + ] + } + ], + "types": [ + { + "name": "CompressedAccountMeta", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tree_info", + "docs": [ + "Merkle tree context." + ], + "type": { + "defined": { + "name": "PackedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "output_state_tree_index", + "docs": [ + "Output merkle tree index." + ], + "type": "u8" + } + ] + } + }, + { + "name": "CompressedAccountMetaBurn", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tree_info", + "docs": [ + "State Merkle tree context." + ], + "type": { + "defined": { + "name": "PackedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "CompressedProof", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "a", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "b", + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "c", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "MyCompressedAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "nested", + "type": { + "defined": { + "name": "NestedData" + } + } + } + ] + } + }, + { + "name": "MyRegularAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + }, + { + "name": "NestedData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "one", + "type": "u16" + }, + { + "name": "two", + "type": "u16" + }, + { + "name": "three", + "type": "u16" + }, + { + "name": "four", + "type": "u16" + }, + { + "name": "five", + "type": "u16" + }, + { + "name": "six", + "type": "u16" + }, + { + "name": "seven", + "type": "u16" + }, + { + "name": "eight", + "type": "u16" + }, + { + "name": "nine", + "type": "u16" + }, + { + "name": "ten", + "type": "u16" + }, + { + "name": "eleven", + "type": "u16" + }, + { + "name": "twelve", + "type": "u16" + } + ] + } + }, + { + "name": "PackedAddressTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "address_merkle_tree_pubkey_index", + "type": "u8" + }, + { + "name": "address_queue_pubkey_index", + "type": "u8" + }, + { + "name": "root_index", + "type": "u16" + } + ] + } + }, + { + "name": "PackedStateTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "root_index", + "type": "u16" + }, + { + "name": "prove_by_index", + "type": "bool" + }, + { + "name": "merkle_tree_pubkey_index", + "type": "u8" + }, + { + "name": "queue_pubkey_index", + "type": "u8" + }, + { + "name": "leaf_index", + "type": "u32" + } + ] + } + }, + { + "name": "ValidityProof", + "type": { + "kind": "struct", + "fields": [ + { + "option": { + "defined": { + "name": "CompressedProof" + } + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts b/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts new file mode 100644 index 0000000000..e805730cc1 --- /dev/null +++ b/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts @@ -0,0 +1,732 @@ +/** + * Program IDL in camelCase format in order to be used in JS/TS. + * + * Note that this is only a type helper and is not the actual IDL. The original + * IDL can be found at `target/idl/sdk_anchor_test.json`. + */ +export type SdkAnchorTest = { + "address": "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + "metadata": { + "name": "sdkAnchorTest", + "version": "0.7.0", + "spec": "0.1.0", + "description": "Test program for Light SDK and Light Macros" + }, + "instructions": [ + { + "name": "closeCompressedAccount", + "discriminator": [ + 55, + 108, + 99, + 108, + 119, + 228, + 247, + 203 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + } + ] + }, + { + "name": "closeCompressedAccountPermanent", + "discriminator": [ + 117, + 145, + 242, + 98, + 46, + 187, + 118, + 125 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMetaBurn" + } + } + } + ] + }, + { + "name": "closeCompressedAccountV2", + "discriminator": [ + 12, + 21, + 104, + 30, + 185, + 99, + 10, + 30 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + } + ] + }, + { + "name": "createCompressedAccount", + "discriminator": [ + 74, + 87, + 131, + 150, + 204, + 209, + 66, + 94 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "addressTreeInfo", + "type": { + "defined": { + "name": "packedAddressTreeInfo" + } + } + }, + { + "name": "outputTreeIndex", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "createCompressedAccountV2", + "discriminator": [ + 16, + 69, + 137, + 87, + 207, + 37, + 81, + 138 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "addressTreeInfo", + "type": { + "defined": { + "name": "packedAddressTreeInfo" + } + } + }, + { + "name": "outputTreeIndex", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "reinitClosedAccount", + "discriminator": [ + 100, + 26, + 249, + 27, + 243, + 0, + 206, + 64 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + } + ] + }, + { + "name": "updateCompressedAccount", + "discriminator": [ + 3, + 98, + 6, + 60, + 116, + 45, + 88, + 166 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + }, + { + "name": "nestedData", + "type": { + "defined": { + "name": "nestedData" + } + } + } + ] + }, + { + "name": "updateCompressedAccountV2", + "discriminator": [ + 100, + 134, + 47, + 184, + 220, + 7, + 96, + 236 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + }, + { + "name": "nestedData", + "type": { + "defined": { + "name": "nestedData" + } + } + } + ] + }, + { + "name": "withoutCompressedAccount", + "discriminator": [ + 68, + 84, + 81, + 196, + 24, + 131, + 208, + 209 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "myRegularAccount", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 111, + 109, + 112, + 114, + 101, + 115, + 115, + 101, + 100 + ] + }, + { + "kind": "arg", + "path": "name" + } + ] + } + }, + { + "name": "systemProgram", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "name", + "type": "string" + } + ] + } + ], + "accounts": [ + { + "name": "myRegularAccount", + "discriminator": [ + 186, + 181, + 76, + 117, + 61, + 130, + 63, + 14 + ] + } + ], + "events": [ + { + "name": "myCompressedAccount", + "discriminator": [ + 147, + 40, + 99, + 80, + 53, + 44, + 10, + 210 + ] + } + ], + "types": [ + { + "name": "compressedAccountMeta", + "type": { + "kind": "struct", + "fields": [ + { + "name": "treeInfo", + "docs": [ + "Merkle tree context." + ], + "type": { + "defined": { + "name": "packedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "outputStateTreeIndex", + "docs": [ + "Output merkle tree index." + ], + "type": "u8" + } + ] + } + }, + { + "name": "compressedAccountMetaBurn", + "type": { + "kind": "struct", + "fields": [ + { + "name": "treeInfo", + "docs": [ + "State Merkle tree context." + ], + "type": { + "defined": { + "name": "packedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "compressedProof", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "a", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "b", + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "c", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "myCompressedAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "nested", + "type": { + "defined": { + "name": "nestedData" + } + } + } + ] + } + }, + { + "name": "myRegularAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + }, + { + "name": "nestedData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "one", + "type": "u16" + }, + { + "name": "two", + "type": "u16" + }, + { + "name": "three", + "type": "u16" + }, + { + "name": "four", + "type": "u16" + }, + { + "name": "five", + "type": "u16" + }, + { + "name": "six", + "type": "u16" + }, + { + "name": "seven", + "type": "u16" + }, + { + "name": "eight", + "type": "u16" + }, + { + "name": "nine", + "type": "u16" + }, + { + "name": "ten", + "type": "u16" + }, + { + "name": "eleven", + "type": "u16" + }, + { + "name": "twelve", + "type": "u16" + } + ] + } + }, + { + "name": "packedAddressTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "addressMerkleTreePubkeyIndex", + "type": "u8" + }, + { + "name": "addressQueuePubkeyIndex", + "type": "u8" + }, + { + "name": "rootIndex", + "type": "u16" + } + ] + } + }, + { + "name": "packedStateTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "rootIndex", + "type": "u16" + }, + { + "name": "proveByIndex", + "type": "bool" + }, + { + "name": "merkleTreePubkeyIndex", + "type": "u8" + }, + { + "name": "queuePubkeyIndex", + "type": "u8" + }, + { + "name": "leafIndex", + "type": "u32" + } + ] + } + }, + { + "name": "validityProof", + "type": { + "kind": "struct", + "fields": [ + { + "option": { + "defined": { + "name": "compressedProof" + } + } + } + ] + } + } + ] +};