checkTokenGating

This query to validate the buyer is eligible for given gating rule.

Sample query

query checkTokenGating(
  $groupID: UUID1!
  $ruleID: UUID1
  $buyerAddress: String
) {
  checkTokenGating(
    groupID: $groupID
    ruleID: $ruleID
    buyerAddress: $buyerAddress
  ) {
    isGated
    eligibleTokens
    message
    walletAddress
    gatedTokens {
      id
      gatingRuleId
      title
      description
      tokenURI
      tokenType
      contractName
      contractAddress
      metadata {
        name
        description
        image
        attributes {
          traitType
          value {
            ... on AttributeValueString {
              stringValue
            }
            ... on AttributeValueInt {
              intValue
            }
            ... on AttributeValueBool {
              boolValue
            }
            ... on AttributeValueFloat {
              floatValue
            }
          }
        }
        animationURL
        openSeaImageURL
      }
    }
  }
}

Sample variable

{
  "groupID": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
  "ruleID": "784f7822-4a13-4cb1-9c2a-3af074e82e10",
  "buyerAddress": "0xaDE04b0544e25A8C23f0a57aE0b61caC8B5bfd11"
}

Sample response

if the buyer tokens don't match the given gating rules it will return the response likeisGated=true and gatedTokens=[]

{
  "data": {
    "checkTokenGating": {
      "isGated": true,
      "eligibleTokens": 3,
      "message": "gated",
      "walletAddress": "0xaDE04b0544e25A8C23f0a57aE0b61caC8B5bfd11",
      "gatedTokens": [
        {
          "id": "1",
          "gatingRuleId": "784f7822-4a13-4cb1-9c2a-3af074e82e10",
          "title": "token1",
          "description": "token1",
          "tokenURI": "https://arweave.net/brJspcBMsJpswIpCC_nm3ppGYFlwdRabZkhntiBJr5I",
          "tokenType": "ERC721",
          "contractName": "delayed reveal mint test 07 july",
          "contractAddress": "0x12591b90d5634e93732a15ba3391d34834f78bd9",
          "metadata": {
            "name": "token1",
            "description": "token1",
            "image": "https://gateway.arweave.net/O5x0CRTMAS3ZwJ6EFRPhyLELmtjmGJ5TBbrCUG9A8Tk",
            "attributes": [],
            "animationURL": "",
            "openSeaImageURL": ""
          }
        },
        {
          "id": "2",
          "gatingRuleId": "784f7822-4a13-4cb1-9c2a-3af074e82e10",
          "title": "token2",
          "description": "token2",
          "tokenURI": "https://arweave.net/36vXTBI3X2cfdEghNN8ZR1jQPClz1D5s3ZHHmutVnY0",
          "tokenType": "ERC721",
          "contractName": "delayed reveal mint test 07 july",
          "contractAddress": "0x12591b90d5634e93732a15ba3391d34834f78bd9",
          "metadata": {
            "name": "token2",
            "description": "token2",
            "image": "https://gateway.arweave.net/xjFXOSchH8GtanXEuXFPXSmuf7hcOYjixLemCdZCazQ",
            "attributes": [],
            "animationURL": "",
            "openSeaImageURL": ""
          }
        },
        {
          "id": "3",
          "gatingRuleId": "784f7822-4a13-4cb1-9c2a-3af074e82e10",
          "title": "token3",
          "description": "token3",
          "tokenURI": "https://arweave.net/HlAMq26AACttAst7Ux-wXvxF-oOJznhwNgpBOSmsPLs/3",
          "tokenType": "ERC721",
          "contractName": "delayed reveal mint test 07 july",
          "contractAddress": "0x12591b90d5634e93732a15ba3391d34834f78bd9",
          "metadata": {
            "name": "token3",
            "description": "token3",
            "image": "https://gateway.arweave.net/hGb50BBPVzN4TpGSW4Q830KCZImD98WujvoIY9scas8",
            "attributes": [],
            "animationURL": "",
            "openSeaImageURL": ""
          }
        }
      ]
    }
  }
}

Arguments

if the rule is not passed in the parameter it will check all the rules against the group.

NameTypeDescriptionRequired
groupIDUUIDThe group is - set of rules in the groupYes
ruleIDUUIDThe rule id like metadata, contract address, contract address with token id, on chainNo
buyerAddressStringThe buyer's wallet addressNo

Fields

NameTypeDescription
GatedTokensObjectContains all information from GatedTokens such as is gated and token details.