Rewards & Affiliation
Claiming Rewards

Claiming Rewards

Three different things on Superhero are called "claiming a reward". One is automatic, one is a contract call you sign, and one is signed by a one-time key embedded in an invite link.

The three payout paths

RewardHow it reaches youWho signsGas
X posting rewardsSent automatically to your connected wallet after a successful scanNobody: the backend pays outNone for you
Affiliate rewardsYou press Collect rewards, which calls withdraw() on the AffiliationTreasuryYouAn ordinary æternity transaction fee
An invite link's AE giftYou open the link and press Claim rewardThe invite's one-time key, not your walletCovered by the redemption_fee_cover the inviter funded

X posting rewards: nothing to claim

There is no claim button for the Superhero Rewards Program. Press Check rewards on /trends/invite, sign the ownership challenge with your wallet, and the backend scans your posts and sends AE to your connected wallet. There is no transaction for you to sign and no gas for you to pay.

What can go wrong:

  • The button is greyed out with a countdown. The recheck is rate-limited. The status response carries next_check_allowed_at; a submit past the cap returns HTTP 429 and the scan is skipped. Wait for the countdown and try again.
  • The check succeeds but nothing arrives. A recheck that returns HTTP 200 can still carry an error string: below the follower minimum, the X identity was already rewarded on a different address, or the payout transaction itself failed. The card shows that string in a red banner; read it rather than retrying blindly.
  • You rejected the signature. The client leaves the state unchanged. Press the button again and approve the signature request.

Affiliate rewards: the withdraw call

Affiliate rewards accrue in the AffiliationTreasury contract as your invitees trade.

The gate: four direct invitees must each have spent at least 10 AE, cumulatively, in token sales. The Collect Rewards card reads this live from the contract, shows a progress bar out of four, and lists each invitee's spend against the 10 AE threshold.

The claim window: rewards accumulate in 30-day periods. withdraw() pays the current and previous period; earlier periods are no longer claimable. A given reward is claimable for between 30 and 60 days depending on where in a period it landed, so withdraw at least monthly. The arithmetic is on The Affiliation System.

To withdraw:

  1. Open https://superhero.com/trends/invite and connect the wallet that created the invites. Rewards accrue to the inviter address, not to any other account.
  2. Scroll to Collect your rewards. The card shows Available Rewards, the value of get_accumulated_rewards(<your address>), converted from aettos.
  3. If the progress bar reads 4/4 and the balance is above zero, the button is enabled. Press Collect rewards and confirm the transaction in your wallet. It calls withdraw().
Button readsMeaning
Not eligible yetFewer than four invitees have crossed 10 AE
No rewards yetThreshold reached, but get_accumulated_rewards returns zero
Collect rewardsEligible; the call will go through
Withdrawing...Transaction submitted, waiting on the wallet and the chain

withdraw() takes no arguments and always pays the whole two-period balance. There is no partial withdrawal. Its only requirement is the ThresholdReached check; it does not require a non-zero balance, so a withdraw with nothing accrued succeeds, spends zero, and still costs the transaction fee.

Contract errors the card translates:

  • MINIMUM_ACCOUNTS_THRESHOLD_NOT_REACHED and MINIMUM_OF_4_ACCOUNTS_SHALL_BUY both render as "you need 4 direct invitees who each spent at least 10 AE in token sales". If you see this while the bar shows 4/4, reload: the on-chain state and the cached UI have diverged.
  • A Key does not exist or Maps: error from get_unique_invitee means the contract has no entry for your address yet. The card treats that as zero progress. It is the normal state for an account that has never invited anyone.

An invite link's AE gift: claimed by the link, not by you

When someone opens an invite link, the app reads invite_code out of the URL fragment, reconstructs a one-time account from the secret it contains, and shows a claim card with the funded amount and who sent it.

Pressing Claim reward calls redeem_invitation_code(<your wallet address>) signed by the invite's one-time key, not by your wallet. That is why the inviter funds a redemption_fee_cover alongside the gift: the one-time account needs enough AE to pay for its own redemption transaction. Your wallet only has to be connected so the contract knows where to send the AE and whom to attach to the affiliation tree.

ErrorWhat happened
ALREADY_REDEEMEDThe link was already claimed. The card also detects this up front by reading the third field of get_invitation_code.
INVITEE_ALREADY_REGISTEREDYour wallet address is already attached to an inviter. One account can only be invited once.
INVITER_EQUAL_INVITEEYou are redeeming your own code into your own wallet.
Trying to call undefined functionYou are on the wrong network: the treasury at that address does not exist on the network your wallet is set to.
A message mentioning Secret keyThe secret in the link is in a format the SDK cannot load. The link is malformed or truncated.

If you are the inviter and you open your own link, the card switches to Revoke invitation instead of Claim, and calls revoke_invitation_code with your wallet. Revoking returns the invitation_amount to you. An unclaimed invite link does not expire; it stays claimable until you revoke it.

Related