0.0.1 • Published 1 year ago

algo-minimal-wallet v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

💳 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
0.0.1

1 year ago