openPack

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

Example

import { sendTransaction } from "thirdweb";
import { openPack } from "thirdweb/extensions/pack";
const transaction = openPack({
contract,
packId: ...,
amountToOpen: ...,
overrides: {
...
}
});
// Send the transaction
await sendTransaction({ transaction, account });
function openPack(
OpenPackParams | { asyncParams: () => Promise<OpenPackParams> }
>,

Parameters

The options for the "openPack" function.

Type

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

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A prepared transaction object.