Giter Club home page Giter Club logo

swap-demo-tutorial's Introduction

Note ๐Ÿ“ฃ All API requests require a 0x API key. Legacy code examples may contain requests without API keys. Follow this guide for how to get a live API key and use it for any 0x products.

How to Build a Simple Token Swap DApp using the 0x Swap API

Learn how to build a token swapping dapp, similar to a simple Matcha.xyz, using the 0x /swap API endpoint.

This app aggregates liquidity across the greater DEX ecosystem using 0x to surfaces the best price to the user and allow them to easily settle their trades!

Follow Along to Learn

  • ๐Ÿ’ฆ What is liquidity aggregation?
  • ๐ŸชŸ Query + Display an ERC20 token list
  • โ™ป๏ธ Use @0xProject API's /swap endpoint
  • ๐Ÿงฑ Build a Swap Dapp with Metamask and Web3.js

Video and Written Tutorial

  • ๐ŸŽฅ Watch Video Walk-Through: https://www.youtube.com/watch?v=tVvZ1ivp4X0
  • ๐Ÿ“– Full Written Tutorial: https://0x.org/docs/0x-swap-api/guides/how-to-build-a-token-swap-dapp-with-0x-api
  • The repo is broken up by parts which correspond to parts in the written tutorial above โ˜๏ธ Each part builds upon the previous one.
  • Part 1. Walk-through Starter Code
  • Part 2. Connect to MetaMask
  • Part 3. Create a Modal for the Token List
  • Part 4. Fetch and Display Token List from CoinGecko API
  • Part 5. Display Selected Token Image and Symbol in Swap Box
  • Part 6. Get Price
  • Part 7. Get Quote
  • Part 8. Set a Token Allowance
  • Part 9. Perform the Swap

Further Examples

To find more demo apps, check out the official 0x examples repo.

Try out -

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.