createPack

Prepares a transaction to call the "createPack" function on the contract.

Example

import { createPack } from "thirdweb/extensions/erc1155";
const transaction = createPack({
contract,
contents: ...,
numOfRewardUnits: ...,
packUri: ...,
openStartTimestamp: ...,
amountDistributedPerOpen: ...,
recipient: ...,
overrides: {
...
}
});
// Send the transaction
...
function createPack(
| { asyncParams: () => Promise<CreatePackParams> }
>,

Parameters

The options for the "createPack" function.

Type

CreatePackParams | { asyncParams: () => Promise<CreatePackParams> }
>;

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A prepared transaction object.