createPack

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

Example

import { sendTransaction } from "thirdweb";
import { createPack } from "thirdweb/extensions/pack";
const transaction = createPack({
contract,
contents: ...,
numOfRewardUnits: ...,
packUri: ...,
openStartTimestamp: ...,
amountDistributedPerOpen: ...,
recipient: ...,
overrides: {
...
}
});
// Send the transaction
await sendTransaction({ transaction, account });
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.