You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I get the following error when implementing the function: `The newly created NFT and, potentially, its associated token.
Type 'Nft' is not assignable to type 'NftWithToken'.
Property 'token' is missing in type 'Nft' but required in type '{ token: Token; }'.`
And here is the definition of Nft's create(...) function I found in the library: create(input: CreateNftInput, options?: OperationOptions) { if (input?.tree) return this.metaplex .operations() .execute( createCompressedNftOperation(input as CreateCompressedNftInput), options ); return this.metaplex .operations() .execute(createNftOperation(input), options); }
According to the function definition, when not passing the "tree" parameter, the function returns output of type "NftWithToken", and when passing the "tree" parameter, the function returns output of type "Nft"
And the problem here is that when passing "tree" and not passing "tree", the function returns output of type "Nft"
Can any sona expert please help me with this error.
The text was updated successfully, but these errors were encountered:
I have the following nft generation code:
`async function createNft(
metaplex: Metaplex,
uri: string,
): Promise {
const { nft } = await metaplex
.nfts()
.create({
uri: uri,
name: tokenName,
sellerFeeBasisPoints: sellerFeeBasisPoints,
tree: undefined,
})
console.log(
Token Mint: https://explorer.solana.com/address/${nft.address.toString()}?cluster=devnet
)
return nft
}`
But I get the following error when implementing the function: `The newly created NFT and, potentially, its associated token.
Type 'Nft' is not assignable to type 'NftWithToken'.
Property 'token' is missing in type 'Nft' but required in type '{ token: Token; }'.`
And here is the definition of Nft's create(...) function I found in the library:
create(input: CreateNftInput, options?: OperationOptions) { if (input?.tree) return this.metaplex .operations() .execute( createCompressedNftOperation(input as CreateCompressedNftInput), options ); return this.metaplex .operations() .execute(createNftOperation(input), options); }
According to the function definition, when not passing the "tree" parameter, the function returns output of type "NftWithToken", and when passing the "tree" parameter, the function returns output of type "Nft"
And the problem here is that when passing "tree" and not passing "tree", the function returns output of type "Nft"
Can any sona expert please help me with this error.
The text was updated successfully, but these errors were encountered: