import { ERC1155ContractError, EVMAccountAddress, TokenId, TokenUri, BlockchainCommonErrors, DomainName, TokenAmount, EVMContractAddress } from "@snickerdoodlelabs/objects"; import { ethers } from "ethers"; import { ResultAsync } from "neverthrow"; import { ERewardRoles } from "../interfaces/enums"; import { IBaseContract } from "../interfaces/IBaseContract.js"; import { ContractOverrides, WrappedTransactionResponse } from "../interfaces/objects"; export interface IERC1155RewardContract extends IBaseContract { getOwner(): ResultAsync; getDefaultAdminRoleMembers(): ResultAsync; getMinterRoleMembers(): ResultAsync; /** * Returns the balance for a given token id for an address * */ balanceOf(address: EVMAccountAddress | EVMContractAddress, tokenId: TokenId): ResultAsync; /** * Returns the balances for a list of token ids and addresses * */ balanceOfBatch(addresses: EVMAccountAddress[] | EVMContractAddress[], tokenIds: TokenId[]): ResultAsync; /** * Returns the token uri for a specific token Id * @param tokenId token Id */ tokenURI(tokenId: TokenId): ResultAsync; /** * Sets a new URI for a given token id on the Reward contract * Only callable by addresses that have the DEFAULT_ADMIN_ROLE on the Reward contract */ setTokenURI(tokenId: TokenId, newURI: TokenUri, overrides?: ContractOverrides): ResultAsync; /** * Checks if an address has a specific role in the Reward contract * @param role string that is a key defined in RewardRoles enum * @param address Address to use */ hasRole(role: keyof typeof ERewardRoles, address: EVMAccountAddress): ResultAsync; /** * Grants a role to an address * @param role string that is a key defined in RewardRoles enum * @param address Address to use */ grantRole(role: keyof typeof ERewardRoles, address: EVMAccountAddress, overrides?: ContractOverrides): ResultAsync; /** * Revokes a role of an address * @param role string that is a key defined in RewardRoles enum * @param address Address to use */ revokeRole(role: keyof typeof ERewardRoles, address: EVMAccountAddress, overrides?: ContractOverrides): ResultAsync; /** * Allows an address to renounce its role * @param role string that is a key defined in RewardRoles enum * @param address Address to use */ renounceRole(role: keyof typeof ERewardRoles, address: EVMAccountAddress, overrides?: ContractOverrides): ResultAsync; /** * Adds a domain to the contract storage * Only callable by address with DEFAULT_ADMIN_ROLE * If domain already exists, reverts with error message "Reward : Domain already added" * @param domain Domain name */ addDomain(domain: DomainName, overrides?: ContractOverrides): ResultAsync; /** * Removes a domain from the contract storage * Only callable by address with DEFAULT_ADMIN_ROLE * If domain does not exist, reverts with error message "Reward : Domain is not in the list" * @param domain Domain name */ removeDomain(domain: DomainName, overrides?: ContractOverrides): ResultAsync; /** * Returns an array of domains added to the contract */ getDomains(): ResultAsync; filters: IERC1155Filters; /** * Returns if operatorToApprove is approved to transfer tokens that belong to tokenOwnerAddress */ isApprovedForAll(tokenOwnerAddress: EVMAccountAddress, operatorToApprove: EVMAccountAddress): ResultAsync; /** * Allows the token owner to approve the escrow wallet to transfer all token ids he owns on this rewards contract * NOTE: To support this, the user would need to connect their external wallet that owns the NFTs to sign the approval txs */ setApproveForAll(addressToApprove: EVMAccountAddress, approved: boolean, overrides?: ContractOverrides): ResultAsync; /** * Allows the escrow wallet to transfer NFTs to reward receiver after they have been approvedForAll by the token owner */ safeTransferFrom(from: EVMAccountAddress, to: EVMAccountAddress, tokenId: TokenId, amount: TokenAmount, data: string, overrides?: ContractOverrides): ResultAsync; /** * Allows the escrow wallet to transfer a batch of NFTs to reward receiver after they have been approvedForAll by the token owner */ safeBatchTransferFrom(from: EVMAccountAddress, to: EVMAccountAddress, tokenIds: TokenId[], amounts: TokenAmount[], data: string, overrides?: ContractOverrides): ResultAsync; /** * Returns the supply of a given token id */ totalSupply(tokenId: TokenId): ResultAsync; /** * Returns a boolean to indicate if a token id exists or not - part of ERC1155Supply extension, it checks if the totalSupply > 0 */ exists(tokenId: TokenId): ResultAsync; /** * Function for the DEFAULT_ADMIN_ROLE to create a new token id type, purpose is to add new reward types if needed * */ createNewTokens(newURIs: TokenUri[], overrides?: ContractOverrides): ResultAsync; } export interface IERC1155Filters { TransferSingle(operatorAddress: EVMAccountAddress | null, fromAddress: EVMAccountAddress | null, toAddress: EVMAccountAddress | null, tokenId: TokenId | null, value: bigint): ethers.DeferredTopicFilter; } export declare const IERC1155RewardContractType: unique symbol; //# sourceMappingURL=IERC1155RewardContract.d.ts.map