Code Monkey home page Code Monkey logo

llama-swap's Introduction

jupiter-swap

An implementation of the Jupiter Swap - here's a video walkthrough of all this code: Integrate Jupiter Swap in 15 minutes

Jupiter Terminal vs API Jupiter Terminal is a UI that you can plug into your app by linking it in your HTML. The API is uses Jupiter's quote and swap endpoints and requires you build your own front-end/UI.

Usage

The code in this repo is a reference imeplementation, it's not built for direct usage.

  • Get an API key from Helius - https://www.helius.dev/
  • Add your key to the the HTML OR create-solana-dapp implementation
  • For create-solana-dapp, you'll need NPM. The swap implementation is at localhost:3000/swap

I recommend watching the video linked above to get an idea of the layout of the code and how the Jupiter swap API works.

HTML

Plain HTML file that imports the terminal via CDN.

Create-solana-dapp

Uses the create-solana-dapp template to create a new project, then imports the terminal via CDN.

Setup

Run these in your terminal:

git clone https://github.com/AlmostEfficient/jupiter-swap/
cd create-solana-dapp
cd web
npm i
npm run dev

Open localhost:3000 in your browser. The swap is at localhost:3000/swap

API Implementation

The API implementation is at create-solana-dapp/web/app/swap/page.tsx. It's configured to only have 4 assets - USDC, SOL, BONK, WIF. You'll need to add your own token mint addresses, or you can use the token list API for validated tokens.

llama-swap's People

Contributors

almostefficient avatar

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.