vitelabs/vite.js

How to use quota to send accountBlock

Closed this issue · 1 comments

Hi,

I'm implementing transaction auto-receive.
My account has quota (15 UT).
If use transaction.send(), or transaction.autoSend, it throws the error "out of quota".
But transaction.sendByPoW(), it works

here is my working code, please tell me how I could use quota instead of PoW

  async receiveAccountBlock(): Promise<void> {
    const transaction = new Transaction(this.address)
      .receive({ sendBlockHash: this.hash })

    transaction.setProvider(this.client)
    transaction.setHeight(`${this.previousAccountHeight + 1}`)
    transaction.setPreviousHash(this.previousHash)
    transaction.sign(PRIVATE_KEY)
    await transaction.sendByPoW(PRIVATE_KEY)
  }

osdio commented

Now you can update 2.3.7 for using receiveAccountBlockTask
https://vite.wiki/api/vitejs/accountBlock/receiveAccountBlockTask.html