New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

embedded-algo-wallet

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embedded-algo-wallet

A minimal TS package to embed a hot wallet into a dApp

latest
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

embedded-algo-wallet

A minimal TS package to embed a hot wallet into a dApp

WARNING: You should not be storing private keys for wallets that hold large monetary values. Browser storage is inherently less secure than other methods. This library is intended mainly for burner/hot wallets.

Overview

This library is inteded to help with storing private keys in web applications that use the Algorand blockchain but prefer to simplify the signing process to button presses instead of the usual wallet signing method.

This approach should be used only with accounts generated for the sole purpose of usage inside your application.

Initialize

const wallet = new Wallet("testnet"); // "localnet" | "testnet" | "mainnet" | "voimain"

await wallet.startup(); // Required after instantiation

Create Account

await wallet.createAcct(password); // New account

await wallet.createAcct(password, mnemonic); // Import an existing account

Lock/Unlock Wallet

wallet.lock(); // Lock

await wallet.unlock(password); // Unlock

console.log("Locked Status:", wallet.isLocked()); // true/false

Wallet Details

wallet.refresh(); // Refresh Account Info

console.log("Address:", wallet.acct.addr);
console.log("Balance:", Number(wallet.acctInfo.amount) / 10 ** 6);

Export Mnemonic

console.log(await wallet.exportAcct(password));

Example Transaction using signer

const algorand = AlgorandClient.fromClients({
  algod: wallet.algod as algosdk.Algodv2,
});

const result = await algorand.send.payment({
  sender: wallet.acct.addr,
  receiver: wallet.acct.addr,
  amount: microAlgos(0),
  signer: wallet.signer,
});

console.log("Confirmed in round " + result.confirmation.confirmedRound);
await wallet.refresh();

Clear Account

Use with caution or not at all! All key data is cleared from storage.

wallet.clearAcct();

FAQs

Package last updated on 10 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts