0

Im connecting to BSC websocket with:

let options = {
    filter: {
        value: [],
    },
    fromBlock: 0
};

myContract.events.Transfer(options)
    .on('data', event => console.log(event))
    .on('changed', changed => console.log(changed))
    .on('error', err => throw err)
    .on('connected', str => console.log(str))

In response on the 'data' event I get the returnValues

   data  {
  address: 'xxxxx',
  blockNumber: xxx,
  transactionHash: 'xxxx',
  transactionIndex: 17,
  blockHash: 'xxx',
  logIndex: 35,
  removed: false,
  id: 'xx',
  returnValues: Result {
    '0': 'xx',
    '1': 'xx',
    '2': '800000000000000000',
    from: 'xx',
    to: 'xxx',
    value: '800000000000000000'
  },
  event: 'Transfer',
  signature: 'xxx',
  raw: {
    data: 'xxx',
    topics: [
      'xxx',
      'xx',
      'xxx'
    ]
  }
}

I want to determine the SELL/BUY transaction. How I can know if this is sell or a buy??

Also what are the topics??

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.