1

您好我尝试登录后获取帐户余额总是发送相同的错误

if (window.walletConnection.getAccountId()) {
  window.account = await near.account(walletConnection.getAccountId());
  window.account.getAccountBalance().then(balance=>{
    console.log(balance)
  }).catch(e =>{
    console.log(e)
  })
}

* TypeError:无法在 Account.getAccountBalance (near-api-js.js:346:78) 处读取未定义的属性(读取 'storage_amount_per_byte')

更新 配置:

    const config = {
    nodeUrl: "https://rpc.testnet.near.org",
    deps: {
        keyStore: new nearApi.keyStores.BrowserLocalStorageKeyStore(),
    },
    networkId: 'testnet',
        nodeUrl: 'https://rpc.testnet.near.org',
    contractName: CONTRACT_NAME,
    walletUrl: 'https://wallet.testnet.near.org',
    helperUrl: 'https://helper.testnet.near.org'


};
4

0 回答 0