Code Monkey home page Code Monkey logo

solana-mint-ui's People

Contributors

eliagoris avatar niriot-dotcom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

solana-mint-ui's Issues

wallet.sendTransaction support

I have been trying to add wallet.sendTransaction functionality to avoid blowfish wallet flags.
this is what I have done:

let builder = transactionBuilder()
      .add(setComputeUnitLimit(umiWalletAdapter, { units: 1_000_000 })) // Increase compute units
      .add(
        mintV2(umiWalletAdapter, {
          candyMachine: candyMachine.publicKey,
          nftMint,
          collectionMint: candyMachine.collectionMint,
          collectionUpdateAuthority: candyMachine.authority,
          tokenStandard: candyMachine.tokenStandard,
          candyGuard: candyGuard?.publicKey,
          mintArgs,
        })
      );

    const {
      context: { slot: minContextSlot },
      value: { blockhash, lastValidBlockHeight }
    } = await connection.getLatestBlockhashAndContext();

    builder = builder.setBlockhash(blockhash);

    const umiTransaction = builder.build(umi);
    const web3Transaction = toWeb3JsTransaction(umiTransaction);


    try {
      // Simulate the transaction
      const simulationResult = await connection.simulateTransaction(web3Transaction, { minContextSlot });

      // Save the simulated transaction to file
      const response = await fetch('/api/saveSimulationResult', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ simulationResult }),
      });

      if (!response.ok) {
        throw new Error('Failed to save simulation result');
      }


      // If simulation is successful, send the transaction
      const signature = await wallet.sendTransaction(web3Transaction, connection, { minContextSlot });
      await connection.confirmTransaction({ blockhash, lastValidBlockHeight, signature });
      setFormMessage("Minted successfully!");

and this is the simulation output:


{
  "context": {
    "apiVersion": "1.18.16",
    "slot": 310390568
  },
  "value": {
    "accounts": null,
    "err": null,
    "innerInstructions": null,
    "logs": [
      "Program ComputeBudget111111111111111111111111111111 invoke [1]",
      "Program ComputeBudget111111111111111111111111111111 success",
      "Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g invoke [1]",
      "Program log: Instruction: MintV2",
      "Program 11111111111111111111111111111111 invoke [2]",
      "Program 11111111111111111111111111111111 success",
      "Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR invoke [2]",
      "Program log: Instruction: MintV2",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]",
      "Program log: IX: Create",
      "Program 11111111111111111111111111111111 invoke [4]",
      "Program 11111111111111111111111111111111 success",
      "Program 11111111111111111111111111111111 invoke [4]",
      "Program 11111111111111111111111111111111 success",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]",
      "Program log: Instruction: InitializeMint2",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2828 of 890315 compute units",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
      "Program log: Allocate space for the account",
      "Program 11111111111111111111111111111111 invoke [4]",
      "Program 11111111111111111111111111111111 success",
      "Program log: Assign the account to the owning program",
      "Program 11111111111111111111111111111111 invoke [4]",
      "Program 11111111111111111111111111111111 success",
      "Program log: Transfer 2853600 lamports to the new account",
      "Program 11111111111111111111111111111111 invoke [4]",
      "Program 11111111111111111111111111111111 success",
      "Program log: Allocate space for the account",
      "Program 11111111111111111111111111111111 invoke [4]",
      "Program 11111111111111111111111111111111 success",
      "Program log: Assign the account to the owning program",
      "Program 11111111111111111111111111111111 invoke [4]",
      "Program 11111111111111111111111111111111 success",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]",
      "Program log: Instruction: SetAuthority",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3090 of 826860 compute units",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]",
      "Program log: Instruction: SetAuthority",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3250 of 820390 compute units",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 101536 of 910625 compute units",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]",
      "Program log: IX: Mint",
      "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [4]",
      "Program log: Create",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [5]",
      "Program log: Instruction: GetAccountDataSize",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1622 of 766569 compute units",
      "Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
      "Program 11111111111111111111111111111111 invoke [5]",
      "Program 11111111111111111111111111111111 success",
      "Program log: Initialize the associated token account",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [5]",
      "Program log: Instruction: InitializeImmutableOwner",
      "Program log: Please upgrade to SPL Token 2022 for immutable owner support",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 759929 compute units",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [5]",
      "Program log: Instruction: InitializeAccount3",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4241 of 756047 compute units",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
      "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 20443 of 771966 compute units",
      "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]",
      "Program log: Instruction: MintTo",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4538 of 743804 compute units",
      "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 61551 of 799779 compute units",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]",
      "Program log: IX: Update",
      "Program log: Auth type: Metadata",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 25665 of 731416 compute units",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]",
      "Program log: IX: Verify",
      "Program log: Clean write collection metadata",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 35713 of 700460 compute units",
      "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success",
      "Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 286925 of 948455 compute units",
      "Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR success",
      "Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g consumed 340427 of 999850 compute units",
      "Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g success"
    ],
    "returnData": null,
    "unitsConsumed": 340577
  }
}

