Skip to main content
added 29 characters in body
Source Link
Jimii
  • 7.7k
  • 1
  • 8
  • 22

{ "name": "sol-final", "version": "0.1.0", "private": true, "dependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@metaplex-foundation/js": "^0.18.3", "@metaplex-foundation/mpl-token-metadata": "^3.2.1", "@metaplex-foundation/umi": "^0.9.2", "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", "@metaplex/js": "^4.12.0", "@project-serum/anchor": "^0.26.0", "@solana-mobile/wallet-adapter-mobile": "^2.1.3", "@solana/spl-token": "^0.4.6", "@solana/wallet-adapter-base": "^0.9.4", "@solana/wallet-adapter-react": "^0.15.21", "@solana/wallet-adapter-react-ui": "^0.9.5", "@solana/wallet-adapter-walletconnect": "^0.1.16", "@solana/wallet-adapter-wallets": "^0.16.0", "@solana/web3.js": "^1.36.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "@walletconnect/web3-provider": "^1.8.0", "axios": "^1.7.2", "bs58": "^6.0.0", "buffer": "6.0.3", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hot-toast": "^2.4.1", "react-scripts": "5.0.1", "tweetnacl": "^1.0.3", "tweetnacl-util": "^0.15.1", "web-vitals": "^2.1.4" }, "scripts": { "start": "set HTTPS=true && set SSL_CRT_FILE=localhost.pem && set SSL_KEY_FILE=localhost-key.pem&&react-app-rewired start", "build": "GENERATE_SOURCEMAP=false && react-app-rewired build", "test": "react-app-rewired test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "ajv": "^7.2.4", "assert": "^2.1.0", "browser": "^0.2.6", "browserify-zlib": "^0.2.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", "https-browserify": "^1.0.0", "os-browserify": "^0.3.0", "path-browserify": "^1.0.1", "process": "^0.11.10", "react-app-rewired": "^2.2.1", "source-map-loader": "^5.0.0", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "url": "^0.11.3", "webpack": "^5.91.0" } }

{
  "name": "sol-final",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
    "@metaplex-foundation/js": "^0.18.3",
    "@metaplex-foundation/mpl-token-metadata": "^3.2.1",
    "@metaplex-foundation/umi": "^0.9.2",
    "@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
    "@metaplex/js": "^4.12.0",
    "@project-serum/anchor": "^0.26.0",
    "@solana-mobile/wallet-adapter-mobile": "^2.1.3",
    "@solana/spl-token": "^0.4.6",
    "@solana/wallet-adapter-base": "^0.9.4",
    "@solana/wallet-adapter-react": "^0.15.21",
    "@solana/wallet-adapter-react-ui": "^0.9.5",
    "@solana/wallet-adapter-walletconnect": "^0.1.16",
    "@solana/wallet-adapter-wallets": "^0.16.0",
    "@solana/web3.js": "^1.36.0",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "@walletconnect/web3-provider": "^1.8.0",
    "axios": "^1.7.2",
    "bs58": "^6.0.0",
    "buffer": "6.0.3",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-hot-toast": "^2.4.1",
    "react-scripts": "5.0.1",
    "tweetnacl": "^1.0.3",
    "tweetnacl-util": "^0.15.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "set HTTPS=true && set SSL_CRT_FILE=localhost.pem && set SSL_KEY_FILE=localhost-key.pem&&react-app-rewired start",
    "build": "GENERATE_SOURCEMAP=false && react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "ajv": "^7.2.4",
    "assert": "^2.1.0",
    "browser": "^0.2.6",
    "browserify-zlib": "^0.2.0",
    "buffer": "^6.0.3",
    "crypto-browserify": "^3.12.0",
    "https-browserify": "^1.0.0",
    "os-browserify": "^0.3.0",
    "path-browserify": "^1.0.1",
    "process": "^0.11.10",
    "react-app-rewired": "^2.2.1",
    "source-map-loader": "^5.0.0",
    "stream-browserify": "^3.0.0",
    "stream-http": "^3.2.0",
    "url": "^0.11.3",
    "webpack": "^5.91.0"
  }
}

iI have install this npm i @metaplex-foundation/js@^0.18.3

const MintNFT = async () => { // Connect to the Solana Devnet const connection = new Connection(clusterApiUrl("devnet"), "confirmed");npm i @metaplex-foundation/js@^0.18.3

    // Load your existing wallet from a secret key (replace this with your actual secret key)
    const secretKey = base58.deserialize("3XMuQJU9TDfdTz5msBn1hrM4y7XvJ5odZSwEdJSBqJ12KsG6SYC3LSbDj4NEZqZVcdNFvGCSo6UV6HKpBojkWpb7");
    const wallet = Keypair.fromSecretKey(new Uint8Array(secretKey));
   
    // Initialize Metaplex instance with your existing wallet
    const metaplex = new Metaplex(connection)
        .use(keypairIdentity(wallet))
        .use(bundlrStorage());
   
    // Mint a new NFT using your wallet
    const { nft } = await metaplex.nfts().create({
        uri: 'https://example.com/metadata.json', // Replace with your metadata URI
        name: 'My NFT',
        sellerFeeBasisPoints: 500, // 5% royalty fee
    });

    console.log('NFT Mint Address:', nft.address.toBase58());

    // Now, you can use nft.address (mintAddress) to fetch or interact with the NFT
    const fetchedNFT = await metaplex.nfts().findByMint({ mintAddress: nft.address });

    console.log('Fetched NFT:', fetchedNFT);
};

this my code

 const MintNFT = async () => {
        // Connect to the Solana Devnet
        const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
       
        // Load your existing wallet from a secret key (replace this with your actual secret key)
        const secretKey = base58.deserialize("3XMuQJU9TDfdTz5msBn1hrM4y7XvJ5odZSwEdJSBqJ12KsG6SYC3LSbDj4NEZqZVcdNFvGCSo6UV6HKpBojkWpb7");
        const wallet = Keypair.fromSecretKey(new Uint8Array(secretKey));
       
        // Initialize Metaplex instance with your existing wallet
        const metaplex = new Metaplex(connection)
            .use(keypairIdentity(wallet))
            .use(bundlrStorage());
       
        // Mint a new NFT using your wallet
        const { nft } = await metaplex.nfts().create({
            uri: 'https://example.com/metadata.json', // Replace with your metadata URI
            name: 'My NFT',
            sellerFeeBasisPoints: 500, // 5% royalty fee
        });
    
        console.log('NFT Mint Address:', nft.address.toBase58());
    
        // Now, you can use nft.address (mintAddress) to fetch or interact with the NFT
        const fetchedNFT = await metaplex.nfts().findByMint({ mintAddress: nft.address });
    
        console.log('Fetched NFT:', fetchedNFT);
    };

i haveI am facing thisthe issue below

state.ts:6 Uncaught TypeError: (0 , codecs_1.getBytesCodec) is not a function at ./node_modules/@solana/spl-token-metadata/lib/cjs/state.js (state.ts:6:1) at options.factory (react refresh:6:1) at webpack_require (bootstrap:22:1) at fn (hot module replacement:61:1) at ./node_modules/@solana/spl-token-metadata/lib/cjs/index.js (index.ts:4:1) at options.factory (react refresh:6:1) at webpack_require (bootstrap:22:1) at fn (hot module replacement:61:1) at ./node_modules/@metaplex-foundation/js/node_modules/@solana/spl-token/lib/cjs/extensions/tokenMetadata/actions.js (actions.ts:4:1) at options.factory (react refresh:6:1)

state.ts:6 Uncaught 
TypeError: (0 , codecs_1.getBytesCodec) is not a function
    at ./node_modules/@solana/spl-token-metadata/lib/cjs/state.js (state.ts:6:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./node_modules/@solana/spl-token-metadata/lib/cjs/index.js (index.ts:4:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./node_modules/@metaplex-foundation/js/node_modules/@solana/spl-token/lib/cjs/extensions/tokenMetadata/actions.js (actions.ts:4:1)
    at options.factory (react refresh:6:1)

iI need to mint nftNFT with meta datametadata using my private key

{ "name": "sol-final", "version": "0.1.0", "private": true, "dependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@metaplex-foundation/js": "^0.18.3", "@metaplex-foundation/mpl-token-metadata": "^3.2.1", "@metaplex-foundation/umi": "^0.9.2", "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", "@metaplex/js": "^4.12.0", "@project-serum/anchor": "^0.26.0", "@solana-mobile/wallet-adapter-mobile": "^2.1.3", "@solana/spl-token": "^0.4.6", "@solana/wallet-adapter-base": "^0.9.4", "@solana/wallet-adapter-react": "^0.15.21", "@solana/wallet-adapter-react-ui": "^0.9.5", "@solana/wallet-adapter-walletconnect": "^0.1.16", "@solana/wallet-adapter-wallets": "^0.16.0", "@solana/web3.js": "^1.36.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "@walletconnect/web3-provider": "^1.8.0", "axios": "^1.7.2", "bs58": "^6.0.0", "buffer": "6.0.3", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hot-toast": "^2.4.1", "react-scripts": "5.0.1", "tweetnacl": "^1.0.3", "tweetnacl-util": "^0.15.1", "web-vitals": "^2.1.4" }, "scripts": { "start": "set HTTPS=true && set SSL_CRT_FILE=localhost.pem && set SSL_KEY_FILE=localhost-key.pem&&react-app-rewired start", "build": "GENERATE_SOURCEMAP=false && react-app-rewired build", "test": "react-app-rewired test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "ajv": "^7.2.4", "assert": "^2.1.0", "browser": "^0.2.6", "browserify-zlib": "^0.2.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", "https-browserify": "^1.0.0", "os-browserify": "^0.3.0", "path-browserify": "^1.0.1", "process": "^0.11.10", "react-app-rewired": "^2.2.1", "source-map-loader": "^5.0.0", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "url": "^0.11.3", "webpack": "^5.91.0" } }

i have install this npm i @metaplex-foundation/js@^0.18.3

const MintNFT = async () => { // Connect to the Solana Devnet const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

    // Load your existing wallet from a secret key (replace this with your actual secret key)
    const secretKey = base58.deserialize("3XMuQJU9TDfdTz5msBn1hrM4y7XvJ5odZSwEdJSBqJ12KsG6SYC3LSbDj4NEZqZVcdNFvGCSo6UV6HKpBojkWpb7");
    const wallet = Keypair.fromSecretKey(new Uint8Array(secretKey));
   
    // Initialize Metaplex instance with your existing wallet
    const metaplex = new Metaplex(connection)
        .use(keypairIdentity(wallet))
        .use(bundlrStorage());
   
    // Mint a new NFT using your wallet
    const { nft } = await metaplex.nfts().create({
        uri: 'https://example.com/metadata.json', // Replace with your metadata URI
        name: 'My NFT',
        sellerFeeBasisPoints: 500, // 5% royalty fee
    });

    console.log('NFT Mint Address:', nft.address.toBase58());

    // Now, you can use nft.address (mintAddress) to fetch or interact with the NFT
    const fetchedNFT = await metaplex.nfts().findByMint({ mintAddress: nft.address });

    console.log('Fetched NFT:', fetchedNFT);
};

this my code

i have facing this issue

state.ts:6 Uncaught TypeError: (0 , codecs_1.getBytesCodec) is not a function at ./node_modules/@solana/spl-token-metadata/lib/cjs/state.js (state.ts:6:1) at options.factory (react refresh:6:1) at webpack_require (bootstrap:22:1) at fn (hot module replacement:61:1) at ./node_modules/@solana/spl-token-metadata/lib/cjs/index.js (index.ts:4:1) at options.factory (react refresh:6:1) at webpack_require (bootstrap:22:1) at fn (hot module replacement:61:1) at ./node_modules/@metaplex-foundation/js/node_modules/@solana/spl-token/lib/cjs/extensions/tokenMetadata/actions.js (actions.ts:4:1) at options.factory (react refresh:6:1)

i need to mint nft with meta data using my private key

{
  "name": "sol-final",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
    "@metaplex-foundation/js": "^0.18.3",
    "@metaplex-foundation/mpl-token-metadata": "^3.2.1",
    "@metaplex-foundation/umi": "^0.9.2",
    "@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
    "@metaplex/js": "^4.12.0",
    "@project-serum/anchor": "^0.26.0",
    "@solana-mobile/wallet-adapter-mobile": "^2.1.3",
    "@solana/spl-token": "^0.4.6",
    "@solana/wallet-adapter-base": "^0.9.4",
    "@solana/wallet-adapter-react": "^0.15.21",
    "@solana/wallet-adapter-react-ui": "^0.9.5",
    "@solana/wallet-adapter-walletconnect": "^0.1.16",
    "@solana/wallet-adapter-wallets": "^0.16.0",
    "@solana/web3.js": "^1.36.0",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "@walletconnect/web3-provider": "^1.8.0",
    "axios": "^1.7.2",
    "bs58": "^6.0.0",
    "buffer": "6.0.3",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-hot-toast": "^2.4.1",
    "react-scripts": "5.0.1",
    "tweetnacl": "^1.0.3",
    "tweetnacl-util": "^0.15.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "set HTTPS=true && set SSL_CRT_FILE=localhost.pem && set SSL_KEY_FILE=localhost-key.pem&&react-app-rewired start",
    "build": "GENERATE_SOURCEMAP=false && react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "ajv": "^7.2.4",
    "assert": "^2.1.0",
    "browser": "^0.2.6",
    "browserify-zlib": "^0.2.0",
    "buffer": "^6.0.3",
    "crypto-browserify": "^3.12.0",
    "https-browserify": "^1.0.0",
    "os-browserify": "^0.3.0",
    "path-browserify": "^1.0.1",
    "process": "^0.11.10",
    "react-app-rewired": "^2.2.1",
    "source-map-loader": "^5.0.0",
    "stream-browserify": "^3.0.0",
    "stream-http": "^3.2.0",
    "url": "^0.11.3",
    "webpack": "^5.91.0"
  }
}

I have install this npm i @metaplex-foundation/js@^0.18.3

 const MintNFT = async () => {
        // Connect to the Solana Devnet
        const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
       
        // Load your existing wallet from a secret key (replace this with your actual secret key)
        const secretKey = base58.deserialize("3XMuQJU9TDfdTz5msBn1hrM4y7XvJ5odZSwEdJSBqJ12KsG6SYC3LSbDj4NEZqZVcdNFvGCSo6UV6HKpBojkWpb7");
        const wallet = Keypair.fromSecretKey(new Uint8Array(secretKey));
       
        // Initialize Metaplex instance with your existing wallet
        const metaplex = new Metaplex(connection)
            .use(keypairIdentity(wallet))
            .use(bundlrStorage());
       
        // Mint a new NFT using your wallet
        const { nft } = await metaplex.nfts().create({
            uri: 'https://example.com/metadata.json', // Replace with your metadata URI
            name: 'My NFT',
            sellerFeeBasisPoints: 500, // 5% royalty fee
        });
    
        console.log('NFT Mint Address:', nft.address.toBase58());
    
        // Now, you can use nft.address (mintAddress) to fetch or interact with the NFT
        const fetchedNFT = await metaplex.nfts().findByMint({ mintAddress: nft.address });
    
        console.log('Fetched NFT:', fetchedNFT);
    };

I am facing the issue below

state.ts:6 Uncaught 
TypeError: (0 , codecs_1.getBytesCodec) is not a function
    at ./node_modules/@solana/spl-token-metadata/lib/cjs/state.js (state.ts:6:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./node_modules/@solana/spl-token-metadata/lib/cjs/index.js (index.ts:4:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:22:1)
    at fn (hot module replacement:61:1)
    at ./node_modules/@metaplex-foundation/js/node_modules/@solana/spl-token/lib/cjs/extensions/tokenMetadata/actions.js (actions.ts:4:1)
    at options.factory (react refresh:6:1)

I need to mint NFT with metadata using my private key

Source Link

Error in @metaplex-foundation/js

these are my npm version

{ "name": "sol-final", "version": "0.1.0", "private": true, "dependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@metaplex-foundation/js": "^0.18.3", "@metaplex-foundation/mpl-token-metadata": "^3.2.1", "@metaplex-foundation/umi": "^0.9.2", "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", "@metaplex/js": "^4.12.0", "@project-serum/anchor": "^0.26.0", "@solana-mobile/wallet-adapter-mobile": "^2.1.3", "@solana/spl-token": "^0.4.6", "@solana/wallet-adapter-base": "^0.9.4", "@solana/wallet-adapter-react": "^0.15.21", "@solana/wallet-adapter-react-ui": "^0.9.5", "@solana/wallet-adapter-walletconnect": "^0.1.16", "@solana/wallet-adapter-wallets": "^0.16.0", "@solana/web3.js": "^1.36.0", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "@walletconnect/web3-provider": "^1.8.0", "axios": "^1.7.2", "bs58": "^6.0.0", "buffer": "6.0.3", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hot-toast": "^2.4.1", "react-scripts": "5.0.1", "tweetnacl": "^1.0.3", "tweetnacl-util": "^0.15.1", "web-vitals": "^2.1.4" }, "scripts": { "start": "set HTTPS=true && set SSL_CRT_FILE=localhost.pem && set SSL_KEY_FILE=localhost-key.pem&&react-app-rewired start", "build": "GENERATE_SOURCEMAP=false && react-app-rewired build", "test": "react-app-rewired test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "ajv": "^7.2.4", "assert": "^2.1.0", "browser": "^0.2.6", "browserify-zlib": "^0.2.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", "https-browserify": "^1.0.0", "os-browserify": "^0.3.0", "path-browserify": "^1.0.1", "process": "^0.11.10", "react-app-rewired": "^2.2.1", "source-map-loader": "^5.0.0", "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "url": "^0.11.3", "webpack": "^5.91.0" } }

i have install this npm i @metaplex-foundation/js@^0.18.3

const MintNFT = async () => { // Connect to the Solana Devnet const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

    // Load your existing wallet from a secret key (replace this with your actual secret key)
    const secretKey = base58.deserialize("3XMuQJU9TDfdTz5msBn1hrM4y7XvJ5odZSwEdJSBqJ12KsG6SYC3LSbDj4NEZqZVcdNFvGCSo6UV6HKpBojkWpb7");
    const wallet = Keypair.fromSecretKey(new Uint8Array(secretKey));
   
    // Initialize Metaplex instance with your existing wallet
    const metaplex = new Metaplex(connection)
        .use(keypairIdentity(wallet))
        .use(bundlrStorage());
   
    // Mint a new NFT using your wallet
    const { nft } = await metaplex.nfts().create({
        uri: 'https://example.com/metadata.json', // Replace with your metadata URI
        name: 'My NFT',
        sellerFeeBasisPoints: 500, // 5% royalty fee
    });

    console.log('NFT Mint Address:', nft.address.toBase58());

    // Now, you can use nft.address (mintAddress) to fetch or interact with the NFT
    const fetchedNFT = await metaplex.nfts().findByMint({ mintAddress: nft.address });

    console.log('Fetched NFT:', fetchedNFT);
};

this my code

i have facing this issue

state.ts:6 Uncaught TypeError: (0 , codecs_1.getBytesCodec) is not a function at ./node_modules/@solana/spl-token-metadata/lib/cjs/state.js (state.ts:6:1) at options.factory (react refresh:6:1) at webpack_require (bootstrap:22:1) at fn (hot module replacement:61:1) at ./node_modules/@solana/spl-token-metadata/lib/cjs/index.js (index.ts:4:1) at options.factory (react refresh:6:1) at webpack_require (bootstrap:22:1) at fn (hot module replacement:61:1) at ./node_modules/@metaplex-foundation/js/node_modules/@solana/spl-token/lib/cjs/extensions/tokenMetadata/actions.js (actions.ts:4:1) at options.factory (react refresh:6:1)

how to resolve this error

i need to mint nft with meta data using my private key