cardano-translucent

0.0.1 • Public • Published

Translucent

Translucent is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript.
Translucent forks from Lucid and makes major breaking changes.

Get started

Bun

Development happens in bun. We use bun build:wasm, bun test. If you want to contribute to translucent, please do so with bun. Translucent can be used from any other js runtime.

NPM

npm install translucent-cardano

Vite packaging

Use polyfills to make translucent run in the browser.

(these polyfills are preliminary and we should package translucent for the browser)

resolve: {
		alias: {
			'node-fetch': 'node-fetch-polyfill',
			'sha256': 'tiny-sha256',
			'@sinclair/typebox': '@sinclair/typebox',
			'@dcspark/cardano-multiplatform-lib-nodejs': '@dcspark/cardano-multiplatform-lib-browser',
			'uplc-node': 'translucent/uplc/pkg-web',
			'@emurgo/cardano-message-signing-nodejs': '@emurgo/cardano-message-signing-browser',
		}
	},
optimizeDeps: {
		exclude: ['translucent', 'typebox'],
    ...
	},

Deno

... how to use translucent in deno ...

Basic usage

import { Maestro, Translucent } from "translucent-cardano";

const translucent = await Translucent.new(
  new Maestro({ network: "Mainnet", apiKey: "<apikey>" }),
  "Mainnet",
);

// Assumes you are in a browser environment
const api = await window.cardano.nami.enable();
translucent.selectWallet(api);

const tx = await translucent
  .newTx()
  .payToAddress("addr...", { lovelace: 5000000n })
  .complete();

const signedTx = await tx.sign().complete();

const txHash = await signedTx.submit();

console.log(txHash);

Join us on Discord!

Readme

Keywords

none

Package Sidebar

Install

npm i cardano-translucent

Weekly Downloads

1

Version

0.0.1

License

none

Unpacked Size

1.74 MB

Total Files

54

Last publish

Collaborators

  • micahkendall