This module provides a helper function to create a RuntimeLifecycle using a CIP-30 wallet in the browser.

<html>
<body>
<script src="https://cdn.jsdelivr.net/gh/input-output-hk/marlowe-ts-sdk@0.4.0-beta/jsdelivr-npm-importmap.js"></script>
<script type="module">
import { mkRuntimeLifecycle } from "@marlowe.io/runtime-lifecycle/browser";
const walletName = "nami";
const runtimeURL = "http://localhost:32788";

console.log(
`<h2>Connecting the runtime instance at ${runtimeURL} and the ${walletName} Wallet Extension</h2>`
);
const runtimeLifecycle = await mkRuntimeLifecycle({
walletName: walletName,
runtimeURL: runtimeURL,
});
console.log("");
console.log("Connected to runtime...");
console.log("");

const avalaiblePayouts = await runtimeLifecycle.payouts
.available()
.catch((err) =>
log(`Error while retrieving availaible payouts : ${err}`)
);
console.log(`nbPayouts retrieved : ${avalaiblePayouts.length}`);
console.log("Payouts flow done 🎉");
</script>
</body>
</html>

Index

RuntimeLifecycle