nspcc-dev / neo-go

Go Node and SDK for the Neo blockchain
MIT License
123 stars 80 forks source link

NEP5 balance and transactions tracking #498

Closed roman-khimov closed 4 years ago

roman-khimov commented 4 years ago

Analyze NEP5 transfers and save them into the DB, implement the following RPC APIs: https://docs.neo.org/docs/en-us/reference/rpc/latest-version/api/getnep5balances.html https://docs.neo.org/docs/en-us/reference/rpc/latest-version/api/getnep5transfers.html

It's needed for proper asset management and wallet operations.

roman-khimov commented 4 years ago

See also: https://github.com/neo-project/proposals/blob/master/nep-5.mediawiki

Notification example:

$ curl -d '{"jsonrpc": "2.0","method": "getapplicationlog","params": ["990e188ab5db18f3012e3ff148c69794d7e6153821db0854440a1a9c8fd97291"],"id": 1}' http://seed2.ngd.network:10332
{"jsonrpc":"2.0","id":1,"result":{"txid":"0x990e188ab5db18f3012e3ff148c69794d7e6153821db0854440a1a9c8fd97291","executions":[{"trigger":"Application","contract":"0x636bf7c04d4ff0ebae34d37181f0845ed4b134e5","vmstate":"HALT","gas_consumed":"2.792","stack":[],"notifications":[{"contract":"0xecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9","state":{"type":"Array","value":[{"type":"ByteArray","value":"7472616e73666572"},{"type":"ByteArray","value":"f03ac70eed6f30dd7515c582374d26dc37939cea"},{"type":"ByteArray","value":"114b62ee3b7f4f329e6a4c57383db32acd7aebc8"},{"type":"ByteArray","value":"00d4adf401"}]}}]}]}}