Code Monkey home page Code Monkey logo

translucent's Introduction

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>",
    turboSubmit: true,
  }),
  "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!

translucent's People

Contributors

baymac avatar ezepze avatar ilap avatar joacohoyos avatar ljttl3q04t avatar longngn avatar m1n999999 avatar micahkendall avatar piefayth avatar sourabhxyz avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.