Structs§
- Merkle
Proof - Merkle proof for a specific participant.
- Merkle
Tree - Merkle tree creation result containing the root and proof generation capabilities.
- Seal
Merkle Tree - Seal Merkle Tree for incremental construction of historical payment roots.
- Seal
Proof - Seal proof structure for dual merkle tree verification. Contains both the merkle proof path and the payment root being proven. Enhanced with epoch-specific data for accurate historical reward calculations.
Functions§
- batch_
claim_ date_ range - Builds a batch claim instruction for a date range.
- batch_
claim_ vector - Builds a batch claim instruction for a vector of epochs.
- calculate_
customer_ reward_ transparent - Complete transparent calculation for customer rewards. This function combines all steps of the reward calculation for transparency.
- calculate_
customer_ reward_ transparent_ with_ cap - Complete transparent calculation for customer rewards WITH activity capping. This function matches the on-chain calculation behavior exactly.
- calculate_
merchant_ reward_ transparent - Complete transparent calculation for merchant rewards. This function combines all steps of the reward calculation for transparency.
- calculate_
merchant_ reward_ transparent_ with_ cap - Complete transparent calculation for merchant rewards WITH activity capping. This function matches the on-chain calculation behavior exactly.
- calculate_
social_ reward_ amount - Calculate social reward amount based on engagement and base reward.
- claim
- Builds a claim instruction.
- close
- Builds a social claim instruction.
- compute_
epoch_ hash - Computes the epoch hash for the Epoch Hash Chain security solution.
- create_
merkle_ tree - Create a merkle tree from participant data.
- create_
participant_ from_ wallet - Create DailyParticipantData from wallet address and payment information.
- create_
seal_ merkle_ tree - Create a new seal merkle tree.
- create_
seal_ merkle_ tree_ from_ roots - Create a seal merkle tree from payment roots.
- create_
social_ claim_ data - Create social claim data for social media engagement.
- date_
range_ to_ epochs - Convert a date range to a list of epochs.
- epoch_
to_ timestamp - Calculate Unix timestamp from epoch number (day sequence).
- find_
participant_ by_ wallet - Find participant by wallet address in a participant list.
- find_
participant_ index - Find the index of a participant in the participant list.
- generate_
claim_ key - Generate a unique claim key for tracking claims.
- generate_
proof_ for_ wallet - Generate merkle proof for a wallet address.
- generate_
seal_ proof - Generate a seal proof for a payment root.
- initialize
- Builds an initialize instruction.
- open
- Builds an open instruction.
- reset
- Builds a reset instruction.
- sort_
participants_ by_ id - Helper to sort participants deterministically by participant_id (lexicographically). This is recommended for trustless Merkle tree construction.
- timestamp_
to_ epoch - Convert Unix timestamp to epoch number (day sequence since launch).
- update_
metrics - Builds an update community metrics instruction.
- update_
oracle - Builds an update oracle instruction.
- update_
snapshot - Builds an update snapshot instruction.
- update_
targets - Build an UpdateTargets instruction to update community targets and activity limits. This function allows the oracle to update configurable parameters based on community performance.
- validate_
community_ metrics - Validates community metrics parameters before creating an instruction.
- validate_
social_ post_ url - Validate social media post URL for required content.
- verify_
dual_ merkle_ claim - Verify a dual merkle claim using both payment and seal proofs.
- verify_
merkle_ proof - Verify a merkle proof against a merkle root and participant data.
- wallet_
to_ participant_ id - Convert wallet address to participant ID (32-byte hash).