Created
November 9, 2020 01:29
-
-
Save kctam/41ab161e0c69ff029331df67e0115c08 to your computer and use it in GitHub Desktop.
Algorand demonstration with JS SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const algosdk=require('algosdk'); | |
const server="https://testnet-algorand.api.purestake.io/ps2"; | |
const port=""; | |
const token={ | |
"x-api-key": "mV *** BY" // fill in yours | |
}; | |
let client=new algosdk.Algodv2(token,server,port); | |
let account1 = 'MXSXYFX7XWWVYQHHBLJPJZYUJXY6JXXSOELIVNSRQDFM3NIH73ULFZHQAA'; | |
let account2 = '6NAKWTCPPHB4RZFYS26RT5QDCO6BFNVY3OYJV4WPMGOPDPFOB2GCSR5Z4M'; | |
( async() => { | |
let account1_info = (await client.accountInformation(account1).do()); | |
console.log("Balance of account 1: " + JSON.stringify(account1_info.amount)); | |
let account2_info = (await client.accountInformation(account2).do()); | |
console.log("Balance of account 2: " + JSON.stringify(account2_info.amount)); | |
})().catch(e => { | |
console.log(e); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment