Code Monkey home page Code Monkey logo

ren-js-demo's Introduction

RenJS v2 Demo

Simple UI to demo RenJS.

RenJS Demo Screenshot

Running locally

Clone this repository and run:

# Install dependencies:
yarn

# Start development server:
yarn start

RenJS v2 Example

import { Bitcoin, Ethereum } from "@renproject/chains";
import RenJS from "@renproject/ren";
import Web3 from "web3";

export const main = async (web3: Web3) => {
    const renJS = new RenJS("mainnet", { logLevel: "log" });

    const lockAndMint = await renJS.lockAndMint({
        asset: "BTC",
        from: Bitcoin(),
        to: Ethereum(web3.currentProvider).Account({
            address: "0x1234...",
        }),

        nonce: "0x" + "00".repeat(32),
    });

    console.log(
        `Deposit ${lockAndMint.params.asset} to ${lockAndMint.gatewayAddress}.`
    );

    lockAndMint.on("deposit", async (deposit) => {
        await deposit
            .confirmed()
            .on("confirmation", (confs, target) =>
                console.log(`Confirmations: ${confs}/${target}`)
            );

        await deposit.signed();
        await deposit
            .mint()
            .on("transactionHash", (txHash) =>
                console.log(`TxHash: ${txHash}`)
            );
    });
};

ren-js-demo's People

Contributors

noiach avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ren-js-demo's Issues

invalid path 'public/og:image.png'

$ git clone [email protected]:renproject/ren-js-demo.git
Cloning into 'ren-js-demo'...
remote: Enumerating objects: 301, done.
remote: Counting objects: 100% (301/301), done.
remote: Compressing objects: 100% (233/233), done.
remote: Total 301 (delta 171), reused 194 (delta 64), pack-reused 0
Receiving objects: 100% (301/301), 22.16 MiB | 120.00 KiB/s, done.
Resolving deltas: 100% (171/171), done.
error: invalid path 'public/og:image.png'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

cannot clone on windows 10

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.