@@ -3,7 +3,7 @@ import type { FastifyInstance } from "fastify";
3
3
import { StatusCodes } from "http-status-codes" ;
4
4
import { getContract } from "thirdweb" ;
5
5
import { mintTo } from "thirdweb/extensions/erc721" ;
6
- import { NFTInput } from "thirdweb/utils" ;
6
+ import type { NFTInput } from "thirdweb/utils" ;
7
7
import { getChain } from "../../../../../../utils/chain" ;
8
8
import { thirdwebClient } from "../../../../../../utils/sdk" ;
9
9
import { queueTransaction } from "../../../../../../utils/transaction/queueTransation" ;
@@ -94,15 +94,15 @@ export async function erc721mintTo(fastify: FastifyInstance) {
94
94
const nft : NFTInput | string =
95
95
typeof metadata === "string"
96
96
? 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 ,
104
104
properties : metadata . properties ,
105
- } ;
105
+ } satisfies NFTInput ) ;
106
106
const transaction = mintTo ( {
107
107
contract,
108
108
to : receiver ,
0 commit comments