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 transactionbeneficiary
: The wallet receiving the rewardsepochs
: Vector of epoch numbers to claimparticipant_type
: 0 for customer, 1 for merchantmax_batch_size
: Maximum epochs per batch (1-10)epoch_proofs
: Vector of proof data for each epochsocial_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 informationVec<[u8; 32]>
: Payment proof pathVec<bool>
: Payment proof indicesVec<[u8; 32]>
: Seal proof pathVec<bool>
: Seal proof indices[u8; 32]
: Payment rootEpochClaimData
: Epoch-specific reward and activity dataDailyParticipantData
: Participant data for each epoch