Covalent 🛠Building Web3 Apps with One Unified API - Leibing Guo, Leilani Ledingham
ETHGlobal·Sun, Oct 9, 2022, 12:00 AM
Welcome Leibing Guo and Leilani Ledingham from Covalent for a workshop titled "Building Web3 Apps with One Unified API". ETHOnline is our biggest event of the year! Collaborate with thousands of developers and creatives from around the world and win over $300k+ in prizes! We're bringing in 30+ of the biggest teams in web3 to give you access like never before. Learn from ecosystem leaders and build your biggest ideas as the merge nears reality. The future of Ethereum is being written right now, and it's time to make your mark. --------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com #ethereum #web3 #blockchain #eth
Transcript
foreign [Applause] [Music] welcome to the covalent Studio my name is Leilani I'm a product manager at covalent and I'm leaving I work at devrel at Copeland and today we're going to tell you a little bit about how to build in web 3 with our unified API and just a little bit about covalent in general so before we started off the last year two years has been pretty big for the crypto slash web 3 space we've seen a ton of interest in people that are selling their first nfts or buying their first nfts creating crypto wallets and also developers that are looking to build Tools in this space so what we've noticed from a data perspective is millions and millions and millions of more rows of data that is being extracted from blockchains and there are quite a few challenges when it comes to blockchain data that maybe some of you are aware of if you've tried to extract it yourself or if you've used other tools um and if not we'll kind of illuminate some of those and position where covalent fits so let's talk about some of the challenges of uh getting blockchain data into the slides um so if you've ever tried to write custom queries yourself you'll know that they can be a little bit complicated and this can be things like building sub graphs or maybe you have designed a project that is on one chain you want to take it to another chain and you have to write an entirely new script you can also find that data is often missing delayed inconsistent there aren't that many standards when it comes to blockchain data because this is kind of a nascent space and most ecosystems kind of have their own rules it can be pretty challenging when you're trying to aggregate data if you're trying to build applications that exist in multiple ecosystems which is kind of the future that we envision at covalent the last thing is it can be expensive of course like anything as you scale the more you consume data typically the more you're paying for it this can be running your own nodes this can just be paying services like rpcs where your costs kind of ramp up so yeah we try to eliminate basically all of the digital the challenges that we face like this with covalent and I'll explain a little bit about how we do that so we saw the need for a unified Solution by unified I mean with so many different blockchain ecosystems it is hard for developers to learn new tools and languages each time that they want to build in these spaces so we thought having one tool one unified API that brings different blockchains together would make it a lot easier for people to focus on the application layer which needs to be developed to support a much bigger user base um so we kind of act as a data layer between blockchains nodes the applications that people like you are building and then the users that consume uh those applications so instead of running your own infrastructure or figuring out how to interact directly with each of these different networks you actually just query this data layer that we provide through a simple tool which is our unified API and it allows you to focus on things like nft galleries building crypto wallets maybe improving the user experience from what you've noticed or really anything else in that Realm so I kind of touched on it but what is covalent exactly it's basically a One-Stop shop to access all launching data um so we do this through a unified API it's actually a no code solution so obviously the if you're a developer you'll be more successful but if you are completely new to the space you can try it out in the browser or if you're an analyst we actually support a CSV mode as well and it's multi-chain native so everything that we do focuses on a multi-chain future meaning that applications need to be interoperable and these kind of things can't really live in silos forever so whatever you're building it'll be easier to scale when you have a tool where you just need to change a chain ID parameter here's some of the use cases with covalent data I'll point out a few that I like maybe leaving will point out some as well there's so many things you can do because uh we basically provide all of the data from Genesis block to now so with that you can really build anything that exists on a blockchain so like Dow tools defy dashboards that could compare the volume on different exchanges GameFly analytics we actually have an ebook on that on our website you can check out uh what are some other things you've seen um yeah Dex is or like um wallets and yeah basically a lot of things yeah whatever is like on chain you can retrieve it and it is a read-only API which we'll get into so right now we have an ecosystem of about 30 000 developers and over 3 000 projects here's some of the ones that you can check out um that are a little more familiar and then you can also go to our website to learn more about those but 30 000 developers in the grand scheme of things really isn't a lot there's about 300 million in the world and then there's about 300 000 they're estimated to be in web 3. so that puts us at like point zero one percent or something of the grand total yeah yeah so if you start developing now right that makes you the 0.1 percent exactly or developers everybody wants to be early um so basically this is a good time to learn these tools uh and to start grabbing at some of the opportunities that are here while there's actually not too much competition yep so it brings us to the unified API as I mentioned a unified API just brings together different blockchain ecosystems under one tool basically so it Aggregates apis as opposed to using an ethereum API a polygon API an avalanche API and all of these different tools that you have to piece together instead you're using one API and you change parameters so this is kind of how it looks you have block genes on the side on our left side which is just an example of some of the ones that we index we actually index over 40 blockchains right now and we always are adding more then you have our indexing nodes and we transform the data in our database into things that are queryable through Class A endpoints Class B endpoints and then coming soon our community built custom class CN points and I'll save more info on those for the demo that we'll do nice do you guys support a polygon yes we do we support polygon awesome fmos yes awesome and if you want to to see a list of them we'll head into the API reference right now and we can show you where you can find all the different chains that we support thank you Dave honey that was great um so now I'll take over and show you how I can start getting cracking at the API so first thing you just go to the documentation site yeah you go to your documentation site and you get an API key and you can start making queries directly from the browser here right so a lot of people get confused like oh what is Class A what is Class B they don't know right yeah so let me just give you a brief overview Class A is the kind of uh data that is consistent across all sorts of blockchains okay and you can see the blockchains that we support here right we've got Avalanche we've got polygon look at BSC we've got Phantom uh we've got Clayton and we also support the test Nets which is very useful if you're just trying to like deploy something and without cost right you don't want to use like real tokens to start building accidentally spend hundreds of dollars yeah exactly that's that's the the thing about developing in the web 3 space sometimes you can just lose money before you even make money um so we've got balances data right very popular I've got nft data we have uh data points that gives you the trans sections of an address and I've also got like things what we call Base which is like the kind of like block height which blocks are produced in which day uh the log events of any contract address so let me just give you an overview how you you can start using it select your chain ID you can select which currency you want to display your response in so for instance you want to get the balances of your wallet you can choose to display it in Singapore dollars right that makes it very useful for Singaporean developers and this could also be useful for like taxes or anything that's currency dependent or if you're looking at your own historical transactions you could see it in the money that you actually spent essentially exactly and then the default mode is the developer mode which gives the response as a Json object you can also go to analyst mode which gives you the response in CSV or Google Sheets so you know Excel depending on which one you prefer nice so yeah let's just go back to our default here and show you what we can get so Leilani uh which you know whose wallet balances are you most curious about in this world in the world um well there's a lot of celebrities that have recently gone into crypto there's a couple that are supposedly a lot more active one of them that I'm curious about is Paris Hilton who is Hilton and I happen to know her ens's Paris hilton.e awesome Let's uh figure out what she's holding okay oh there we go Paris hilton.eath and uh yeah let's run this so this is what Paris Hilton is holding obviously it's not very illuminative let me just open it up in a different tab so you can see everything so she's holding on to some open C token some Admiral Rockets token and how much of it you know this amount and this is in a weight right so you just uh divide it by 10 to the power of contract decimals to get it in uh eth nice yeah so um uh in a single API call how would this compare to using rpcs or something else so json.
pc calls you kind of need to supply the contract address of every single token that the person holds right and the thing is like it's a catch trainer too you don't know what token the person holds as well that's the whole reason you're asking the question yeah it is the whole reason yeah but then you have to supply the token address of what a person is holding and then on top of that you have to supply the API which you have to copy and paste somewhere and there's huge rooms for mistake given how huge that chungle data is and then you have to do the same for every single token right that the person is holding and so in this case let's say Paris Hilton is holding on to 30 tokens right you're making 30 API request calls through Json RPC and yeah that will just take up half your day maybe uh whereas if you just input a ens through the Covenant API you can get the response in a matter of seconds if I also wanted to going back to the balances endpoint and see like the nfts that somebody holds does it support that yes we do we support it under here so you include that in the parameter you set nft equals to true and you click run again and it'll show you the nfts that Paris Hilton holds as well awesome yeah so we know all about what Paris Hilton is collecting at this point using covalent API uh what else can you get right let's say you are curious about what other token holders of an nft collection there are you can use this endpoint you just include like uh token contract address into here and it'll give you a list of all the token holders I wouldn't really go that deep into the demo um and yeah you should be able to play around with the rest of the data that we have here and depending on your needs you'll probably be able to find something so the main approach that we have is that we give you granular aggregated data that using a library such as Json RPC libraries like web3.js or ethos.js simply don't really provide um yeah for this we have class B endpoints that allows you to get Dex information for instance what are all the uh liquidity pools on unit swap or sushi swap cool and since those Protocols are on multiple different blockchains like I know you to swap is on a few and Sushi swap is on something like six or seven blockchains I could also switch the chain ID and then I could see the pools on those different chains as well right exactly yeah so um let's say you want to find out uh about some of the decks pools on polygon you switch it to chain idf137 yeah and you'll be able to find out information about these two taxes nice so um we don't have uh uni soap index for polygon unfortunately but you can't you know I think that because tax is quick swap I think it is yeah on polygon and then on Phantom we have V supported on Avalanche we have sushi sword supported everything yeah yeah yeah they are the big conqueror of the decks space so if I want more kind of like documentation or if I want to see frequently asked questions or anything like that where else should I go I'm glad you are you're so welcome you go to our knowledge base which is coolhq.com the aux and this is a knowledge base and go under developer you get uh our FAQs on frequently asked questions on how to interact with IPI and I strongly advise for you to probably like check this out if you have any queries it's probably like answered here someone's probably asked this yeah someone probably asked it before and also um if you go over to the overview it will give you more details of how we can get started interacting with the API for instance what's the latency um how many requests can you make per second under the uh the free plan that we have um and also like a project showcase you want to get inspired about what products you want to build cool yeah uh one last thing before I move on to the juicy bounties that we will be providing for you for this hackathon is that we've built up this component library on uh GitHub so go to this page and you'll be able to like uh please start it and give us some love and then you will be able to subscribe to any new components that will build in the future right right now we've got a component library in react for you to quickly you know Plug and Play into your application something like if you want to build a wallet you need this page which shows you like all your wallet balances right so if I'm building something for this hackathon for instance can I use some of these things and also submit a project of course you can although like um you still have to have like a good use case for your overall project for us to like maybe rank you higher it's not exactly copy based yeah I mean like if if you just like regurgitate our works and call it your projects like you know will be a bit susque but you could add these into any different use case even if you're submitting for a different Bounty it's something that could probably push you across the edge exactly project a little bit better that's great idea nidani thanks yeah um and then we've also got um this erc20 transverse component which gives you all the transfers uh particular addresses made right you can put it into your project and check it out and also the token holders component for now all of these are in react you can either just like um download the react components here or you can install it via npm and you can just import it into your project and to see how it looks like nice so give it a star we're constantly adding new components we also have certain templates like decks templates or Price tracker templates that you can like check out and use in a project as well yeah finally for this hackathon we have a total price pool of five thousand dollars so yay drum roll I should have done that before we should have prepared the drama I know I tried all right um anyone who uses our API in a meaningful manner uh we'll stand a chance to be part of this prize pool so prices will be awarded according to the quality of your use case right it has to be uh you know novel and also you're solving a discrete problem right and whether there's a working demo your technical integration of it is quite important and also maybe the number of API endpoints used that will kind of be the metrics of which we are judging the projects so as long as you use our API and you've got a good idea if you've implemented it well you qualify for this price pool you understand to take home some juicy Bounty some of the other things that I think I've noticed that set people apart too are like good design um interesting yeah like branding or just there's a lot around it that can make you stand out just aside from the judging criteria yeah exactly so we look out for things like UI smoothness of the app and a lot of the bounties that were on top categories before were projects that really looked very Sleek or they've used our data in a visualization library in a way that we haven't seen it before nice yep that is about all we've gone through the developer resources and yeah we've reached the end of our Workshop here so good luck and happy hacking thanks for joining us thanks for joining us take care
Automatic transcript — names and jargon may be misspelled.