đŸ“ŦXMTP

Learn how check if a solana address has enabled XMTP or not.

Table Of Contents

In this guide, you will learn how to use Airstack to check if a Solana address has XMTP enabled.

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.

Check Solana Address Has XMTP Enabled

Simply use the following query to check if a solana address has enabled XMTP or not with this example of a user that has an XMTP:

Try Demo

Code

query MyQuery {
  XMTPs(
    input: {
      blockchain: ALL
      filter: { owner: { _eq: "GJQUFnCu7ZJHxtxeaeskjnqyx8QFAN1PsiGuShDMPsqV" } }
    }
  ) {
    XMTP {
      isXMTPEnabled
    }
  }
}

Developer Support

If you have any questions or need help regarding checking whether a solana address has XMTP enabled or not, please join our Airstack's Telegram group.

More Resources

Last updated

Was this helpful?