UNPKG

@towns-protocol/generated

Version:

## How to generate contract types

381 lines (377 loc) 7.57 kB
/* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ import { Contract, Signer, utils } from "ethers"; import type { Provider } from "@ethersproject/providers"; import type { IChannel, IChannelInterface } from "../IChannel"; const _abi = [ { type: "function", name: "addRoleToChannel", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, { name: "roleId", type: "uint256", internalType: "uint256", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "createChannel", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, { name: "metadata", type: "string", internalType: "string", }, { name: "roleIds", type: "uint256[]", internalType: "uint256[]", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "createChannelWithOverridePermissions", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, { name: "metadata", type: "string", internalType: "string", }, { name: "rolePermissions", type: "tuple[]", internalType: "struct IChannelBase.RolePermissions[]", components: [ { name: "roleId", type: "uint256", internalType: "uint256", }, { name: "permissions", type: "string[]", internalType: "string[]", }, ], }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "getChannel", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, ], outputs: [ { name: "channel", type: "tuple", internalType: "struct IChannelBase.Channel", components: [ { name: "id", type: "bytes32", internalType: "bytes32", }, { name: "disabled", type: "bool", internalType: "bool", }, { name: "metadata", type: "string", internalType: "string", }, { name: "roleIds", type: "uint256[]", internalType: "uint256[]", }, ], }, ], stateMutability: "view", }, { type: "function", name: "getChannels", inputs: [], outputs: [ { name: "channels", type: "tuple[]", internalType: "struct IChannelBase.Channel[]", components: [ { name: "id", type: "bytes32", internalType: "bytes32", }, { name: "disabled", type: "bool", internalType: "bool", }, { name: "metadata", type: "string", internalType: "string", }, { name: "roleIds", type: "uint256[]", internalType: "uint256[]", }, ], }, ], stateMutability: "view", }, { type: "function", name: "getRolesByChannel", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, ], outputs: [ { name: "roleIds", type: "uint256[]", internalType: "uint256[]", }, ], stateMutability: "view", }, { type: "function", name: "removeChannel", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "removeRoleFromChannel", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, { name: "roleId", type: "uint256", internalType: "uint256", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "updateChannel", inputs: [ { name: "channelId", type: "bytes32", internalType: "bytes32", }, { name: "metadata", type: "string", internalType: "string", }, { name: "disabled", type: "bool", internalType: "bool", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "event", name: "ChannelCreated", inputs: [ { name: "caller", type: "address", indexed: true, internalType: "address", }, { name: "channelId", type: "bytes32", indexed: false, internalType: "bytes32", }, ], anonymous: false, }, { type: "event", name: "ChannelRemoved", inputs: [ { name: "caller", type: "address", indexed: true, internalType: "address", }, { name: "channelId", type: "bytes32", indexed: false, internalType: "bytes32", }, ], anonymous: false, }, { type: "event", name: "ChannelRoleAdded", inputs: [ { name: "caller", type: "address", indexed: true, internalType: "address", }, { name: "channelId", type: "bytes32", indexed: false, internalType: "bytes32", }, { name: "roleId", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "ChannelRoleRemoved", inputs: [ { name: "caller", type: "address", indexed: true, internalType: "address", }, { name: "channelId", type: "bytes32", indexed: false, internalType: "bytes32", }, { name: "roleId", type: "uint256", indexed: false, internalType: "uint256", }, ], anonymous: false, }, { type: "event", name: "ChannelUpdated", inputs: [ { name: "caller", type: "address", indexed: true, internalType: "address", }, { name: "channelId", type: "bytes32", indexed: false, internalType: "bytes32", }, ], anonymous: false, }, { type: "error", name: "ChannelService__ChannelAlreadyExists", inputs: [], }, { type: "error", name: "ChannelService__ChannelDisabled", inputs: [], }, { type: "error", name: "ChannelService__ChannelDoesNotExist", inputs: [], }, { type: "error", name: "ChannelService__RoleAlreadyExists", inputs: [], }, { type: "error", name: "ChannelService__RoleDoesNotExist", inputs: [], }, ] as const; export class IChannel__factory { static readonly abi = _abi; static createInterface(): IChannelInterface { return new utils.Interface(_abi) as IChannelInterface; } static connect( address: string, signerOrProvider: Signer | Provider ): IChannel { return new Contract(address, _abi, signerOrProvider) as IChannel; } }