Module sdk

Module sdk 

Source

Structs§

MerkleProof
Merkle proof for a specific participant.
MerkleTree
Merkle tree creation result containing the root and proof generation capabilities.
SealMerkleTree
Seal Merkle Tree for incremental construction of historical payment roots.
SealProof
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).