đŦCheck Multiple Users
Learn how to use Airstack to check if multiple users have XMTP or not.
To check multiple users if they have XMTP is similar to checking for single users.
Swap _eq
comparator with _in
to allow array inputs:
query MyQuery($addresses: [Identity!]) {
XMTPs(input: {blockchain: ALL, filter: {owner: {_in: $addresses}}}) {
XMTP {
isXMTPEnabled
owner {
addresses
domains {
name
}
socials {
dappName
profileName
}
}
}
}
}
{
"addresses": [
"0xa91c2d10a993d14f842d23b97f2ab3fdf6b5b9aa",
"shanemac.eth",
"vitalik.lens"
]
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true,
"owner": {
"addresses": [
"0xa64af7f78de39a238ecd4fff7d6d410dbace2df0"
],
"domains": [
{
"name": "shanemac.eth"
}
],
"socials": [
{
"dappName": "farcaster",
"profileName": "shanemac"
},
{
"dappName": "lens",
"profileName": "shanemac.lens"
}
]
}
},
{
"isXMTPEnabled": true,
"owner": {
"addresses": [
"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
],
"domains": [
{
"name": "satoshinart.eth"
}
],
"socials": [
{
"dappName": "farcaster",
"profileName": "vbuterin"
},
{
"dappName": "lens",
"profileName": "vitalik.lens"
}
]
}
},
{
"isXMTPEnabled": true,
"owner": {
"addresses": [
"0xa91c2d10a993d14f842d23b97f2ab3fdf6b5b9aa"
],
"domains": [],
"socials": null
}
}
]
}
}
}
The response will return fewer amount of element in the XMTP
array if some of the owner
input has no XMTP.
Therefore, you can use owner
field response to double check if in more details if a specific user has XMTP or not.
Bulk Check Lens Profiles Have XMTP
Try Demo
Code
query BulkFetchLensProfilesHaveXMTP($lens: [Identity!]) {
XMTPs(input: {blockchain: ALL, filter: {owner: {_in: $lens}}, limit: 100}) {
XMTP {
isXMTPEnabled
owner {
socials {
dappName
profileName
}
}
}
pageInfo {
nextCursor
prevCursor
}
}
}
{
"lens": [
"hoobastank.lens",
"22776.lens",
"barisadiguzel.lens"
]
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true,
"owner": {
"socials": [
{
"dappName": "lens",
"profileName": "hoobastank.lens"
}
]
}
},
{
"isXMTPEnabled": true,
"owner": {
"socials": [
{
"dappName": "lens",
"profileName": "22776.lens"
}
]
}
},
{
"isXMTPEnabled": true,
"owner": {
"socials": [
{
"dappName": "lens",
"profileName": "barisadiguzel.lens"
}
]
}
}
],
"pageInfo": {
"nextCursor": "",
"prevCursor": ""
}
}
}
}
Bulk Check Farcasters Have XMTP
Try Demo
Code
query BulkFetchFarcasterHaveXMTP($farcaster: [Identity!]) {
XMTPs(input: {blockchain: ALL, filter: {owner: {_in: $farcaster}}, limit: 100}) {
XMTP {
isXMTPEnabled
owner {
socials {
dappName
profileName
}
}
}
pageInfo {
nextCursor
prevCursor
}
}
}
{
"farcaster": [
"fc_fname:vbuterin",
"fc_fname:v",
"fc_fid:602"
]
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true,
"owner": {
"socials": [
{
"dappName": "farcaster",
"profileName": "vbuterin"
},
{
"dappName": "lens",
"profileName": "vitalik.lens"
}
],
"addresses": [
"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
]
}
},
{
"isXMTPEnabled": true,
"owner": {
"socials": [
{
"dappName": "farcaster",
"profileName": "v"
}
],
"addresses": [
"0x182327170fc284caaa5b1bc3e3878233f529d741"
]
}
},
{
"isXMTPEnabled": true,
"owner": {
"socials": [
{
"dappName": "farcaster",
"profileName": "betashop"
},
{
"dappName": "lens",
"profileName": "betashop9.lens"
}
],
"addresses": [
"0xeaf55242a90bb3289db8184772b0b98562053559"
]
}
}
],
"pageInfo": {
"nextCursor": "",
"prevCursor": ""
}
}
}
}
Last updated