[NEM] Wallet情報の取得

var nem = require("nem-sdk").default;

const endpoint = nem.model.objects.create('endpoint')(nem.model.nodes.defaultMainnet, nem.model.nodes.defaultPort);

const mainnetAddress = '****'

async function main() {
	await nem.com.requests.account.data(endpoint, mainnetAddress).then(res => {
		console.log('balance:', res.account);
	}).catch(err => {
		console.log(err);
	});
}

main();

$ node wallet.js
balance: { address: ‘****’,
harvestedBlocks: 0,
balance: 00000000,
importance: 0,
vestedBalance: 00000000,
publicKey:
‘****’,
label: null,
multisigInfo: {} }

なるほどね、アカウントにいくら入ってるかってのは誰でも見れちゃうんだな