Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tame-walls-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Adds the ability to override transaction values in createNewPack
11 changes: 8 additions & 3 deletions packages/thirdweb/src/extensions/pack/createNewPack.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type { ThirdwebClient } from "../../client/client.js";
import { type ThirdwebContract, getContract } from "../../contract/contract.js";
import { upload } from "../../storage/upload.js";
import type { BaseTransactionOptions } from "../../transaction/types.js";
import type {
BaseTransactionOptions,
WithOverrides,
} from "../../transaction/types.js";
import type { NFTInput } from "../../utils/nft/parseNft.js";
import { toUnits } from "../../utils/units.js";
import type { AddPackContentsParams } from "./__generated__/IPack/write/addPackContents.js";
Expand Down Expand Up @@ -114,7 +117,7 @@
* ```
*/
export function createNewPack(
options: BaseTransactionOptions<CreateNewPackParams>,
options: WithOverrides<BaseTransactionOptions<CreateNewPackParams>>,

Check warning on line 120 in packages/thirdweb/src/extensions/pack/createNewPack.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/extensions/pack/createNewPack.ts#L120

Added line #L120 was not covered by tests
) {
return createPack({
contract: options.contract,
Expand All @@ -126,7 +129,7 @@
* @internal
*/
async function getCreatePackParams(
options: BaseTransactionOptions<CreateNewPackParams>,
options: WithOverrides<BaseTransactionOptions<CreateNewPackParams>>,

Check warning on line 132 in packages/thirdweb/src/extensions/pack/createNewPack.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/extensions/pack/createNewPack.ts#L132

Added line #L132 was not covered by tests
): Promise<CreatePackParams> {
const {
contract,
Expand All @@ -138,6 +141,7 @@
erc721Rewards,
erc1155Rewards,
tokenOwner,
overrides,

Check warning on line 144 in packages/thirdweb/src/extensions/pack/createNewPack.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/extensions/pack/createNewPack.ts#L144

Added line #L144 was not covered by tests
} = options;
const [erc20Content, erc721Content, erc1155Content, packUri] =
await Promise.all([
Expand Down Expand Up @@ -179,6 +183,7 @@
// openStartTimestamp should be in seconds and not millisecond
openStartTimestamp: BigInt(Math.ceil(openStartTimestamp.getTime() / 1000)),
amountDistributedPerOpen,
overrides,

Check warning on line 186 in packages/thirdweb/src/extensions/pack/createNewPack.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/extensions/pack/createNewPack.ts#L186

Added line #L186 was not covered by tests
};
}

Expand Down
Loading