@marlowe.io/wallet
TypeScript icon, indicating that this package has built-in type declarations

0.4.0-beta • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @marlowe.io/wallet

Weekly Downloads

10

Version

0.4.0-beta

License

Apache-2.0

Unpacked Size

1.15 MB

Total Files

35

Last publish

Collaborators

  • hrajchert
  • nhenin
  • inputoutput