Closed manupadillaph closed 1 year ago
Any help, idea, news?
I've looked around trying to do the same thing, as far as I can tell there are no existing functionality for plutus scripts, only 'cardano native scripts' which are different.
Plutus minting now available in the new CSL version 11.2.0
@manupadillaph @micahkendall, Mesh latest update and working with CSL (thanks @lisicky for deploying 11.2), allows you to do minting assets with Plutus script, and you can do it like this (see docs):
import { Transaction } from '@meshsdk/core';
import { AssetMetadata, Mint, Action, PlutusScript } from '@meshsdk/core';
const script: PlutusScript = {
code: plutusMintingScriptCbor,
version: 'V2',
};
const redeemer: Partial<Action> = {
tag: 'MINT',
};
const tx = new Transaction({ initiator: wallet });
// define asset#1 metadata
const assetMetadata1: AssetMetadata = {
"name": "Mesh Token",
"image": "ipfs://QmRzicpReutwCkM6aotuKjErFCUD213DpwPq6ByuzMJaua",
"mediaType": "image/jpg",
"description": "This NFT is minted by Mesh (https://meshjs.dev/)."
};
const asset1: Mint = {
assetName: 'MeshToken',
assetQuantity: '1',
metadata: assetMetadata1,
label: '721',
recipient: 'addr_test1vpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0c7e4cxr',
};
tx.mintAsset(
script,
asset1,
redeemer,
);
const unsignedTx = await tx.build();
const signedTx = await wallet.signTx(unsignedTx);
const txHash = await wallet.submitTx(signedTx);
I coulnt find a way to use PLUTUS SCRIPTS for Minting.
https://cardano.stackexchange.com/questions/5980/mint-tokens-using-plutus-scripts-with-the-serialization-lib/8664#8664
I found in the examples a way to do it with Navite Scripts using add_mint_asset_and_output method:
add_mint_asset_and_output(policy_script: NativeScript, asset_name: AssetName, amount: Int, output_builder: TransactionOutputAmountBuilder, output_coin: BigNum): void; /**
Are you considering to add this functionality?