Skip to content

Rust SDK - MultiWalletManager and fixes#108

Open
santy311 wants to merge 7 commits intomainfrom
santhosh/rust-sdk-fix
Open

Rust SDK - MultiWalletManager and fixes#108
santy311 wants to merge 7 commits intomainfrom
santhosh/rust-sdk-fix

Conversation

@santy311
Copy link
Collaborator

@santy311 santy311 commented Oct 20, 2025

What's New

1. MultiWalletManager - A new high-level SDK for managing batch operations across multiple Swig wallets

Three-level API:

  • Instruction Creation - Build signed instructions without sending
  • Transaction Execution - Execute batches with automatic batching and retry logic
  • High-Level Helpers - One-call methods for common operations (transfer SOL/tokens)
let wallet_ids: Vec<SwigPubkey, role_id>;
                                                                                                                                                                                                                                                          
let manager = MultiWalletManager::new(client_role, &fee_payer, Some(&authority), rpc);                                                                                                                                                                                     
                                                                                                                                                                                                                                                                           
let result = manager.execute_batch(                                                                                                                                                                                                                                        
    wallet_ids,                                                                                                                                                                                                                                                            
    |_swig_id, _role_id, wallet_addr| {                                                                                                                                                                                                                                    
        Ok(system_instruction::transfer(&wallet_addr, &recipient, 1000))                                                                                                                                                                                                   
    },                                                                                                                                                                                                                                                                     
    BatchConfig::default(),                                                                                                                                                                                                                                                
).await?;                                                                                                                                                                                                                                                                  
  1. BatchConfig - Configurable batch execution with:
  • BatchStrategy::Simple - Send batches, mark failed swig_ids on failure
  • BatchStrategy::BinarySearchFailures - Recursively split failed batches to identify individual failures
  • Configurable parallelism (num_threads)
  • Max accounts/tx size limits
  • Retry logic with configurable delays
  1. SwigWalletBuilder - Fluent builder pattern for wallet creation/loading
let wallet = SwigWallet::builder()                                                                                                                                                                                                                                         
    .with_swig_id([0u8; 32])                                                                                                                                                                                                                                               
    .with_client_role(Box::new(Ed25519ClientRole::new(authority.pubkey())))                                                                                                                                                                                                
    .with_fee_payer(&fee_payer)                                                                                                                                                                                                                                            
    .with_rpc_url("https://api.mainnet-beta.solana.com".to_string())                                                                                                                                                                                                       
    .create()?;                                                                                                                                                                                                                                                            
  1. New Types
  • SwigInfo / RoleInfo - Wallet introspection data
  • TokenBalance - Token balance information
  • WalletConfig - Simplified parameter passing for wallet operations
  1. Comprehensive Test Suite
  • batch_execution.rs - Tests for batch execution strategies
  • instruction_creation.rs - Tests for instruction building
  • Helper utilities for testing
  1. Minor Fixes
  • fixed the flow for secp256r1 and secp256k1 in the rust SDK instruction builder.
  • added test cases for the secp256r1 session authority
  • added test cases for the secp256k1 session authority
  • added cases for the ed25519 session authority
  • interactive CLI flow fixed for session operations

@santy311 santy311 force-pushed the santhosh/rust-sdk-fix branch from 20dbfd8 to bc665b0 Compare October 20, 2025 15:18
@santy311 santy311 changed the title Rust SDK - secp256r1 and secp256k1 fixes Rust SDK - MultiWalletManager and fixes Jan 20, 2026
santy311 and others added 3 commits January 20, 2026 22:20
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@santy311 santy311 force-pushed the santhosh/rust-sdk-fix branch from e29b3d8 to cd451ec Compare January 21, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant