Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jup-ag/api

Package Overview
Dependencies
Maintainers
0
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jup-ag/api

## Generate typescript types from swagger schema

  • 6.0.31
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

JavaScript API Client for Jupiter V6

Table of Contents

  • Installation
  • Usage
  • Examples

Installation

To use the Jupiter API client, you need to have Node.js and npm (Node Package Manager) installed. Then, you can install the package using npm:

npm install @jup-ag/api

Developing

  • pnpm dev-quote
    • just get a quote, without needing wallet
  • pnpm dev-swap
    • get a quote, perform swap
    • please setup process.env.PRIVATE_KEY

Usage

To start using the API client, you need to require it in your Node.js project:

import { createJupiterApiClient } from '@jup-ag/api';

const jupiterQuoteApi = createJupiterApiClient(config); // config is optional

Now, you can call methods provided by the API client to interact with Jupiter's API. For example:

jupiterQuoteApi.quoteGet({
    inputMint: "So11111111111111111111111111111111111111112",
    outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    amount: "100000000",
    // platformFeeBps: 10,
    // asLegacyTransaction: true, // legacy transaction, default is versoined transaction
})

Examples

Checkout the example in the repo. link

Using Custom URLs

You can set custom URLs via the configuration for any self-hosted Jupiter APIs, like the V6 Swap API or the paid hosted APIs

import { createJupiterApiClient } from '@jup-ag/api';

const config = {
    basePath: 'https://hosted.api'
};
const jupiterQuoteApi = createJupiterApiClient(config);

Paid Hosted APIs

You can also check out some of the paid hosted APIs.

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc