This mutation to create the group with rules for gating.
Sample mutation
mutation createTokenGatingRule($input: gatingInput!) {
createTokenGatingRule(input: $input) {
id
groupName
networkID
organizationID
rules {
id
gatingGroupId
ruleType
rules {
... on ContractAddressGatingRes {
contractAddress
}
... on ContractAddressWithTokenIDGatingRes {
contractAddress
tokenID
}
... on MetaDataGatingRes {
metaData {
key
value
}
}
... on OnchainGatingRes {
onchain
}
}
}
}
}
Sample variable
change parameter such rule depends on the ruleType
.
RuleType: MetaData
{
"input": {
"orgID": "5eb26a32-2a2f-4f4a-88fa-e92fad02b67d",
"networkId": "b260424b-bb37-4a3e-86d0-0866175e5e68",
"groupName": "test claimable gating",
"groupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"rule": {
"ruleType": "MetaData",
"metaData": {
"metaData": [
{
"key": "name",
"value": "Milady 1"
},
{
"key": "description",
"value": "Milady Maker is a collection of 10,000 generative pfpNFT's in a neochibi aesthetic inspired by street style tribes."
}
]
}
}
}
}
RuleType: ContractAddress
{
"input": {
"orgID": "5eb26a32-2a2f-4f4a-88fa-e92fad02b67d",
"networkId": "b260424b-bb37-4a3e-86d0-0866175e5e68",
"groupName": "test claimable gating",
"groupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"rule": {
"ruleType": "ContractAddress",
"contractAddress": {
"contractAddress": "0x111b2885e22DdAF7150889f967cdEA8039c0c1f9"
}
}
}
}
RuleType: ContractAddressWithTokenID
{
"input": {
"orgID": "5eb26a32-2a2f-4f4a-88fa-e92fad02b67d",
"networkId": "b260424b-bb37-4a3e-86d0-0866175e5e68",
"groupName": "test claimable gating",
"groupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"rule": {
"ruleType": "ContractAddressWithTokenID",
"contractAddressWithTokenId": {
"contractAddress": "0x12591b90d5634e93732a15ba3391d34834f78bd9",
"tokenID": 4
}
}
}
}
RuleType: onChain
{
"input": {
"orgID": "5eb26a32-2a2f-4f4a-88fa-e92fad02b67d",
"networkId": "b260424b-bb37-4a3e-86d0-0866175e5e68",
"groupName": "test claimable gating",
"groupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"rule": {
"ruleType": "Onchain",
"onchain": {
"onchain": "ONCHAIN"
}
}
}
}
Sample response
{
"data": {
"createTokenGatingRule": {
"id": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"groupName": "test claimable gating",
"networkID": "b260424b-bb37-4a3e-86d0-0866175e5e68",
"organizationID": "5eb26a32-2a2f-4f4a-88fa-e92fad02b67d",
"rules": [
{
"id": "86573fd5-0626-4d3d-9f4d-e944d5176103",
"gatingGroupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"ruleType": "ContractAddressWithTokenID",
"rules": {
"contractAddress": "0x12591b90d5634e93732a15ba3391d34834f78bd9",
"tokenID": 4
}
},
{
"id": "784f7822-4a13-4cb1-9c2a-3af074e82e10",
"gatingGroupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"ruleType": "ContractAddress",
"rules": {
"contractAddress": "0x12591b90d5634e93732a15ba3391d34834f78bd9"
}
},
{
"id": "8679efca-5732-4f1f-b46e-d2842530c28f",
"gatingGroupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"ruleType": "ContractAddress",
"rules": {
"contractAddress": "0x111b2885e22DdAF7150889f967cdEA8039c0c1f9"
}
},
{
"id": "c6d2a752-0e32-4aa6-a878-7ff80a95c739",
"gatingGroupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"ruleType": "MetaData",
"rules": {
"metaData": [
{
"key": "name",
"value": "Milady 1"
},
{
"key": "description",
"value": "Milady Maker is a collection of 10,000 generative pfpNFT's in a neochibi aesthetic inspired by street style tribes."
}
]
}
},
{
"id": "0ae30f23-5b46-4fbb-976c-dc80dd25c2b4",
"gatingGroupId": "7dae2ad9-d67d-484c-9f90-3135f7f2d83a",
"ruleType": "Onchain",
"rules": {
"onchain": "ONCHAIN"
}
}
]
}
}
}
Arguments
Name | Type | Description |
---|---|---|
input | Object | Contains all the information about from gatingInput |
Fields
Name | Type | Description |
---|---|---|
GatingGroups | Object | Contains information about from GatingGroups such as group name, group id, rules and etc.. |