🔏Farcaster Moxie Claim Details

Learn how to fetch user's Moxie claim details, which includes data such as the amount of Moxie that user has claimed, is claimable by user, or still in the claiming process.

Moxie provide everyday rewards for users on Farcaster and through Moxie's cast action, user is able to claim these rewards every 24 hour periods.

With the FarcasterMoxieClaimDetails API, you will be able to get the claim details of a Farcaster user broken down to, claimable amount, claimed amount, and processed amount.

For more details, check out the use cases below.

Table Of Contents

Pre-requisites

  • An Airstack account

  • Basic knowledge of GraphQL

Get Started

JavaScript/TypeScript/Python

If you are using JavaScript/TypeScript or Python, Install the Airstack SDK:

React

npm install @airstack/airstack-react

Node

npm install @airstack/node

Then, add the following snippets to your code:

import { init, useQuery } from "@airstack/airstack-react";

init("YOUR_AIRSTACK_API_KEY");

const query = `YOUR_QUERY`; // Replace with GraphQL Query

const Component = () => {
  const { data, loading, error } = useQuery(query);

  if (data) {
    return <p>Data: {JSON.stringify(data)}</p>;
  }

  if (loading) {
    return <p>Loading...</p>;
  }

  if (error) {
    return <p>Error: {error.message}</p>;
  }
};

Other Programming Languages

To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.

Get The Accumulated Amount Oof Moxie Everyday Rewards Claimable by Certain User

You can use FarcasterMoxieClaimDetails to fetch the amount of Moxie claimable by a certain Farcaster user by providing the FID of the user to the fid input filter:

Try Demo

Show me the amount of Moxie available for claim for FID 602

Code

query MyQuery {
  FarcasterMoxieClaimDetails(
    input: {
      filter: {
        fid: {
          _eq: "602" # Specify user's FID here
        }
      },
      blockchain: ALL
    }
  ) {
    FarcasterMoxieClaimDetails {
      availableClaimAmount
      availableClaimAmountInWei
    }
  }
}

Get The Total Amount If Moxie Everyday Rewards Claimed By Certain User

You can use FarcasterMoxieClaimDetails to fetch the amount of Moxie claimed by a certain Farcaster user by providing the FID of the user to the fid input filter:

Try Demo

Show me the amount of Moxie claimed by FID 602

Code

query MyQuery {
  FarcasterMoxieClaimDetails(
    input: {
      filter: {
        fid: {
          _eq: "602" # Specify user's FID here
        }
      },
      blockchain: ALL
    }
  ) {
    FarcasterMoxieClaimDetails {
      claimedAmount
      claimedAmountInWei
    }
  }
}

Get The Amount Of Moxie In Process Of Being Claimed By Certain User

You can use FarcasterMoxieClaimDetails to fetch the amount of Moxie in the process of being claimed by a certain Farcaster user by providing the FID of the user to the fid input filter:

If you have Moxie stuck in the claimed process for a very long time, feel free to reach out to the Airstack team at /airstack Warpcast channel.

Try Demo

Show me the amount of Moxie in process of being claimed by FID 602

Code

query MyQuery {
  FarcasterMoxieClaimDetails(
    input: {
      filter: {
        fid: {
          _eq: "602" # Specify user's FID here
        }
      },
      blockchain: ALL
    }
  ) {
    FarcasterMoxieClaimDetails {
      processingAmount
      processingAmountInWei
    }
  }
}

Developer Support

If you have any questions or need help regarding fetching Moxie claim details of Farcaster users, please join our Airstack's Telegram group.

More Resources

Last updated

Was this helpful?

#946:

Change request updated