0

I am listening to wss://events.near.stream/ws using the following filter

{
"secret": "hnftsss",
"filter": [
    {
        "status": "SUCCESS",
        "event": {
            "standard": "nep141",
            "event": "ft_transfer"
        }
    },
]

}

reference - https://nomicon.io/Standards/Tokens/FungibleToken/Event

Why I am not receiving ft_transfer events even when I am transfering native NEAR tokens between my two wallets ?

Sonu Sharma
  • 304
  • 4
  • 13

1 Answers1

1

Later edit : The native NEAR token isn't an NEP-141 or NEP-21 token. The transfer of NEAR tokens is a base layer functionality of the NEAR Protocol and isn't tied to the NEP-141 or NEP-21 standards. Therefore, a transfer of NEAR tokens doesn't trigger an ft_transfer event from NEP-141.

If you want to listen for transfers of the native NEAR token, you may need to use a different method, such as querying the NEAR blockchain directly, or finding a service that provides events for NEAR token transfers.

Just tested this using this code :

const WebSocket = require('ws');

const ws = new WebSocket('wss://events.near.stream/ws');

ws.on('open', function open() {
  
  ws.send(
    JSON.stringify({
      secret: 'secret',
      filter: [
        {
          event: {
            standard: 'nep141',
            event: 'ft_transfer',
          },
        },
      ],
    }),
  );
});

ws.on('message', function incoming(data) {
  console.log('Received: %s', data);
});

ws.on('error', function error(err) {
  console.error('WebSocket encountered an error: ', err);
});

It's working. I am getting events.

Rares
  • 11
  • 4