1.4.1 • Published 9 months ago

lute-connect v1.4.1

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

Overview

Lute Connect is a Javascript library to securely sign transactions with Lute, an Algorand web wallet.

Installation

The package can be installed via npm:

npm i lute-connect

API Usage

Quick start

import LuteConnect from "lute-connect";
const lute = new LuteConnect("<YOUR_SITE_NAME>");

Connect to Lute

// Warning: Browser will block pop-up if user doesn't trigger lute.connect() with a button click
async function connect() {
  try {
    const genesis = await algodClient.genesis().do();
    const genesisID = `${genesis.network}-${genesis.id}`;
    const addresses = await lute.connect(genesisID);
    // handle user address selection and storage
  } catch (err: any) {
    console.error(`[LuteWallet] Error connecting: ${err.message}`);
    throw err;
  }
}

Sign transactions

// Warning: Browser will block pop-up if user doesn't trigger lute.signTxns() with a button click
async function signTransactions(txns) {
  try {
    const signedTxns = await lute.signTxns(txns);
    // handle signedTxns (e.g. submit to algodClient)
  } catch (err: any) {
    console.error(
      '[LuteWallet] Error signing transactions: ' +
        (err instanceof SignTxnsError
          ? `${err.message} (code: ${err.code})`
          : err.message)
    );
    throw err;
  }
}
1.4.1

9 months ago

1.4.0

9 months ago

1.4.0-beta.1

9 months ago

1.4.0-beta.0

9 months ago

1.3.0

12 months ago

1.2.0

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.7

1 year ago

1.0.5

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.0

1 year ago