A simple class to programmaticaly interact with the Algorand blockchain
npm i algo-minimal-wallet
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