{"id":21082765,"url":"https://github.com/renproject/ren-js-demo","last_synced_at":"2025-05-16T09:32:13.114Z","repository":{"id":52240664,"uuid":"303965390","full_name":"renproject/ren-js-demo","owner":"renproject","description":"Simple UI to demo RenJS","archived":false,"fork":false,"pushed_at":"2021-05-26T04:28:34.000Z","size":67071,"stargazers_count":4,"open_issues_count":2,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2023-03-02T04:22:06.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-14T09:26:34.000Z","updated_at":"2021-06-17T06:58:44.000Z","dependencies_parsed_at":"2022-08-26T05:40:15.391Z","dependency_job_id":null,"html_url":"https://github.com/renproject/ren-js-demo","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renproject%2Fren-js-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renproject%2Fren-js-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renproject%2Fren-js-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renproject%2Fren-js-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renproject","download_url":"https://codeload.github.com/renproject/ren-js-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225419562,"owners_count":17471434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T20:15:14.355Z","updated_at":"2024-11-19T20:15:14.899Z","avatar_url":"https://github.com/renproject.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RenJS v2 Demo\n\nSimple UI to demo RenJS.\n\n\u003cimg height=\"400\" alt=\"RenJS Demo Screenshot\" src=\"./screenshot.png\" /\u003e\n\n## Running locally\n\nClone this repository and run:\n\n```sh\n# Install dependencies:\nyarn\n\n# Start development server:\nyarn start\n```\n\n## RenJS v2 Example\n\n```ts\nimport { Bitcoin, Ethereum } from \"@renproject/chains\";\nimport RenJS from \"@renproject/ren\";\nimport Web3 from \"web3\";\n\nexport const main = async (web3: Web3) =\u003e {\n    const renJS = new RenJS(\"mainnet\", { logLevel: \"log\" });\n\n    const lockAndMint = await renJS.lockAndMint({\n        asset: \"BTC\",\n        from: Bitcoin(),\n        to: Ethereum(web3.currentProvider).Account({\n            address: \"0x1234...\",\n        }),\n\n        nonce: \"0x\" + \"00\".repeat(32),\n    });\n\n    console.log(\n        `Deposit ${lockAndMint.params.asset} to ${lockAndMint.gatewayAddress}.`\n    );\n\n    lockAndMint.on(\"deposit\", async (deposit) =\u003e {\n        await deposit\n            .confirmed()\n            .on(\"confirmation\", (confs, target) =\u003e\n                console.log(`Confirmations: ${confs}/${target}`)\n            );\n\n        await deposit.signed();\n        await deposit\n            .mint()\n            .on(\"transactionHash\", (txHash) =\u003e\n                console.log(`TxHash: ${txHash}`)\n            );\n    });\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenproject%2Fren-js-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenproject%2Fren-js-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenproject%2Fren-js-demo/lists"}