-3

Is there a way to simulate a transaction with the Metaplex JavaScript SDK to get the cost and fees of the mint transaction?

const { nft } = await metaplex
.nfts()
.create({
    uri: "https://arweave.net/123",
    name: "My NFT",
    sellerFeeBasisPoints: 500, // Represents 5.00%.
})
.run();
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mayzz
  • 116
  • 1
  • 9

1 Answers1

0

This is not a function that is currently built in, so you would have to rely on the wallet popup to get the estimation costs.

But an NFT will typically cost 0.011 SOL to create the onchain accounts and mint.

Other costs would be storage costs for the offchain metadata JSON content and the image/animation, but these are extremely minimal. We are talking fraction of a US cent to upload a JSON file to Arweave, for example.

You can use the below link to get rough Arweave costs. Units are in bytes and returns the lamports needed for the storage costs.

https://node1.bundlr.network/price/solana/1000
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Tony Boyle
  • 387
  • 1
  • 4
  • Currently I already calculate the cost of arweave that I convert to Solana. I use my own centralized network to send files to Arweave and allow payment in SOL rather than AR. It's unfortunate that we can't recover the instructions generated by the Metaplex SDK. I will therefore continue by creating the transactions myself as in the example with Figment. Thanks. – Mayzz Aug 20 '22 at 09:48