@metaplex-foundation/mpl-token-metadata-kit - v0.0.1
    Preparing search index...

    Function createAndMint

    • Creates and mints a token in one step

      This helper combines createV1 and mintV1 instructions, returning both so they can be sent in a single transaction.

      Parameters

      Returns Promise<
          [
              Instruction<
                  string,
                  readonly (AccountMeta<string> | AccountLookupMeta<string, string>)[],
              >,
              Instruction<
                  string,
                  readonly (AccountMeta<string> | AccountLookupMeta<string, string>)[],
              >,
          ],
      >

      Array containing [createInstruction, mintInstruction]

      const [createIx, mintIx] = await createAndMint({
      mint,
      authority,
      payer,
      name: 'My NFT',
      uri: 'https://example.com/nft.json',
      sellerFeeBasisPoints: 500,
      tokenStandard: TokenStandard.NonFungible,
      amount: 1,
      tokenOwner: owner.address,
      });

      await sendAndConfirm(rpc, rpcSubscriptions, [createIx, mintIx], [mint, authority]);