Skip to content

Commit

Permalink
add docs about verbose and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglescode committed Aug 24, 2024
1 parent 2915b1b commit d34947f
Show file tree
Hide file tree
Showing 7 changed files with 21,334 additions and 120 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from "react";

import { Transaction } from "@meshsdk/core";
import { useWallet } from "@meshsdk/react";

import Input from "~/components/form/input";
Expand All @@ -8,7 +9,6 @@ import LiveCodeDemo from "~/components/sections/live-code-demo";
import TwoColumnsScroll from "~/components/sections/two-columns-scroll";
import Codeblock from "~/components/text/codeblock";
import { demoAddresses, demoAsset } from "~/data/cardano";
import { Transaction } from "@meshsdk/core";

export default function TransactionSendAssets() {
return (
Expand Down Expand Up @@ -59,13 +59,6 @@ function Right() {
quantity: amount,
},
]);
tx.setMetadata(674, {
msg: [
"Invoice-No: 1234567890",
"Customer-No: 555-1234",
"P.S.: i will shop again at your store :-)",
],
});

const unsignedTx = await tx.build();
const signedTx = await wallet.signTx(unsignedTx);
Expand Down
7 changes: 6 additions & 1 deletion apps/playground/src/pages/apis/transaction/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Codeblock from "~/components/text/codeblock";
export function Intro() {
let example = ``;
example += `import { Transaction } from '@meshsdk/core';\n\n`;
example += `const tx = new Transaction({ initiator: wallet });\n`;
example += `const tx = new Transaction({ initiator: wallet, verbose: false });\n`;
example += `tx.foo(...); // add transaction methods\n`;
example += `tx.bar(...); // add transaction methods\n\n`;
example += `const unsignedTx = await tx.build();\n`;
Expand All @@ -22,6 +22,11 @@ export function Intro() {
and returns the remaining assets to the change address. Use{" "}
<code>wallet.signTx()</code> to sign transaction CBOR.
</p>
<p>
The <code>verbose</code> is optional and set to <code>false</code> by
default, setting it to <code>true</code> will enable verbose logging for
the txBodyJson prior going into build.
</p>
<Codeblock data={example} />
</>
);
Expand Down
Loading

0 comments on commit d34947f

Please sign in to comment.