Mint NFT

PHOTO EMBED

Wed Feb 22 2023 01:24:28 GMT+0000 (Coordinated Universal Time)

Saved by @luisjdominguezp ##javascript

import {actions, utils, programs, NodeWallet} from '@metaplex/js';
import {Connection, Keypair, clusterApiUrl} from '@solana/web3.js';
import * as bs58 from "bs58";

async function mintNFT()  {
  //PROVIDE YOUR JSON URI WITH THE URL OF THE JSON UPLADAED TO ARWEAVE uploadJSON.ts
let uriS = "URL generado del JSON";
 console.log("minting")
    let connection = new Connection(clusterApiUrl("mainnet-beta"));

    //let secretKey: Uint8Array= Uint8Array.from([]);
    let keypair: Keypair = Keypair.fromSecretKey(bs58.decode("CLAVE PRIVADA DE SOLANA DEL QUE VA A PAGAR"));
    const mintNFTResponse = await actions.mintNFT({
        connection,
        wallet: new NodeWallet(keypair),
        uri: uriS,
        maxSupply: 1
      });

}

mintNFT();
content_copyCOPY