Getting Transaction Information from Harmony Explorer Using React Boris Polania
Ethereum Denver·Sun, Oct 9, 2022, 12:00 AM
Transcript
okay hello everyone i was expecting a small room full of harmony hackers so well uh so i get a basic intro for those who are not acquainted with harmony we are layer one blockchain we are evm compatible so use basically that means that if you want to deploy in harmony and you are already deployed on ethereum the same contracts should work um if not if you're if you are is the first time you're deploying well i guess um yes it's easy and we are low fee a fast blockchain so it's a good place to start and so this is a technical workshop so basically i'm doing this one because this is one of the questions i have more common from developers the this is the we we don't have you we don't use ether scan we have our own explorer this is usually how orange explorer looks like the transactions and this is usually when you find look for a transaction explorer this is what that what information you get from the explorer so sometimes it's hard to extract this information the basic the basic fields are kind of easy to access but other fields like the token transfers like the transaction fees are not necessarily easy to get so you have to go through the websocket directly so we don't have an api per se so we basically you go to to the websocket so this is what i'm about to show you basically get the end point either test net or magnet and you got access you you request the feet and the feet should give you a big bulk of information these people information have to be parsed so basically what the best way to do this is ask the to give you the the locks by feel the fields are actually let me say close this the fields are actually this information here right so you basically us ask them to use to get you the fields and it will give you the fields and yeah you only need to parse them after you get it and how you parse them is basically you have to let them know it's about topics i showed you how a regular response and how it whether it's okay i don't know here so a regular response when you when you call you hit that endpoint is this you get topics of information and each one has all the information of the fields so you just you just need to tell him which topic you want to to to select and then it will give you all the information in in byte code so you need to parse it so the first thing you need to know is which topic are you pointing right in this case i'm trying to get this information trying to get the transfer token transfer so i'm i'm for this demo i'm just trying to do so i i just i just know the name of the the of the of the the address of the topic and that is transfer talk is this one um and then you ask you ping the end point with this it will give you the the bulk then it will give you a lot of fields and then you just when you get the parse information you just i point the the field you know this one of course yeah yeah sure so this is the one i'm trying to get this one so one of the issues here is that you don't it's not well documented which field you're you're pointing to right so i have a big list that i can provide if you if you need it but otherwise you can go through the whole bulk and and look what you're needing for but the response you're getting is this one right sorry you're getting this one so you get the topic and then you get all the information you just need to point it in there so i'm working a document what you can get you know i i'm getting the more common fields you know if you can always talk to us you don't find it but this is basically the first approach you get all the bulk and all up to here when it's parsed then you need to go the name of the zero a one two three four until you get the one you need or you know i will try to get the the mapping polish so everyone can use it so that's basically the way the the reason i kept getting this question is because we don't have an api per se we're not using either scan or anything so i created this library so people can you know easily access the the explorer information and yeah that was pretty much it i mean i was expecting a little more people coding so i was thinking more time from the q a but you know we are having the harmony hub up front for the guys doing the hackathon uh this morning actually i was like two people asking me this so if you get stuck if you need information from the from the from the explorer stop by is open until midnight if you're on a hackathon even if you're not in a hackathon you just want to know about it we're always some technical person there to help you guys and also you can get food and good networking so yeah the building up front is called a colorado history something you will see the harmony um signs there so stop by any technical question you have not only related with this um oh this code is completely javascript so it's typescript and the only actual library you need to import is this socket the io client the rest is your pure pure parsing and native stuff in javascript so no it will run easily in react no nothing you don't need to do much else so i don't know if you have any questions if this does not that's all i have [Applause]
Automatic transcript — names and jargon may be misspelled.