Skip to content

Commit 8d8b127

Browse files
committed
fit type
1 parent 0de010c commit 8d8b127

File tree

1 file changed

+9
-9
lines changed
  • src/server/routes/contract/extensions/erc721/write

1 file changed

+9
-9
lines changed

src/server/routes/contract/extensions/erc721/write/mintTo.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { FastifyInstance } from "fastify";
33
import { StatusCodes } from "http-status-codes";
44
import { getContract } from "thirdweb";
55
import { mintTo } from "thirdweb/extensions/erc721";
6-
import { NFTInput } from "thirdweb/utils";
6+
import type { NFTInput } from "thirdweb/utils";
77
import { getChain } from "../../../../../../utils/chain";
88
import { thirdwebClient } from "../../../../../../utils/sdk";
99
import { queueTransaction } from "../../../../../../utils/transaction/queueTransation";
@@ -94,15 +94,15 @@ export async function erc721mintTo(fastify: FastifyInstance) {
9494
const nft: NFTInput | string =
9595
typeof metadata === "string"
9696
? metadata
97-
: {
98-
name: metadata.name,
99-
description: metadata.description,
100-
image: metadata.image,
101-
animation_url: metadata.animation_url,
102-
external_url: metadata.external_url,
103-
background_color: metadata.background_color,
97+
: ({
98+
name: metadata.name?.toString() ?? undefined,
99+
description: metadata.description ?? undefined,
100+
image: metadata.image ?? undefined,
101+
animation_url: metadata.animation_url ?? undefined,
102+
external_url: metadata.external_url ?? undefined,
103+
background_color: metadata.background_color ?? undefined,
104104
properties: metadata.properties,
105-
};
105+
} satisfies NFTInput);
106106
const transaction = mintTo({
107107
contract,
108108
to: receiver,

0 commit comments

Comments
 (0)