Skip to content

Commit

Permalink
improved readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrokonrad committed Jan 24, 2025
1 parent bd74748 commit 05dffbb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<p align="center">
<img width="100px" src="./logo/lucid.svg" align="center"/>
<h1 align="center">Lucid</h1>
<p align="center">Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.</p>
<p align="center">Lucid is a library designed to simplify creating Cardano transactions and writing off-chain code for Plutus contracts.</p>

<p align="center">
<img src="https://img.shields.io/github/commit-activity/m/berry-pool/lucid?style=for-the-badge" />
<a href="https://www.npmjs.com/package/lucid-cardano">
<img src="https://img.shields.io/npm/v/lucid-cardano?style=for-the-badge" />
</a>
Expand All @@ -24,8 +23,6 @@

### Get started

Lucid is a Deno first TypeScript framework. Node.js and NPM are still supported, but may be deprecated in the future.

#### Deno 🦕

For JavaScript and TypeScript
Expand Down Expand Up @@ -87,12 +84,34 @@ console.log(txHash);

Lucid supports [CIP-0057](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0057) blueprints.

Run the following command in a directory with a `plutus.json` file.

```
deno run -A https://deno.land/x/lucid/blueprint.ts
```

```js
You can import the example Aiken validator...

```
pub type MyData {
a: Int,
b: ByteArray,
}
validator validate(my_data: MyData) {
mint(redeemer: MyData, _policy_id: PolicyId, _transaction: Transaction) {
my_data == redeemer
}
}
```

...into Lucid using the generated `plutus.ts` file created with the blueprint command, as shown below:

```ts
import { ValidateMint } from "./plutus.ts";

const validator = new ValidateMint({a: 123n, b: "0000"});
const redeemer = ValidateMint.redeemer;
```

See [more examples](./tests/data.test.ts)
Expand Down Expand Up @@ -129,15 +148,12 @@ deno doc

### Compatibility

Lucid is an ES Module, so to run it in the browser any bundler which allows for
top level await and WebAssembly is recommended. If you use Webpack 5 enable in
Lucid is an ES Module, and to use it in the browser, a bundler that supports top-level await and WebAssembly is recommended. If you use Webpack 5 enable in
the `webpack.config.js`:

```
experiments: {
asyncWebAssembly: true,
topLevelAwait: true,
layers: true // optional, with some bundlers/frameworks it doesn't work without
}
```

Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"license": "MIT",
"exports": "./mod.ts",
"author": "Alessandro Konrad",
"description": "Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.",
"description": "Lucid is a library designed to simplify creating Cardano transactions and writing off-chain code for Plutus contracts.",
"repository": "https://github.com/spacebudz/lucid"
}

0 comments on commit 05dffbb

Please sign in to comment.