0.2.8 • Published 4 months ago

solar-sdk v0.2.8

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
4 months ago

SOLAR SDK

An SDK for building applications on top of Solar .

Usage Guide

Installation

$ yarn add solar-sdk

Trade API

Solar trade API is the fastest and easiest way to interact with solar liquidity. It allows you to swap for any asset with 2 requests and a signature.

Get quote parameters

ParameterTypeRequiredDescription
inputMintstringyesInput token mint address
outputMintstringyesOutput token mint address
amountnumberyesEither inputAmount or outputAmount depending on the swap mode.
slippageBpsnumberyesSlippage tolerance in base points (0.01%).

Post parameters

ParameterTypeRequiredDescription
versionstringyesUse 'V0' for versioned transaction, and 'LEGACY' for legacy transaction (for now only supports 'LEGACY').
wrapSolbooleannoSet to true to accept ETH as inputToken.
unwrapSolbooleannoSet to true to unwrap wETH received as outputToken.
computeUnitPriceMicroLamportsstringyesYou can manually set this or use Solar priority fee API to set an automatic amount with String(data.data.default.h). The 'h' stands for high priority. 'vh' for very high and 'm' for medium are also accepted values.
walletstringyesPublic key of the wallet.
inputTokenAccountstringnoDefaults to ATA (Associated Token Account).
outputTokenAccountstringnoDefaults to ATA (Associated Token Account).

Get quote (https://api.solarstudios.co/compute/$) & and define the swap type.

Serialize (https://api.solarstudios.co/transaction/$)

Our apis schema and working is same as raydium's api. For now our api only supports LEGACY tx.

Raydium Trade api guide - https://docs.raydium.io/raydium/traders/trade-api

Demo Implimentations - https://github.com/raydium-io/raydium-sdk-V2-demo/blob/master/src/api/swap.ts#L21

BASE API URL - https://api.solarstudios.co

API Endpoints

Main

Main API endpoints for general information and configuration.

MethodEndpointDescription
GET/main/versionUI V3 current version
GET/main/rpcsUI RPCs
GET/main/chain-timeChain Time
GET/main/infoTotal Value Locked (TVL) and 24-hour volume
GET/main/auto-feeTransaction auto fee
GET/main/clmm-configCLMM Config
GET/main/cpmm-configCPMM Config

Mint

Endpoints related to mint information.

MethodEndpointDescription
GET/mint/listDefault Mint List
GET/mint/idsMint Info
GET/mint/priceMint Price

Pools

Endpoints for pool information, keys, and historical data.

MethodEndpointDescription
GET/pools/info/idsPool Info
GET/pools/info/lpsPool Info by LP Mint
GET/pools/info/listPool Info List
GET/pools/info/mintPool Info by Token Mint
GET/pools/key/idsPool Key

For query parameters refer - https://api-v3.raydium.io/docs/#/

0.2.8

4 months ago

0.2.7

4 months ago

0.2.6

6 months ago

0.2.5

6 months ago

0.2.4

6 months ago

0.2.3

7 months ago

0.2.2

7 months ago

0.2.1

7 months ago

0.2.0

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago