Update MPT Generator use case page

This commit is contained in:
Maria Shodunke
2025-11-25 15:21:52 +00:00
parent a71a3fca10
commit f290941300
9 changed files with 50 additions and 24 deletions

View File

@@ -4,7 +4,7 @@
<title>MPT Generator</title>
<link href='https://fonts.googleapis.com/css?family=Work Sans' rel='stylesheet'>
<link href="modular-tutorials.css" rel="stylesheet">
<script src='https://unpkg.com/xrpl@4.1.0/build/xrpl-latest.js'></script>
<script src='https://unpkg.com/xrpl@4.4.3/build/xrpl-latest.js'></script>
<script src='mpt-generator.js'></script>
<script>
@@ -229,4 +229,4 @@
</form>
</body>
</html>
</html>

View File

@@ -83,7 +83,7 @@ async function sendTransaction() {
const my_wallet = xrpl.Wallet.fromSeed(seedField.value)
const client = new xrpl.Client(net)
await client.connect()
const metadataHexString = xrpl.convertStringToHex(metadataTextArea.value)
const metadataHexString = xrpl.encodeMPTokenMetadata(JSON.parse(metadataTextArea.value))
const transactionJson = {
"TransactionType": "MPTokenIssuanceCreate",
"Account": accountField.value,
@@ -108,4 +108,4 @@ async function sendTransaction() {
function gatherMptInfo() {
let mptInfo = accountNameField.value + "\n" + accountField.value + "\n" + seedField.value + "\n" + mptIssuanceIdField.value
resultField.value = mptInfo
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 KiB

After

Width:  |  Height:  |  Size: 710 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 474 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 KiB

After

Width:  |  Height:  |  Size: 664 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 445 KiB

View File

@@ -96,7 +96,7 @@ The metadata you provide is what distinguishes your token from other MPTs. Defin
{% /tabs %}
The metadata schema defined in XLS-89 supports both long field names (`ticker`, `name`, `desc`) and compact short keys (`t`, `n`, `d`). To save space on the ledger, its recommended to use short key names. The MPT metadata field has a 1024-byte limit, so using compact keys allows you to include more information.
The metadata schema supports both long field names (`ticker`, `name`, `desc`) and compact short keys (`t`, `n`, `d`). To save space on the ledger, its recommended to use short key names. This is because the metadata field has a 1024-byte limit, so using compact keys allows you to include more information.
The SDK libraries provide utility functions to encode or decode the metadata for you, so you don't have to. If long field names are provided in the JSON, the **encoding utility function** automatically shortens them to their compact key equivalents before encoding. Similarly, when decoding, the **decoding utility function** converts the short keys back to their respective long names.
@@ -126,9 +126,9 @@ To issue the MPT, create an `MPTokenIssuanceCreate` transaction object with the
|:------------------- |:------ |
| `TransactionType` | The type of transaction, in this case `MPTokenIssuanceCreate`. |
| `Account` | The wallet address of the account that is issuing the MPT, in this case the `issuer`. |
| `AssetScale` | The number of decimal places for the token (for example, `4` means amounts are divided by `10,000`). |
| `AssetScale` | Where to put the decimal place when displaying amounts of this MPT. This is set to `4` for this example. |
| `MaximumAmount` | The maximum supply of the token to be issued. |
| `TransferFee` | The transfer fee (if any) to charge for token transfers. In this example it is set to `0`. |
| `TransferFee` | The transfer fee to charge for transferring the token. In this example it is set to `0`. |
| `Flags` | Flags to set token permissions. For this example, the following flags are configured: <ul><li>**Can Transfer**: A holder can transfer the T-bill MPT to another account.</li><li>**Can Trade**: A holder can trade the T-bill MPT with another account.</li></ul>See [MPTokenIssuanceCreate Flags](../../../references/protocol/transactions/types/mptokenissuancecreate.md#mptokenissuancecreate-flags) for all available flags. |
| `MPTokenMetadata` | The hex-encoded metadata for the token. |

View File

@@ -9,7 +9,7 @@ labels:
_As a financial professional, I want to use multi-purpose tokens to create an asset-backed token in order to profit from resale transactions._
A multi-purpose token (MPT) is a compact and flexible object that offers the best aspects of fungible and non-fungible tokens. It is the next generation of tokenization on the XRPL. Notable features include:
A Multi-Purpose Token (MPT) is a compact and flexible object that offers the best aspects of fungible and non-fungible tokens. It is the next generation of tokenization on the XRPL. Notable features include:
- MPTs store metadata directly on the XRPL blockchain, with the option of linking to additional off-chain data. Once created, the metadata is immutable.
- MPTs can have a fixed token supply, with a cap on the maximum number of tokens.
@@ -17,10 +17,21 @@ A multi-purpose token (MPT) is a compact and flexible object that offers the bes
- MPTs can be non-transferable, for use cases such as airline credits.
- MPTs also allow advanced compliance features.
To learn more, see [Multi-purpose Tokens](../../concepts/tokens/fungible-tokens/multi-purpose-tokens.md).
{% amendment-disclaimer name="MPTokensV1" /%}
## Intended Audience
This page is written for product managers, business stakeholders, and non-technical users who want a high-level use case and an easy way to generate an MPT using the downloadable MPT Generator utility.
To learn about MPTs in general, go to the **Concept** page. For developer-focused content and code examples go to the **Tutorial**.
{% card-grid %}
{% xrpl-card title="Concept: MultiPurpose Tokens" body="Read the concept documentation to learn more about Multi-Purpose Tokens." href="docs/concepts/tokens/fungible-tokens/multi-purpose-tokens/" /%}
{% xrpl-card title="Tutorial: Issue a MultiPurpose Token" body="Stepbystep, handson tutorial to issue an MPT using the XRP Ledger SDKs." href="docs/tutorials/how-tos/use-tokens/issue-a-multi-purpose-token/" /%}
{% xrpl-card title="MPT Generator" body="Download the MPT Generator and learn how to create an asset-backed Treasury bill." href="#mpt-generator"/%}
{% /card-grid %}
## MPT Generator
![MPT Generator Utility](../../img/uc-mpt1-mpt-generator-empty-form.png)
@@ -364,6 +375,7 @@ A US Treasury bill (T-bill) is a short-term debt security issued by the US gover
You can use the Account Configurator to experiment with the settings for a T-bill issuing account in a sandbox environment. When you are satisfied with your configuration, you can create an account on XRPL Mainnet to begin trading.
To create a new MPT Issuer account:
- In the Account Configurator utility, choose ledger instance **Devnet**.
- Click **Get New Account**.
- Choose account configuration template **Issuer**.
@@ -424,20 +436,33 @@ The metadata you provide is what distinguishes your token from other MPTs. The f
```json
{
"Name": "US Treasury Bill Token",
"Identifier": "USTBT",
"Issuer": "US Treasury",
"IssueDate": "2024-03-25",
"MaturityDate": "2025-03-25",
"FaceValue": 1000,
"InterestRate": 2.5,
"InterestFrequency": "Quarterly",
"Collateral": "US Government",
"Jurisdiction": "United States",
"RegulatoryCompliance": "SEC Regulations",
"SecurityType": "Treasury Bill",
"ExternalUrl": "https://example.com/t-bill-token-metadata.json"
"ticker": "TBILL",
"name": "T-Bill Yield Token",
"desc": "A yield-bearing stablecoin backed by short-term U.S. Treasuries and money market instruments.",
"icon": "https://example.org/tbill-icon.png",
"asset_class": "rwa",
"asset_subclass": "treasury",
"issuer_name": "Example Yield Co.",
"uris": [
{
"uri": "https://exampleyield.co/tbill",
"category": "website",
"title": "Product Page"
},
{
"uri": "https://exampleyield.co/docs",
"category": "docs",
"title": "Yield Token Docs"
}
],
"additional_info": {
"interest_rate": "5.00%",
"interest_type": "variable",
"yield_source": "U.S. Treasury Bills",
"maturity_date": "2045-06-30",
"cusip": "912796RX0"
}
}
```
Once you've set your preferred values, click **Generate Transaction** to see the transaction syntax for your settings. The `Flags` field displays the sum of the flags you've selected, and the `MPTokenMetadata` is converted to a hexidecimal string.
@@ -456,8 +481,9 @@ Click **Gather MPT Information** to copy the account information and MPT Issuanc
![Account and MPT ID in the result field.](../../img/uc-mpt1-t-bill-gather-mpt-info.png)
## See Also:
## See Also
- [Issue a Multi-Purpose Token (MPT)](../../tutorials/how-tos/use-tokens/issue-a-multi-purpose-token.md)
- [Sending MPTs](../../tutorials/javascript/send-payments/sending-mpts.md)
{% raw-partial file="/docs/_snippets/common-links.md" /%}