module

Convenience function to add the RoyaltyERC1155 module as a default module on a core contract.

Example

import { RoyaltyERC1155, deployModularContract } from "thirdweb/modules";
const deployed = deployModularContract({
client,
chain,
account,
core: "ERC1155",
params: {
name: "My Modular Contract",
},
modules: [
RoyaltyERC1155.module({
royaltyRecipient: ...,
royaltyBps: ...,
transferValidator: ...,
}),
],
});
function module(
params: EncodeBytesOnInstallParams & { publisher?: string },
): (args: {
account: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;

Parameters

The parameters for the module.

Type

let params: EncodeBytesOnInstallParams & { publisher?: string };

Returns

let returnType: (args: {
account: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
}) => Promise<{ data: `0x${string}`; module: `0x${string}` }>;
  • The module function.