Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.6.10 #272

Merged
merged 19 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ function Right() {
const [amount, setAmount] = useState<string>("1000000");

async function runDemo() {
const tx = new Transaction({ initiator: wallet }).sendLovelace(
address,
amount,
);
const tx = new Transaction({
initiator: wallet,
verbose: true,
}).sendLovelace(address, amount);

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