Skip to content

A library to sign transactions with Lute Wallet

Notifications You must be signed in to change notification settings

drichar/lute-connect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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) {
    console.error(err);
  }
}

Sign transaction

// 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) {
    console.error(err);
  }
}

About

A library to sign transactions with Lute Wallet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.8%
  • JavaScript 6.2%