Code Monkey home page Code Monkey logo

rust-jup-ag's Introduction

jup-ag

Jupiter Aggregator API bindings for Rust.

Basic usage examples can be found in the examples directory.

Usage

Examples

To run the examples:

$ cargo run --example <EXAMPLE_NAME>

Using Self-hosted APIs

You can set custom API endpoints via environment variables to use any self-hosted Jupiter APIs. Like the self-hosted V6 Swap API or paid hosted APIs. Here are the ENV vars:

QUOTE_API_URL=https://hosted.api
PRICE_API_URL=https://price.jup.ag/v1

rust-jup-ag's People

Contributors

alen-qn avatar arrowana avatar ebatsell avatar kiranmuddam avatar m1234d avatar mvines avatar palinko91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rust-jup-ag's Issues

Properly handle error responses

When the Jupiter API returns an error, it appears to take this form: {error: "message"}.

Currently "message" is eaten and the Error that bubbles up to the caller is an unhelpful Error: Reqwest(reqwest::Error { kind: Decode, source: Error("expected value", line: 1, column: 1) })"

Instead it'd be nice to see an error that looks more like Error: message

Example RpcError

Getting an error when running swap.rs in examples:

Error: Error { request: Some(GetTokenAccountBalance), kind: RpcError(RpcResponseError { code: -32602, message: "Invalid param: could not find account", data: Empty }) }
error: process didn't exit successfully: target\debug\examples\swap.exe (exit code: 1)

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.