feat: upgrade to v2.0.0 with major dependency updates

- Upgrade Solana dependencies from 2.3.x to 3.0.0 series
  - Upgrade solana-streamer-sdk from 0.4.13 to 0.5.0
  - Upgrade yellowstone-grpc from 8.0.0 to 9.0.0
  - Add new SPL token utility modules (spl_token.rs, spl_token_2022.rs,
  spl_associated_token_account.rs)
  - Remove deprecated gRPC protocol definitions (protos/ directory)
  - Remove event_subscription example and update all example dependencies
  - Update README documentation to reflect v2.0.0 changes
  - Refactor imports to use new dependency structure across examples

  BREAKING CHANGES:
  - Solana SDK upgraded to 3.0.0 with API changes
  - Removed gRPC protocol definitions
  - Updated import paths for SPL token operations
This commit is contained in:
ysq
2025-09-27 14:24:41 +08:00
parent e75b0c9480
commit a7f673b43d
70 changed files with 502 additions and 3001 deletions
+10 -5
View File
@@ -1,8 +1,9 @@
use crate::common::fast_fn::create_associated_token_account_idempotent_fast;
use crate::common::{
fast_fn::create_associated_token_account_idempotent_fast, spl_token::close_account,
};
use smallvec::SmallVec;
use solana_sdk::{instruction::Instruction, pubkey::Pubkey};
use solana_sdk::{instruction::Instruction, message::AccountMeta, pubkey::Pubkey};
use solana_system_interface::instruction::transfer;
use spl_token::instruction::close_account;
#[inline]
pub fn handle_wsol(payer: &Pubkey, amount_in: u64) -> SmallVec<[Instruction; 3]> {
@@ -22,8 +23,12 @@ pub fn handle_wsol(payer: &Pubkey, amount_in: u64) -> SmallVec<[Instruction; 3]>
));
insts.extend([
transfer(&payer, &wsol_token_account, amount_in),
spl_token::instruction::sync_native(&crate::constants::TOKEN_PROGRAM, &wsol_token_account)
.unwrap(),
// sync_native
Instruction {
program_id: crate::constants::TOKEN_PROGRAM,
accounts: vec![AccountMeta::new(wsol_token_account, false)],
data: vec![17],
},
]);
insts