GithubHelp home page GithubHelp logo

instruction-parser's Introduction

Parser for Jupiter V6 Contract

A library you can use to parse the Jupiter v6 swap instruction. It is also the same library that we use to parse the swap information on the https://station.jup.ag/stats page.

After cloning the repo, in the project directory run yarn install. Then:

yarn start lookup-tx --signature <TRANSACTION_SIGNATURE> --rpc <RPC_URL>

For an example on how to use the library, you can check out: src/cli.ts.

NPM

If you are using this via NPM, make sure that you are using the right version for the right contract:

  • JUP4Fb2cqiRUcaTHdrPC8h2gNsA2ETXiPDD33WcGuJB: 1.0.5
  • JUP5pEAZeHdHrLxh5UCwAbpjGwYKKoquCpda2hfP4u8: 5.0.1
  • JUP5cHjnnCx2DppVsufsLrXs8EBZeEZzGtEK9Gdz6ow: 5.2.0
  • JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4: 6.0.7

If you will need all of them in order to parse different contract, you can include them in your package.json as this:

{
  "dependencies": {
    "@jup-ag/instruction-parser-v4": "npm:@jup-ag/[email protected]",
    "@jup-ag/instruction-parser-v5": "npm:@jup-ag/[email protected]",
    "@jup-ag/instruction-parser-v5-1": "npm:@jup-ag/[email protected]",
    "@jup-ag/instruction-parser-v6": "npm:@jup-ag/[email protected]"
  }
}

Note

We are using Anchor events for extracting swap details. One downside about this approach is that we cannot longer extract swap details if the log is being truncated.

Jupiter V4 Contract

For the old V4 contract, check out v4 tag.

Jupiter V3 Contract

For the old V3 contract, check out v3 tag.

instruction-parser's People

Contributors

siong1987 avatar arrowana 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.