packOpenedEvent

Creates an event object for the PackOpened event.

Example

import { getContractEvents } from "thirdweb";
import { packOpenedEvent } from "thirdweb/extensions/erc1155";
const events = await getContractEvents({
contract,
events: [
packOpenedEvent({
packId: ...,
opener: ...,
})
],
});
function packOpenedEvent(
filters: Partial<{ opener: string; packId: bigint }>,
readonly inputs: readonly [
{
readonly indexed: true;
readonly name: "packId";
readonly type: "uint256";
},
{
readonly indexed: true;
readonly name: "opener";
readonly type: "address";
},
{ readonly name: "numOfPacksOpened"; readonly type: "uint256" },
{
readonly components: readonly [
{ readonly name: "assetContract"; readonly type: "address" },
{ readonly name: "tokenType"; readonly type: "uint8" },
{ readonly name: "tokenId"; readonly type: "uint256" },
{ readonly name: "totalAmount"; readonly type: "uint256" },
];
readonly name: "rewardUnitsDistributed";
readonly type: "tuple[]";
},
];
readonly name: "PackOpened";
readonly type: "event";
}>;

Parameters

Optional filters to apply to the event.

Type

let filters: Partial<{ opener: string; packId: bigint }>;

Returns

let returnType: PreparedEvent<{
readonly inputs: readonly [
{
readonly indexed: true;
readonly name: "packId";
readonly type: "uint256";
},
{
readonly indexed: true;
readonly name: "opener";
readonly type: "address";
},
{ readonly name: "numOfPacksOpened"; readonly type: "uint256" },
{
readonly components: readonly [
{ readonly name: "assetContract"; readonly type: "address" },
{ readonly name: "tokenType"; readonly type: "uint8" },
{ readonly name: "tokenId"; readonly type: "uint256" },
{ readonly name: "totalAmount"; readonly type: "uint256" },
];
readonly name: "rewardUnitsDistributed";
readonly type: "tuple[]";
},
];
readonly name: "PackOpened";
readonly type: "event";
}>;

The prepared event object.