batch_claim_vector

Function batch_claim_vector 

Source
pub fn batch_claim_vector(
    signer: Pubkey,
    beneficiary: Pubkey,
    epochs: Vec<u64>,
    participant_type: u8,
    max_batch_size: u8,
    epoch_proofs: Vec<(Vec<[u8; 32]>, Vec<bool>, Vec<[u8; 32]>, Vec<bool>, [u8; 32], EpochClaimData, DailyParticipantData)>,
    social_data: Option<Vec<Option<SocialClaimData>>>,
) -> Result<Instruction, MiracleError>
Expand description

Builds a batch claim instruction for a vector of epochs.

This is the underlying function used by batch_claim_date_range. Uses correct 8-account structure matching program. It allows claiming rewards for specific epochs in a single transaction. Supports both payment rewards and optional social rewards per epoch.

§Parameters

  • signer: The wallet signing the transaction
  • beneficiary: The wallet receiving the rewards
  • epochs: Vector of epoch numbers to claim
  • participant_type: 0 for customer, 1 for merchant
  • max_batch_size: Maximum epochs per batch (1-10)
  • epoch_proofs: Vector of proof data for each epoch
  • social_data: Optional vector of social data for each epoch (None = no social claim)

§Returns

  • Instruction for batch claiming rewards for specific epochs

§Note

  • Each epoch requires its own proof data
  • The number of proofs must match the number of epochs
  • Social data is optional per epoch (None = payment only, Some = payment + social)
  • Epochs must be in ascending order for optimal gas efficiency

§Data Structure

Each epoch proof contains:

  • DailyParticipantData: Participant-specific information
  • Vec<[u8; 32]>: Payment proof path
  • Vec<bool>: Payment proof indices
  • Vec<[u8; 32]>: Seal proof path
  • Vec<bool>: Seal proof indices
  • [u8; 32]: Payment root
  • EpochClaimData: Epoch-specific reward and activity data
  • DailyParticipantData: Participant data for each epoch