0.4.0-beta • Published 11 days ago

@marlowe.io/wallet v0.4.0-beta

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 days ago

Description

This package provides wallet functionality for the rest of the SDK packages.

It has the following modules:

  • @{@link api | marlowe.io/wallet/api}: provides an abstract interface to work with a wallet.
  • @{@link browser | marlowe.io/wallet/browser}: provides a browser implementation of the api using the CIP30 specification.
  • @{@link lucid | marlowe.io/wallet/lucid}: provides a implementation of the api that can work in the browser, node.js and deno using Lucid.
  • @{@link index | marlowe.io/wallet}: Re-exports of the other modules.

Getting started

The @marlowe.io/wallet package is released as an ESM module and can be used with a modern bundler or imported directly in the browser (without any bundler) as long as you use an import map.

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 { mkBrowserWallet, getInstalledWalletExtensions } from "@marlowe.io/wallet";

      const installedWalletExtensions = getInstalledWalletExtensions();
      console.log(`Available Browser Wallet Extensions: ${installedWalletExtensions}`);
      const wallet = await mkBrowserWallet(installedWalletExtensions[0]);
    </script>
  </body>
</html>

Examples

There is a simple HTML file in the examples folder that shows how to use the wallet package to connect to a wallet extension and get basic info.