UNPKG

@wasserstoff/tribes-sdk

Version:

SDK for integrating with Tribes by Astrix platform on any EVM compatible chain

1,762 lines (1,761 loc) 44 kB
[ { "inputs": [ { "internalType": "address", "name": "_roleManager", "type": "address" }, { "internalType": "address", "name": "_tribeController", "type": "address" }, { "internalType": "address", "name": "_collectibleController", "type": "address" }, { "internalType": "address", "name": "_feedManager", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" } ], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "AlreadyInteracted", "type": "error" }, { "inputs": [], "name": "AlreadyReported", "type": "error" }, { "inputs": [], "name": "BatchCooldownActive", "type": "error" }, { "inputs": [], "name": "BatchLimitExceeded", "type": "error" }, { "inputs": [], "name": "CannotInteractWithOwnPost", "type": "error" }, { "inputs": [], "name": "CooldownActive", "type": "error" }, { "inputs": [], "name": "EmptyMetadata", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "InsufficientAccess", "type": "error" }, { "inputs": [], "name": "InvalidCollectible", "type": "error" }, { "inputs": [], "name": "InvalidCollectibleContract", "type": "error" }, { "inputs": [], "name": "InvalidEncryptionKey", "type": "error" }, { "inputs": [], "name": "InvalidJsonFormat", "type": "error" }, { "inputs": [], "name": "InvalidMetadata", "type": "error" }, { "inputs": [], "name": "InvalidParentPost", "type": "error" }, { "inputs": [], "name": "InvalidPostType", "type": "error" }, { "inputs": [], "name": "InvalidSigner", "type": "error" }, { "inputs": [], "name": "MissingContentField", "type": "error" }, { "inputs": [], "name": "MissingTitleField", "type": "error" }, { "inputs": [], "name": "NotPostCreator", "type": "error" }, { "inputs": [], "name": "NotTribeAdmin", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "status", "type": "uint256" } ], "name": "NotTribeMember", "type": "error" }, { "inputs": [], "name": "PostDeleted", "type": "error" }, { "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "creator", "type": "address" }, { "indexed": false, "internalType": "uint256[]", "name": "postIds", "type": "uint256[]" } ], "name": "BatchPostsCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "creator", "type": "address" }, { "indexed": false, "internalType": "string", "name": "metadata", "type": "string" }, { "indexed": false, "internalType": "bytes32", "name": "encryptionKeyHash", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "accessSigner", "type": "address" } ], "name": "EncryptedPostCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "creator", "type": "address" }, { "indexed": false, "internalType": "string", "name": "metadata", "type": "string" } ], "name": "PostCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "deleter", "type": "address" } ], "name": "PostDeleted", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "enum IPostMinter.InteractionType", "name": "interactionType", "type": "uint8" } ], "name": "PostInteraction", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "reporter", "type": "address" }, { "indexed": false, "internalType": "string", "name": "reason", "type": "string" } ], "name": "PostReported", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "enum IPostMinter.PostType", "name": "postType", "type": "uint8" }, { "indexed": false, "internalType": "uint256", "name": "cooldown", "type": "uint256" } ], "name": "PostTypeCooldownUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "updater", "type": "address" }, { "indexed": false, "internalType": "string", "name": "metadata", "type": "string" } ], "name": "PostUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } ], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } ], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } ], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "creator", "type": "address" }, { "indexed": false, "internalType": "string", "name": "metadata", "type": "string" }, { "indexed": false, "internalType": "bytes32", "name": "encryptionKeyHash", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "accessSigner", "type": "address" }, { "indexed": false, "internalType": "address", "name": "collectibleContract", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "collectibleId", "type": "uint256" } ], "name": "SignatureGatedPostCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "keyHash", "type": "bytes32" } ], "name": "TribeKeyUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" } ], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "postId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "viewer", "type": "address" } ], "name": "ViewerAuthorized", "type": "event" }, { "inputs": [], "name": "BATCH_POST_COOLDOWN", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_BATCH_POSTS", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PROJECT_CREATOR_ROLE", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "RATE_LIMIT_MANAGER_ROLE", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "REPORT_THRESHOLD", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "address", "name": "viewer", "type": "address" } ], "name": "authorizeViewer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "address", "name": "viewer", "type": "address" } ], "name": "canViewPost", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "collectibleController", "outputs": [ { "internalType": "contract ICollectibleController", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "components": [ { "internalType": "string", "name": "metadata", "type": "string" }, { "internalType": "bool", "name": "isGated", "type": "bool" }, { "internalType": "address", "name": "collectibleContract", "type": "address" }, { "internalType": "uint256", "name": "collectibleId", "type": "uint256" }, { "internalType": "enum IPostMinter.PostType", "name": "postType", "type": "uint8" } ], "internalType": "struct IPostMinter.BatchPostData[]", "name": "posts", "type": "tuple[]" } ], "name": "createBatchPosts", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "string", "name": "metadata", "type": "string" }, { "internalType": "bytes32", "name": "encryptionKeyHash", "type": "bytes32" }, { "internalType": "address", "name": "accessSigner", "type": "address" } ], "name": "createEncryptedPost", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "string", "name": "metadata", "type": "string" }, { "internalType": "bool", "name": "isGated", "type": "bool" }, { "internalType": "address", "name": "collectibleContract", "type": "address" }, { "internalType": "uint256", "name": "collectibleId", "type": "uint256" } ], "name": "createPost", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "parentPostId", "type": "uint256" }, { "internalType": "string", "name": "metadata", "type": "string" }, { "internalType": "bool", "name": "isGated", "type": "bool" }, { "internalType": "address", "name": "collectibleContract", "type": "address" }, { "internalType": "uint256", "name": "collectibleId", "type": "uint256" } ], "name": "createReply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "string", "name": "metadata", "type": "string" }, { "internalType": "bytes32", "name": "encryptionKeyHash", "type": "bytes32" }, { "internalType": "address", "name": "accessSigner", "type": "address" }, { "internalType": "address", "name": "collectibleContract", "type": "address" }, { "internalType": "uint256", "name": "collectibleId", "type": "uint256" } ], "name": "createSignatureGatedPost", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" } ], "name": "deletePost", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "address", "name": "member", "type": "address" } ], "name": "deriveSharedKey", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feedManager", "outputs": [ { "internalType": "contract PostFeedManager", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" } ], "name": "generatePostKey", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getBatchPostingLimits", "outputs": [ { "internalType": "uint256", "name": "maxBatchSize", "type": "uint256" }, { "internalType": "uint256", "name": "batchCooldown", "type": "uint256" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint256", "name": "offset", "type": "uint256" }, { "internalType": "uint256", "name": "limit", "type": "uint256" } ], "name": "getFeedForUser", "outputs": [ { "internalType": "uint256[]", "name": "postIds", "type": "uint256[]" }, { "internalType": "uint256", "name": "total", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "enum IPostMinter.InteractionType", "name": "interactionType", "type": "uint8" } ], "name": "getInteractionCount", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" } ], "name": "getPost", "outputs": [ { "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "address", "name": "creator", "type": "address" }, { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "string", "name": "metadata", "type": "string" }, { "internalType": "bool", "name": "isGated", "type": "bool" }, { "internalType": "address", "name": "collectibleContract", "type": "address" }, { "internalType": "uint256", "name": "collectibleId", "type": "uint256" }, { "internalType": "bool", "name": "isEncrypted", "type": "bool" }, { "internalType": "address", "name": "accessSigner", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "address", "name": "viewer", "type": "address" } ], "name": "getPostDecryptionKey", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" } ], "name": "getPostReplies", "outputs": [ { "internalType": "uint256[]", "name": "", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "enum IPostMinter.PostType", "name": "postType", "type": "uint8" } ], "name": "getPostTypeCooldown", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "uint256", "name": "offset", "type": "uint256" }, { "internalType": "uint256", "name": "limit", "type": "uint256" } ], "name": "getPostsByTribe", "outputs": [ { "internalType": "uint256[]", "name": "postIds", "type": "uint256[]" }, { "internalType": "uint256", "name": "total", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint256", "name": "offset", "type": "uint256" }, { "internalType": "uint256", "name": "limit", "type": "uint256" } ], "name": "getPostsByTribeAndUser", "outputs": [ { "internalType": "uint256[]", "name": "postIds", "type": "uint256[]" }, { "internalType": "uint256", "name": "total", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint256", "name": "offset", "type": "uint256" }, { "internalType": "uint256", "name": "limit", "type": "uint256" } ], "name": "getPostsByUser", "outputs": [ { "internalType": "uint256[]", "name": "postIds", "type": "uint256[]" }, { "internalType": "uint256", "name": "total", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" }, { "internalType": "enum IPostMinter.PostType", "name": "postType", "type": "uint8" } ], "name": "getRemainingCooldown", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "role", "type": "bytes32" } ], "name": "getRoleAdmin", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" } ], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" } ], "name": "hasRole", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "enum IPostMinter.InteractionType", "name": "interactionType", "type": "uint8" } ], "name": "interactWithPost", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "lastBatchTime", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "enum IPostMinter.PostType", "name": "", "type": "uint8" } ], "name": "lastPostTimeByType", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "nextPostId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "enum IPostMinter.PostType", "name": "", "type": "uint8" } ], "name": "postTypeCooldowns", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" } ], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "reportCount", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "string", "name": "reason", "type": "string" } ], "name": "reportPost", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" } ], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "roleManager", "outputs": [ { "internalType": "contract IRoleManager", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "enum IPostMinter.PostType", "name": "postType", "type": "uint8" }, { "internalType": "uint256", "name": "cooldown", "type": "uint256" } ], "name": "setPostTypeCooldown", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tribeId", "type": "uint256" }, { "internalType": "bytes32", "name": "encryptionKey", "type": "bytes32" } ], "name": "setTribeEncryptionKey", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "testCreate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "tribeController", "outputs": [ { "internalType": "contract ITribeController", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "tribeEncryptionKeys", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "string", "name": "metadata", "type": "string" } ], "name": "updatePost", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "metadata", "type": "string" }, { "internalType": "enum IPostMinter.PostType", "name": "postType", "type": "uint8" } ], "name": "validateMetadata", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "postId", "type": "uint256" }, { "internalType": "address", "name": "viewer", "type": "address" }, { "internalType": "bytes", "name": "signature", "type": "bytes" } ], "name": "verifyPostAccess", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" } ]