+
+
Mesh is an open-source library designed to make building dApps accessible. Whether you're a beginner developer, startup, web3 market leader, or a large enterprise, Mesh makes web3 development easy with reliable, scalable, and well-engineered APIs & developer tools.
Explore the features on [Mesh Playground](https://meshjs.dev/).
## What's inside?
-This Turborepo includes the following packages/apps:
+This repo includes the following packages/apps:
### Packages
diff --git a/apps/playground/src/pages/apis/transaction/basics/get-txbuilder.tsx b/apps/playground/src/pages/apis/transaction/basics/get-txbuilder.tsx
new file mode 100644
index 000000000..dcc8b3b25
--- /dev/null
+++ b/apps/playground/src/pages/apis/transaction/basics/get-txbuilder.tsx
@@ -0,0 +1,45 @@
+import Link from "~/components/link";
+import TwoColumnsScroll from "~/components/sections/two-columns-scroll";
+import Codeblock from "~/components/text/codeblock";
+
+export default function TransactionGetTxbuilder() {
+ return (
+
+ );
+}
+
+function Left() {
+ let code1 = ``;
+ code1 += `const tx = new Transaction({ initiator: wallet });\n`;
+ code1 += `tx.foo();\n`;
+ code1 += `\n`;
+ code1 += `tx.txBuilder.bar()\n`;
+
+ let code2 = `tx.txBuilder.meshTxBuilderBody;`;
+
+ return (
+ <>
+
+ The TxBuilder is a powerful
+ low-level APIs that allows you to build and sign transactions. You can
+ get a new instance of TxBuilder by calling txBuilder. Doing
+ so allows you to access the low-level APIs of TxBuilder,{" "}
+
+ check the docs
+ {" "}
+ for all the available methods.
+
+
+
+ For example, you can get the meshTxBuilderBody to retrieve
+ the transaction JSON. This is useful for debugging and understanding how
+ the transaction is built.
+
+
+ >
+ );
+}
diff --git a/apps/playground/src/pages/apis/transaction/basics/index.tsx b/apps/playground/src/pages/apis/transaction/basics/index.tsx
index 3a92a582f..dc0e7c3f6 100644
--- a/apps/playground/src/pages/apis/transaction/basics/index.tsx
+++ b/apps/playground/src/pages/apis/transaction/basics/index.tsx
@@ -8,6 +8,7 @@ import { Intro } from "../common";
import TransactionBegin from "./begin";
import TransactionCip20 from "./cip20";
import TransactionCoinSelection from "./coin-selection";
+import TransactionGetTxbuilder from "./get-txbuilder";
import TransactionHandle from "./handle";
import TransactionMultisig from "./multisig";
import TransactionSendAssets from "./send-assets";
@@ -26,11 +27,13 @@ const ReactPage: NextPage = () => {
{ label: "Send value", to: "sendValue" },
{ label: "Multi-signature", to: "multisig" },
- { label: "Send assets to Handle", to: "handler" },
- { label: "Send assets to Begin ID", to: "begin" },
-
{ label: "Coin selection", to: "coinSelection" },
+ { label: "Get txbuilder", to: "getTxbuilder" },
+
+ { label: "ADA Handle", to: "handler" },
+ { label: "Begin ID", to: "begin" },
+
{ label: "Set metadata", to: "metadata" },
{ label: "Set transaction message", to: "cip20" },
@@ -69,10 +72,13 @@ const ReactPage: NextPage = () => {
+
+
+
+
-
diff --git a/apps/playground/src/pages/apis/transaction/minting/minting-one-signature.tsx b/apps/playground/src/pages/apis/transaction/minting/minting-one-signature.tsx
index 3e5a5a29b..114584741 100644
--- a/apps/playground/src/pages/apis/transaction/minting/minting-one-signature.tsx
+++ b/apps/playground/src/pages/apis/transaction/minting/minting-one-signature.tsx
@@ -102,8 +102,8 @@ function Right() {
recipient: address,
};
- // create transaction
- const tx = new Transaction({ initiator: wallet }).setNetwork("preprod");
+ const tx = new Transaction({ initiator: wallet });
+ tx.setNetwork("preprod");
tx.mintAsset(forgingScript, asset);
const unsignedTx = await tx.build();
diff --git a/apps/playground/src/pages/apis/utilities/resolvers/index.tsx b/apps/playground/src/pages/apis/utilities/resolvers/index.tsx
index 7c19b8940..f9ce53c95 100644
--- a/apps/playground/src/pages/apis/utilities/resolvers/index.tsx
+++ b/apps/playground/src/pages/apis/utilities/resolvers/index.tsx
@@ -13,6 +13,7 @@ import ResolvePaymentKeyHash from "./resolve-payment-key-hash";
import ResolvePlutusScriptAddress from "./resolve-plutus-script-address";
import ResolvePlutusScriptHash from "./resolve-plutus-script-hash";
import ResolvePrivateKey from "./resolve-private-key";
+import ResolveScriptHash from "./resolve-script-hash";
import ResolveSlotNumber from "./resolve-slot-number";
import ResolveRewardAddress from "./resolve-stake-address";
import ResolveRewardHash from "./resolve-stake-hash";
@@ -28,6 +29,7 @@ const ReactPage: NextPage = () => {
{ label: "Plutus Script Address", to: "resolvePlutusScriptAddress" },
{ label: "Plutus Script Hash", to: "resolvePlutusScriptHash" },
{ label: "Private Key", to: "resolvePrivateKey" },
+ { label: "Script Hash", to: "resolveScriptHash" },
{ label: "Stake Address", to: "resolveRewardAddress" },
{ label: "Stake Key Hash", to: "resolveRewardHash" },
{ label: "Transaction Hash", to: "resolveTxHash" },
@@ -55,6 +57,7 @@ const ReactPage: NextPage = () => {
+
diff --git a/apps/playground/src/pages/apis/utilities/resolvers/resolve-plutus-script-hash.tsx b/apps/playground/src/pages/apis/utilities/resolvers/resolve-plutus-script-hash.tsx
index 4b14210e7..b79dcaa46 100644
--- a/apps/playground/src/pages/apis/utilities/resolvers/resolve-plutus-script-hash.tsx
+++ b/apps/playground/src/pages/apis/utilities/resolvers/resolve-plutus-script-hash.tsx
@@ -22,9 +22,10 @@ function Left() {
return (
<>
- Provide the Plutus script address, and resolveScriptHash{" "}
- will return a script hash. This script hash can be use for building
- minting transaction with Plutus contract.
+ Provide the Plutus script address, and{" "}
+ resolvePlutusScriptHash will return a script hash. This
+ script hash can be use for building minting transaction with Plutus
+ contract.
>
);
@@ -36,8 +37,7 @@ function Right() {
);
async function runDemo() {
- const hash = resolvePlutusScriptHash(userInput);
- return hash;
+ return resolvePlutusScriptHash(userInput);
}
let codeSnippet = `resolvePlutusScriptHash('${userInput}')`;
diff --git a/apps/playground/src/pages/apis/utilities/resolvers/resolve-script-hash.tsx b/apps/playground/src/pages/apis/utilities/resolvers/resolve-script-hash.tsx
new file mode 100644
index 000000000..a3e84d46d
--- /dev/null
+++ b/apps/playground/src/pages/apis/utilities/resolvers/resolve-script-hash.tsx
@@ -0,0 +1,62 @@
+import { useState } from "react";
+
+import { resolveScriptHash } from "@meshsdk/core";
+
+import Input from "~/components/form/input";
+import InputTable from "~/components/sections/input-table";
+import LiveCodeDemo from "~/components/sections/live-code-demo";
+import TwoColumnsScroll from "~/components/sections/two-columns-scroll";
+
+export default function ResolveScriptHash() {
+ return (
+
+ );
+}
+
+function Left() {
+ return (
+ <>
+
+ resolveScriptHash will return a script hash. For example,
+ this is useful when you want to convert a script to a policy ID.
+