Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.57 KB

README.md

File metadata and controls

45 lines (35 loc) · 1.57 KB

💳 AlgoMinimalWallet

Unit tests Lint Build npm version npm bundle size (scoped version)

A simple class to programmaticaly interact with the Algorand blockchain

Installation

npm i algo-minimal-wallet

Usage

import AlgoMinimalWallet from "algo-minimal-wallet"

const amw = new AlgoMinimalWallet({
	algodInfo: {
        server: 'ALGO_NODE_URL',
        port: 'ALGO_NODE_PORT',
        token: 'ALGO_NODE_TOKEN',
    }
	wallet: {
		address: 'YOUR_PUBLIC_ADDRESS',
		mnemonicPhrase: 'YOUR_MNEMONIC_PHRASE',
	},
})

(async () => {
    const balances = await amw.getBalances()
    // balances = { ALGO: 12.3, USDC: 140, ... }
    const { txId: algoSendTransactionId } = await amw.sendAlgo({ to: 'RECIPIENT_ADDRESS', amount: 10 })
    const { txId: asaSendTransactionId } = await amw.sendAsa({ to: 'RECIPIENT_ADDRESS', amount: 100, assetId: 3301 })
})()

MinimalAlgoWallet needs two things to work :

  • Public or private algod node credentials
  • Your public address and mnemonic phrase in order to sign the transactions