I get this error when minting:

Error sending transaction: WalletSendTransactionError: Unexpected error
    at StandardWalletAdapter.sendTransaction (adapter.js:248:23)
    at async Object.eval [as sendTransaction] (WalletProviderBase.js:161:16)
    at async mint (index.tsx:153:25)

Minting multiple NFTs at once.

@eliagoris
Hello, thanks for the web app, It works great.

I am trying to add the ability to mint multiple NFTs with one click of the mint button and one wallet approval.

The best I can do is select X amount to mint, click mint once, then have the wallet pop up X times for approval. Are you able to give me a quick overview of how to do this?

thanks

Mint UI available for Devnet also?

Hey there,

have downloaded this front end mint ui for the latest version of solana candy machine v3, though after updating the env variables as suggested, am only able to run the localhost testing webpage in mainnet. It seems like this is set as a default somewhere in the code.

Have tried to search a number of different terms in vs code to track down anything to do with the network rpc but am unable.

Any assistance with this would be greatly appreciated.

An additional note:
If the guard for 0 sol payment, 0 bot tax, and a defined start time is setup correctly, should the creator wallet be able to mint if intented to be a completely free public mint? Or is it forever restricted as is the creator of the candy machine?

Cheers

TokenGate Guard disconnects Guard ID

As we try to add a TokenGate to it we get a "Account does not have correct owner" warning from the UI

creating the config.json guard in sugar seems to disconnect the guard from the candy-machine:
"guards": {
"default": {

  "mintLimit": {
    "id": 1,
    "limit": 1
  },
  "startDate": {
    "date": "2024-04-01 06:00:00 +0000"
  },
  "endDate": {
    "date": "2024-04-02 18:00:00 +0000"
  },
  "tokenGate": {
    "amount": 100000,
    "mint": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
  }
}

}

For now we ended up in adding the token Gate at the end and define the public key, but I am not sure if this is correct.
If we only define the tokenGate in the index.tsx and not in the candy-machine config in suger, we get another error: "Public Key mismatch"

const enabledGuardsKeys =
  guards && Object.keys(guards).filter((guardKey) => guards[guardKey])

let mintArgs: Partial<DefaultGuardSetMintArgs> = {}


const tokenMintPublicKeyString = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
const tokenMint = publicKey(tokenMintPublicKeyString);

// If there are enabled guards, set the mintArgs
if (enabledGuardsKeys.length) {
  // Map enabled guards and set mintArgs automatically based on the fields defined in each guard
  enabledGuardsKeys.forEach((guardKey) => {
    const guardObject = unwrapOption(candyGuard.guards[guardKey]);
    if (!guardObject) return null;

    mintArgs = { ...mintArgs, [guardKey]: some(guardObject) };
  });
}

mintArgs.tokenGate = some({ mint: tokenMint });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.