import { BasicRoleInfo, ChannelDetails, ChannelMetadata, EntitlementModuleType, Permission, PricingModuleStruct, RoleDetails, VersionedRuleData } from '../ContractTypes'; import { BytesLike, ContractReceipt, ContractTransaction, ethers } from 'ethers'; import { CreateLegacySpaceParams, CreateSpaceParams, ISpaceDapp, TransactionOpts, LegacyUpdateRoleParams, UpdateRoleParams, SetChannelPermissionOverridesParams, ClearChannelPermissionOverridesParams, RemoveChannelParams, UpdateChannelParams } from '../ISpaceDapp'; import { IRolesBase } from './IRolesShim'; import { Space } from './Space'; import { SpaceRegistrar } from './SpaceRegistrar'; import { BaseChainConfig } from '../IStaticContractsInfo'; import { WalletLink } from './WalletLink'; import { SpaceInfo } from '../types'; import { IRuleEntitlementBase, IRuleEntitlementV2Base, RiverAirdropDapp } from './index'; import { PricingModules } from './PricingModules'; import { XchainConfig } from '../entitlement'; import { PlatformRequirements } from './PlatformRequirements'; import { EntitlementCache, Keyable } from '../EntitlementCache'; import { TipEventObject } from '@river-build/generated/dev/typings/ITipping'; type EntitlementData = { entitlementType: EntitlementModuleType; ruleEntitlement: VersionedRuleData | undefined; userEntitlement: string[] | undefined; }; declare class EntitlementRequest implements Keyable { spaceId: string; channelId: string; userId: string; permission: Permission; constructor(spaceId: string, channelId: string, userId: string, permission: Permission); toKey(): string; } type EntitledWallet = string | undefined; export declare class SpaceDapp implements ISpaceDapp { private isLegacySpaceCache; readonly config: BaseChainConfig; readonly provider: ethers.providers.Provider; readonly spaceRegistrar: SpaceRegistrar; readonly pricingModules: PricingModules; readonly walletLink: WalletLink; readonly platformRequirements: PlatformRequirements; readonly airdrop: RiverAirdropDapp; readonly entitlementCache: EntitlementCache; readonly entitledWalletCache: EntitlementCache; readonly entitlementEvaluationCache: EntitlementCache; constructor(config: BaseChainConfig, provider: ethers.providers.Provider); isLegacySpace(spaceId: string): Promise; addRoleToChannel(spaceId: string, channelNetworkId: string, roleId: number, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; waitForRoleCreated(spaceId: string, txn: ContractTransaction): Promise<{ roleId: number | undefined; error: Error | undefined; }>; banWalletAddress(spaceId: string, walletAddress: string, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; unbanWalletAddress(spaceId: string, walletAddress: string, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; walletAddressIsBanned(spaceId: string, walletAddress: string): Promise; bannedWalletAddresses(spaceId: string): Promise; createLegacySpace(params: CreateLegacySpaceParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; createSpace(params: CreateSpaceParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; createChannel(spaceId: string, channelName: string, channelDescription: string, channelNetworkId: string, roleIds: number[], signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; createChannelWithPermissionOverrides(spaceId: string, channelName: string, channelDescription: string, channelNetworkId: string, roles: { roleId: number; permissions: Permission[]; }[], signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; legacyCreateRole(spaceId: string, roleName: string, permissions: Permission[], users: string[], ruleData: IRuleEntitlementBase.RuleDataStruct, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; createRole(spaceId: string, roleName: string, permissions: Permission[], users: string[], ruleData: IRuleEntitlementV2Base.RuleDataV2Struct, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; deleteRole(spaceId: string, roleId: number, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; getChannels(spaceId: string): Promise; tokenURI(spaceId: string): Promise; memberTokenURI(spaceId: string, tokenId: string): Promise; getChannelDetails(spaceId: string, channelNetworkId: string): Promise; getPermissionsByRoleId(spaceId: string, roleId: number): Promise; getRole(spaceId: string, roleId: number): Promise; getRoles(spaceId: string): Promise; getSpaceInfo(spaceId: string): Promise; updateSpaceInfo(spaceId: string, name: string, uri: string, shortDescription: string, longDescription: string, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; private decodeEntitlementData; private getEntitlementsForPermission; private getEntitlementsForPermissionUncached; private getChannelEntitlementsForPermission; private getChannelEntitlementsForPermissionUncached; getLinkedWallets(wallet: string): Promise; getLinkedWalletsWithDelegations(wallet: string): Promise; private evaluateEntitledWallet; /** * Checks if user has a wallet entitled to join a space based on the minter role rule entitlements */ getEntitledWalletForJoiningSpace(spaceId: string, rootKey: string, xchainConfig: XchainConfig): Promise; private getEntitledWalletForJoiningSpaceUncached; isEntitledToSpace(spaceId: string, user: string, permission: Permission): Promise; isEntitledToSpaceUncached(spaceId: string, user: string, permission: Permission): Promise; isEntitledToChannel(spaceId: string, channelNetworkId: string, user: string, permission: Permission, xchainConfig?: XchainConfig): Promise; isEntitledToChannelUncached(spaceId: string, channelNetworkId: string, user: string, permission: Permission, xchainConfig: XchainConfig): Promise; parseSpaceFactoryError(error: unknown): Error; parseSpaceError(spaceId: string, error: unknown): Error; /** * Attempts to parse an error against all contracts * If you're error is not showing any data with this call, make sure the contract is listed either in parseSpaceError or nonSpaceContracts * @param args * @returns */ parseAllContractErrors(args: { spaceId?: string; error: unknown; }): Error; parseSpaceLogs(spaceId: string, logs: ethers.providers.Log[]): Promise<(ethers.utils.LogDescription | undefined)[]>; updateChannel(params: UpdateChannelParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; encodedUpdateChannelData(space: Space, params: UpdateChannelParams): Promise; removeChannel(params: RemoveChannelParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; legacyUpdateRole(params: LegacyUpdateRoleParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; updateRole(params: UpdateRoleParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; getChannelPermissionOverrides(spaceId: string, roleId: number, channelNetworkId: string): Promise; setChannelPermissionOverrides(params: SetChannelPermissionOverridesParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; clearChannelPermissionOverrides(params: ClearChannelPermissionOverridesParams, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; setSpaceAccess(spaceId: string, disabled: boolean, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; /** * * @param spaceId * @param priceInWei * @param signer */ setMembershipPrice(spaceId: string, priceInWei: ethers.BigNumberish, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; setMembershipPricingModule(spaceId: string, pricingModule: string, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; setMembershipLimit(spaceId: string, limit: number, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; setMembershipFreeAllocation(spaceId: string, freeAllocation: number, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; prepayMembership(spaceId: string, supply: number, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; getPrepaidMembershipSupply(spaceId: string): Promise; setChannelAccess(spaceId: string, channelNetworkId: string, disabled: boolean, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; getSpaceMembershipTokenAddress(spaceId: string): Promise; getJoinSpacePriceDetails(spaceId: string): Promise<{ price: ethers.BigNumber; prepaidSupply: ethers.BigNumber; remainingFreeSupply: ethers.BigNumber; }>; getMembershipFreeAllocation(spaceId: string): Promise; joinSpace(spaceId: string, recipient: string, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise<{ issued: true; tokenId: string; } | { issued: false; tokenId: undefined; }>; hasSpaceMembership(spaceId: string, address: string): Promise; getMembershipSupply(spaceId: string): Promise<{ totalSupply: number; }>; getMembershipInfo(spaceId: string): Promise<{ price: ethers.BigNumber; maxSupply: number; currency: string; feeRecipient: string; duration: number; totalSupply: number; pricingModule: string; prepaidSupply: number; remainingFreeSupply: number; }>; getWalletLink(): WalletLink; getSpace(spaceId: string): Space | undefined; listPricingModules(): Promise; private encodeUpdateChannelRoles; private encodeAddRolesToChannel; private encodeRemoveRolesFromChannel; createLegacyUpdatedEntitlements(space: Space, params: LegacyUpdateRoleParams): Promise; createUpdatedEntitlements(space: Space, params: UpdateRoleParams): Promise; refreshMetadata(spaceId: string, signer: ethers.Signer, txnOpts?: TransactionOpts): Promise; /** * Get the space address from the receipt and sender address * @param receipt - The receipt from the transaction * @param senderAddress - The address of the sender. Required for the case of a receipt containing multiple events of the same type. * @returns The space address or undefined if the receipt is not successful */ getSpaceAddress(receipt: ContractReceipt, senderAddress: string): string | undefined; getTipEvent(spaceId: string, receipt: ContractReceipt, senderAddress: string): TipEventObject | undefined; withdrawSpaceFunds(spaceId: string, recipient: string, signer: ethers.Signer): Promise; listenForMembershipEvent(spaceId: string, receiver: string, abortController?: AbortController): Promise<{ issued: true; tokenId: string; error?: Error | undefined; } | { issued: false; tokenId: undefined; error?: Error | undefined; }>; /** * Get the token id for the owner * Returns the first token id matched from the linked wallets of the owner * @param spaceId - The space id * @param owner - The owner * @returns The token id */ getTokenIdOfOwner(spaceId: string, owner: string): Promise; /** * Tip a user * @param args * @param args.spaceId - The space id * @param args.tokenId - The token id to tip. Obtainable from getTokenIdOfOwner * @param args.currency - The currency to tip - address or 0xEeeeeeeeee... for native currency * @param args.amount - The amount to tip * @param args.messageId - The message id - needs to be hex encoded to 64 characters * @param args.channelId - The channel id - needs to be hex encoded to 64 characters * @param signer - The signer to use for the tip * @returns The transaction */ tip(args: { spaceId: string; tokenId: string; currency: string; amount: bigint; messageId: string; channelId: string; receiver: string; }, signer: ethers.Signer): Promise; } export {}; //# sourceMappingURL=SpaceDapp.d.ts.map