title: (node:64344) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hash' of undefined
body: <p>I get this error when i try to run the below code in vscode ( (node:64344) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hash' of undefined) and i don't understand what to do. I been searching on google but did not find an answer. So now i try in here</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const lib = require('xrpl-accountlib')
  const { XrplClient } = require('xrpl-client')
  
  const secret = 's--'
  const account = 'a---' // Can be derived
  
  const client = new XrplClient('wss://s1.ripple.com')
  const keypair = lib.derive.familySeed(secret)
  
  const main = async () =&gt; {
    console.log('Getting ready...')
    const { account_data } = await client.send({ command: 'account_info', account })
      console.log(account_data.Sequence);
    const tx = {
      "TransactionType": "TrustSet",
      "Account": account,
      "Fee": "12",
      "Flags": 262144,
      "LastLedgerSequence": 8007750,
      "LimitAmount": {
        "currency": "TET",
        "issuer": "a--",
        "value": "100"
      },
      "Sequence": account.Sequence
  }
  
    const {signedTransaction} = lib.sign(tx, keypair)
    const submit = await client.send({ command: 'submit', 'tx_blob': signedTransaction })
    console.log(submit.engine_result, submit.engine_result_message, submit.tx_json.hash)
    console.log(submit)
    client.close()
  }
  
  main()</code></pre>
  </div>
  </div>
  </p>