You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/apis/txbuilder/minting.mdx
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ Minting and burning assets with Native Script and Plutus Script
9
9
10
10
Minting and burning assets is a common operation in blockchain applications. In the Cardano ecosystem, minting and burning are achieved through Native Scripts and Plutus Scripts.
11
11
12
-
To view a video demonstration of this feature of the MeshSDK, navigate to the video guide <Linkhref="/apis//guides/nft-collection">Mint an NFT Collection</Link>.
12
+
To view a video demonstration of this feature of the MeshSDK, navigate to the video guide <Linkhref="/guides/nft-collection">Mint an NFT Collection</Link>.
13
13
14
-
In the code snippet, you will find `txBuilder`, which is an instance of `MeshTxBuilder`, a powerful low-level APIs that allows you to build transactions. Learn how to initialize MeshTxBuilder.
14
+
In the code snippet, you will find `txBuilder`, which is an instance of `MeshTxBuilder`, with powerful low-level APIs that allow you to build transactions. Here's how to initialize **MeshTxBuilder**.
15
15
16
16
```tsx
17
17
const txBuilder =newMeshTxBuilder({
@@ -25,7 +25,7 @@ In this page, you will find the APIs to create transactions for minting and burn
25
25
26
26
## Minting with One Signature
27
27
28
-
In this section, we will see how to mint native assets with a `MeshTxBuilder`. For minting assets with smart contract, visit MeshTxBuilder - Smart Contract - Minting Assets with Smart Contract.
28
+
In this section, we will see how to mint native assets with a `MeshTxBuilder`. For minting assets with a smart contract visit [this documentation](https://meshjs.dev/apis/txbuilder/smart-contracts#minting-assets-with-plutus-script).
29
29
30
30
Firstly, we need to define the `forgingScript` with `ForgeScript`. We use the first wallet address as the "minting address" (you can use other addresses).
The above minting and burning one signature are indeed the mint and burn with native script examples. Here we would explain the logic you need to know for native script minting.
272
+
The minting and burning examples above demonstrate using a one-signature native script. Here we explain the underlying logic for native script minting.
271
273
272
-
With `MeshTxBuilder`, you just need `.mint()` and provide script to mint or burn native script tokens:
274
+
With `MeshTxBuilder`, you just need to call `.mint()` and provide a script to mint or burn native script tokens:
273
275
274
276
```tsx
275
277
txBuilder
276
278
.mint("1", policyId, tokenNameHex)
277
279
.mintingScript(forgingScript)
278
280
```
279
281
280
-
On top on these 2 core logics, you can attach metadata if needed with `.metadataValue()`, and construct the transaction as needed.
282
+
On top of these two core steps, you can attach metadata with .metadataValue() and then construct the transaction as needed.
281
283
282
284
<Card>
283
285
### Mint Assets with Native Script [!toc]
@@ -333,7 +335,7 @@ On top on these 2 core logics, you can attach metadata if needed with `.metadata
333
335
334
336
## Minting Assets with Plutus Script
335
337
336
-
Minting Plutus tokens with `MeshTxBuilder` starts with anyone of the below script version indicators:
338
+
Plutus script minting with `MeshTxBuilder` starts with any of the below script version indicators:
337
339
338
340
```tsx
339
341
.mintPlutusScriptV1()
@@ -347,11 +349,11 @@ Followed by specifying the minting information:
Similar to unlocking assets, minting or burning Plutus tokens require providing redeemer and scripts. However, no datum information is needed in minting or burning.
352
+
Similar to unlocking, minting or burning tokens, the Plutus script requires providing a redeemer and the script itself. However, no datum information is needed in minting or burning.
351
353
352
-
**Script of the token**
354
+
**Providing a Script**
353
355
354
-
The actual script can be either provided by transaction builder or referenced from an UTxO onchain.
356
+
The actual script can be either provided through `mintTxInReference` method by attaching an on-chain UTxO reference, or by providing a Cbor encoded script.
355
357
356
358
- (i) Reference script
357
359
```tsx
@@ -363,7 +365,7 @@ The actual script can be either provided by transaction builder or referenced fr
363
365
.mintingScript(scriptCbor: string)
364
366
```
365
367
366
-
**Redeemer of the mint**
368
+
**Minting Redeemer**
367
369
368
370
Redeemer can be provided in different **data types**. If your MeshTxBuilder does not include an `evaluator` instance, you can also provide your budget for the unlock with this redeemer endpoint
369
371
@@ -417,7 +419,9 @@ Redeemer can be provided in different **data types**. If your MeshTxBuilder does
417
419
418
420
## Minting Assets with CIP-68 Metadata standard
419
421
420
-
Minting CIP-68 tokens with `MeshTxBuilder` means 2 consecutive sets of minting APIs. The first is to mint the 100 token, and the second is the mint the 222 tokens:
422
+
Minting CIP-68 tokens with `MeshTxBuilder` means 2 consecutive sets of minting APIs. The first is to mint the token with the `100` label, and the second is to mint the token with the `222` label:
423
+
424
+
421
425
422
426
```tsx
423
427
txBuilder
@@ -523,9 +527,9 @@ A side note, Mesh also provides the utility function of `CIP68_100(tokenNameHex:
523
527
524
528
## Minting Royalty Token
525
529
526
-
Royalty tokens is a special type of token that allows the creator to collect a royalty fee, this proposed standard will allow for uniform royalties' distributions across the secondary market space. Read CIP-27 for more information.
530
+
Royalty tokens are a special type of token that allow the creator to collect a royalty fee. This proposed standard will allow for uniform royalty distributions across the secondary market space. Read CIP-27 for more information.
527
531
528
-
The implementation of royalty tokens is very simple, minting a token with `777` label, with "rate" and "addr" in the metadata.
532
+
The implementation of royalty tokens is very simple – minting a token with the `777` label, with "rate", and "addr" in the metadata.
0 commit comments