假设我们像这样初始化并且用户已经登录:
const near = await window.nearlib.connect(Object.assign({ deps: { keyStore: new window.nearlib.keyStores.BrowserLocalStorageKeyStore() } }, window.nearConfig));
const walletAccount = new window.nearlib.WalletAccount(near);
我希望能够使用以下方式获得帐户的 NEAR 余额:
near.getBalanceOf(walletAccount.getAccountId()).then(...)
或许
walletAccount.getBalance().then(...)