Skip to content
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
11 changes: 11 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"permissions": {
"allow": [
"WebFetch(domain:prettier.io)",
"WebFetch(domain:code.visualstudio.com)",
"WebFetch(domain:github.com)"
],
"deny": [],
"ask": []
}
}
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "@meshsdk/configs/prettier";
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
38 changes: 38 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.requireConfig": true,
"eslint.workingDirectories": [
".",
"packages/*",
"apps/*",
"scripts/*"
]
}
2 changes: 1 addition & 1 deletion apps/playground/src/backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios from 'axios';
import axios from "axios";

const instance = axios.create({
baseURL: `/api/`,
Expand Down
7 changes: 4 additions & 3 deletions apps/playground/src/backend/support.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { post } from './';
import type { UTxO } from '@meshsdk/core';
import type { UTxO } from "@meshsdk/core";

import { post } from "./";

export async function createTransactionDonate(
recipientAddress: string,
amount: number,
utxos: UTxO[]
utxos: UTxO[],
) {
return await post(`donate-mint-mesh`, { recipientAddress, amount, utxos });
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import Button from "./button";
export default function ButtonFloatDocumentation({ href }: { href: string }) {
return (
<Link href={href}>
<Button className="fixed bottom-0 left-2 z-30" tooltip="Documentation" style="dark">
<Button
className="fixed bottom-0 left-2 z-30"
tooltip="Documentation"
style="dark"
>
<DocumentTextIcon className="h-5 w-5" />
</Button>
</Link>
Expand Down
6 changes: 4 additions & 2 deletions apps/playground/src/components/card/card-title-desc-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function CardTitleDescImage({
<Card className="h-full cursor-pointer hover:bg-neutral-100 dark:hover:bg-neutral-700">
{icon ? (
<div className="w-8 dark:text-white">
<Icon icon={icon} className="w-8 h-8 grayscale" />
<Icon icon={icon} className="h-8 w-8 grayscale" />
</div>
) : thumbnailNotioly ? (
<div className="relative h-40 w-full bg-white">
Expand Down Expand Up @@ -62,7 +62,9 @@ export default function CardTitleDescImage({
{title}
</h2>
{desc && (
<p className="font-light text-neutral-500 dark:text-neutral-400">{desc}</p>
<p className="font-light text-neutral-500 dark:text-neutral-400">
{desc}
</p>
)}
</Card>
</Link>
Expand Down
4 changes: 1 addition & 3 deletions apps/playground/src/components/cardano/mesh-wallet.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { BlockfrostProvider, MeshWallet } from "@meshsdk/core";

export function getProvider(network = "preprod") {
const provider = new BlockfrostProvider(
`/api/blockfrost/${network}/`,
);
const provider = new BlockfrostProvider(`/api/blockfrost/${network}/`);
provider.setSubmitTxToBytes(false);
return provider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default function LayoutImageHeaderAndBody({
<h1 className="mb-4 max-w-4xl text-2xl font-extrabold leading-none text-white sm:text-3xl lg:text-4xl">
{title}
</h1>
<p className="text-lg font-normal text-neutral-300">{description}</p>
<p className="text-lg font-normal text-neutral-300">
{description}
</p>
</div>
</header>
<div className="relative z-20 -m-36 mx-4 flex max-w-screen-xl justify-between rounded-lg border border-neutral-200 bg-white p-6 shadow-md xl:-m-32 xl:mx-auto xl:p-9 dark:border-neutral-700 dark:bg-neutral-800">
Expand Down
4 changes: 3 additions & 1 deletion apps/playground/src/components/layouts/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default function Markdown({ children }: { children: React.ReactNode }) {
</h2>
),
//@ts-ignore
a: (props) => <Link href={props.href}>{props.children as string}</Link>,
a: (props) => (
<Link href={props.href ?? ""}>{props.children as string}</Link>
),
}}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function TwoColumnsScroll({
<LinkIcon className="h-5 w-5" />
</button>
</div>
<div className="grid grid-cols-1 md:px-4 pb-16 lg:grid-cols-2 lg:gap-16">
<div className="grid grid-cols-1 pb-16 md:px-4 lg:grid-cols-2 lg:gap-16">
<div className="col-span-1 xl:col-auto">{leftSection}</div>
{rightSection && <div className="col-span-1">{rightSection}</div>}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function MenuItemDropdown({
>
<button
type="button"
className="dark:text-white lg:hover:text-black lg:dark:hover:text-white dark:hover:text-white flex w-full items-center justify-between border-b border-neutral-100 py-2 pl-3 pr-4 font-medium text-neutral-700 hover:bg-neutral-50 lg:w-auto lg:border-0 lg:p-0 lg:hover:bg-transparent dark:border-neutral-700 dark:hover:bg-neutral-700 lg:dark:hover:bg-transparent"
className="flex w-full items-center justify-between border-b border-neutral-100 py-2 pl-3 pr-4 font-medium text-neutral-700 hover:bg-neutral-50 lg:w-auto lg:border-0 lg:p-0 lg:hover:bg-transparent lg:hover:text-black dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:hover:text-white lg:dark:hover:bg-transparent lg:dark:hover:text-white"
aria-label="More"
>
{title}
Expand Down
2 changes: 1 addition & 1 deletion apps/playground/src/components/site/navbar/menu-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function MenuItem({
<li>
<Link
href={link}
className="lg:hover:text-black lg:dark:hover:text-white dark:hover:text-white block border-b border-neutral-100 py-2 pl-3 pr-4 text-neutral-700 hover:bg-neutral-50 lg:border-0 lg:p-0 lg:hover:bg-transparent dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 lg:dark:hover:bg-transparent hover:no-underline"
className="block border-b border-neutral-100 py-2 pl-3 pr-4 text-neutral-700 hover:bg-neutral-50 hover:no-underline lg:border-0 lg:p-0 lg:hover:bg-transparent lg:hover:text-black dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:hover:text-white lg:dark:hover:bg-transparent lg:dark:hover:text-white"
>
{title}
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function SubmenuItem({
className="flex w-full items-center px-4 py-2 hover:text-black dark:hover:text-white"
target={link.startsWith("http") ? "_blank" : "_self"}
>
<Icon icon={icon} className="mr-2 w-4 h-4" />
<Icon icon={icon} className="mr-2 h-4 w-4" />
{title}
</Link>
</li>
Expand Down
12 changes: 3 additions & 9 deletions apps/playground/src/components/svgs/hydra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ export default function SvgHydra({
fill={fill}
className={className}
>
<path
d="M20.9294 16.3976C20.9294 16.3976 20.9358 15.3266 20.3616 14.1253C19.0297 11.3398 14.9511 6.74717 2.44965 8.86911L0 13.0703L2.54633 15.0556C4.06401 14.4519 14.2443 8.67912 20.9294 16.3974V16.3976ZM4.08846 10.8233L3.24446 12.1819L1.88586 11.3379L4.08846 10.8233Z"
></path>
<path
d="M20.5776 20.3707C20.4668 19.713 19.3421 17.1372 16.296 15.7499C13.2916 14.3817 8.6545 14.2215 2.01156 18.1487L1.30078 22.5083L4.03963 23.745C4.03963 23.745 12.8396 14.251 20.5778 20.3704L20.5776 20.3707ZM3.72907 20.8007L2.16445 20.4564L4.07336 19.2358L3.72935 20.8004L3.72907 20.8007Z"
></path>
<path
d="M24.8502 4.43443C23.7434 3.24952 22.3305 2.38107 20.8536 1.74477L22.5703 0H12.2523L5.80469 2.91929L7.20152 5.91558C16.105 5.48023 22.8094 9.08584 23.1751 15.9556C23.5638 23.2615 16.3385 27.8964 9.38191 26.5819C7.07645 26.1462 5.89041 25.6401 5.89041 25.6401C7.46317 27.0198 10.67 28.7297 14.5114 28.7789C22.2549 28.8775 28.6281 22.5603 28.7751 14.6779C28.8495 10.6999 27.3408 7.08194 24.8496 4.43472L24.8502 4.43443ZM12.2526 3.01822L10.9311 1.69671H13.5741L12.2526 3.01822Z"
></path>
<path d="M20.9294 16.3976C20.9294 16.3976 20.9358 15.3266 20.3616 14.1253C19.0297 11.3398 14.9511 6.74717 2.44965 8.86911L0 13.0703L2.54633 15.0556C4.06401 14.4519 14.2443 8.67912 20.9294 16.3974V16.3976ZM4.08846 10.8233L3.24446 12.1819L1.88586 11.3379L4.08846 10.8233Z"></path>
<path d="M20.5776 20.3707C20.4668 19.713 19.3421 17.1372 16.296 15.7499C13.2916 14.3817 8.6545 14.2215 2.01156 18.1487L1.30078 22.5083L4.03963 23.745C4.03963 23.745 12.8396 14.251 20.5778 20.3704L20.5776 20.3707ZM3.72907 20.8007L2.16445 20.4564L4.07336 19.2358L3.72935 20.8004L3.72907 20.8007Z"></path>
<path d="M24.8502 4.43443C23.7434 3.24952 22.3305 2.38107 20.8536 1.74477L22.5703 0H12.2523L5.80469 2.91929L7.20152 5.91558C16.105 5.48023 22.8094 9.08584 23.1751 15.9556C23.5638 23.2615 16.3385 27.8964 9.38191 26.5819C7.07645 26.1462 5.89041 25.6401 5.89041 25.6401C7.46317 27.0198 10.67 28.7297 14.5114 28.7789C22.2549 28.8775 28.6281 22.5603 28.7751 14.6779C28.8495 10.6999 27.3408 7.08194 24.8496 4.43472L24.8502 4.43443ZM12.2526 3.01822L10.9311 1.69671H13.5741L12.2526 3.01822Z"></path>
</svg>
);
}
10 changes: 5 additions & 5 deletions apps/playground/src/components/text/codeblock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export default function Codeblock({
const [isMounted, setIsMounted] = useState(false);

const { onCopy } = useClipboard(
isJson
? JSON.stringify(data, null, 2)
isJson
? JSON.stringify(data, null, 2)
: data
.split('\n')
.map(line => line.replace(/^\$\s*/, ''))
.join('\n')
.split("\n")
.map((line) => line.replace(/^\$\s*/, ""))
.join("\n"),
);

function copy() {
Expand Down
6 changes: 5 additions & 1 deletion apps/playground/src/data/links-articles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ export const articleElementsOfCardano = {
image: "/articles/spices-4185324_640.jpg",
};

export const linksArticles: MenuItem[] = [articleElementsOfCardano,articleMesh20, articleNew16];
export const linksArticles: MenuItem[] = [
articleElementsOfCardano,
articleMesh20,
articleNew16,
];

export const metaArticles: MenuItem = {
link: `/blogs`,
Expand Down
1 change: 0 additions & 1 deletion apps/playground/src/data/links-frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const metaSvelte = {
// nuxt
// react-native


export const linksFrameworks: MenuItem[] = [metaNextjs, metaSvelte];

export const metaFrameworks: MenuItem = {
Expand Down
2 changes: 1 addition & 1 deletion apps/playground/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function App({ Component, pageProps }: AppProps) {
<header>
<Navbar />
</header>
<main className="bg-white pt-16 dark:bg-neutral-900 font-sans">
<main className="bg-white pt-16 font-sans dark:bg-neutral-900">
<Component {...pageProps} />
</main>
<Footer />
Expand Down
5 changes: 1 addition & 4 deletions apps/playground/src/pages/aiken/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ export async function getAssetUtxo({
datum: any;
}) {
const provider = getProvider();
const utxos = await provider.fetchAddressUTxOs(
scriptAddress,
asset,
);
const utxos = await provider.fetchAddressUTxOs(scriptAddress, asset);

const dataHash = resolveDataHash(datum);

Expand Down
5 changes: 1 addition & 4 deletions apps/playground/src/pages/aiken/first-script/build.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from "~/components/link";

import TwoColumnsScroll from "~/components/sections/two-columns-scroll";
import Codeblock from "~/components/text/codeblock";

Expand All @@ -21,9 +20,7 @@ function Left() {
<p>
This command will compile the smart contract and generate the
<code>plutus.json</code> file in the root folder. This file is a{" "}
<Link
href="https://cips.cardano.org/cip/CIP-0057"
>
<Link href="https://cips.cardano.org/cip/CIP-0057">
CIP-0057 Plutus blueprint
</Link>
, blueprint describes your on-chain contract and its binary interface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ function Left() {
</li>
</ul>
<p>
For the rest of data primitives, they are represented by JS
primitives:
For the rest of data primitives, they are represented by JS primitives:
</p>
<ul>
<li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from "~/components/link";

import TwoColumnsScroll from "~/components/sections/two-columns-scroll";

export default function JSONPlutusData() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import Link from "~/components/link";

import Link from "~/components/link";
import TwoColumnsScroll from "~/components/sections/two-columns-scroll";

export default function MeshPlutusData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ function Left() {
rids of unnecessary wrappers.
</p>
<p>
Mesh supports building data for your app in all 3 different formats.{" "}
Mesh supports building data for your app in all 3 different
formats.{" "}
</p>
<div>
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function Right() {
recipient: address,
};

const tx = new Transaction({ initiator: wallet }).setNetwork('preprod');
const tx = new Transaction({ initiator: wallet }).setNetwork("preprod");
tx.mintAsset(forgingScript, asset);

const unsignedTx = await tx.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ function Left() {
To get the <code>keyHash</code>, use the{" "}
<code>deserializeAddress()</code>. To get the slot, use the{" "}
<code>resolveSlotNo()</code>. Check out{" "}
<Link href="/apis/utilities/resolvers">Resolvers</Link> on how to use these
functions.
<Link href="/apis/utilities/resolvers">Resolvers</Link> on how to use
these functions.
</p>
<p>
Important: if you are using a policy locking script, you must define{" "}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,17 @@ function Left() {
return (
<>
<p>
In Plutus smart contracts, a datum is a piece of data that is attached to a transaction output. It plays a crucial role in enabling smart contracts to validate and execute transactions based on specific conditions. Mesh SDK provides the flexibility to design datum structures tailored to your contract requirements.
In Plutus smart contracts, a datum is a piece of data that is attached
to a transaction output. It plays a crucial role in enabling smart
contracts to validate and execute transactions based on specific
conditions. Mesh SDK provides the flexibility to design datum structures
tailored to your contract requirements.
</p>
<p>
The <code>Data</code> type in Mesh SDK allows you to create various datum structures, including strings, numbers, arrays, maps, and constructors. Additionally, the <code>resolveDataHash</code> function helps verify the integrity of the datum by generating its hash.
The <code>Data</code> type in Mesh SDK allows you to create various
datum structures, including strings, numbers, arrays, maps, and
constructors. Additionally, the <code>resolveDataHash</code> function
helps verify the integrity of the datum by generating its hash.
</p>
<Codeblock
data={`import { resolveDataHash } from '@meshsdk/core';\nimport type { Data } from '@meshsdk/core';`}
Expand All @@ -104,8 +111,14 @@ function Left() {

<h3>Best Practices</h3>
<ul>
<li>Ensure the datum structure aligns with the requirements of your Plutus smart contract.</li>
<li>Use <code>resolveDataHash</code> to validate datum integrity before attaching it to a transaction.</li>
<li>
Ensure the datum structure aligns with the requirements of your Plutus
smart contract.
</li>
<li>
Use <code>resolveDataHash</code> to validate datum integrity before
attaching it to a transaction.
</li>
<li>Optimize datum design for performance and compatibility.</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from "~/components/link";

import TwoColumnsScroll from "~/components/sections/two-columns-scroll";
import Codeblock from "~/components/text/codeblock";

Expand Down
Loading