Documentation
¶
Index ¶
- Constants
- Variables
- type Audit
- type ErrorResponse
- type FirstPool
- type JupiterClient
- func (client *JupiterClient) Quote(ctx context.Context, inputToken, outputToken string, amount *big.Int, ...) (*QuoteResponse, error)
- func (client *JupiterClient) SendSwapTransaction(ctx context.Context, svcCtx *svc.ServiceContext, wallet *solana.Wallet, ...) (string, error)
- func (client *JupiterClient) Swap(ctx context.Context, userWalletAddress string, quote *QuoteResponse, ...) (*SwapResponse, error)
- func (client *JupiterClient) TokenStats(ctx context.Context, tokenAddress string) (*TokenInfo, error)
- type PlatformFee
- type PrioritizationFeeLamports
- type PriorityLevel
- type PriorityLevelWithMaxLamports
- type QuoteResponse
- type RoutePlan
- type SimulationError
- type Stats
- type SwapInfo
- type SwapRequest
- type SwapResponse
- type TokenInfo
Constants ¶
View Source
const (
WrappedSOL = "So11111111111111111111111111111111111111112"
)
Variables ¶
View Source
var ( PriorityLevelNone = PriorityLevel("") PriorityLevelMedium = PriorityLevel("medium") // 25% PriorityLevelHigh = PriorityLevel("high") // 50% PriorityLevelVeryHigh = PriorityLevel("veryHigh") // 75% )
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type JupiterClient ¶
type JupiterClient struct {
// contains filtered or unexported fields
}
func NewJupiterClient ¶
func NewJupiterClient(apiUrl, apiKey string, transportProxy *http.Transport) *JupiterClient
func (*JupiterClient) Quote ¶
func (client *JupiterClient) Quote(ctx context.Context, inputToken, outputToken string, amount *big.Int, slippageBps int) (*QuoteResponse, error)
func (*JupiterClient) SendSwapTransaction ¶
func (client *JupiterClient) SendSwapTransaction(ctx context.Context, svcCtx *svc.ServiceContext, wallet *solana.Wallet, swapResponse *SwapResponse, maxRetries uint) (string, error)
func (*JupiterClient) Swap ¶
func (client *JupiterClient) Swap(ctx context.Context, userWalletAddress string, quote *QuoteResponse, priorityLevel PriorityLevel, maxLamports int64) (*SwapResponse, error)
func (*JupiterClient) TokenStats ¶
type PlatformFee ¶
type PrioritizationFeeLamports ¶
type PrioritizationFeeLamports struct {
JitoTipLamports int64 `json:"jitoTipLamports,omitempty"`
PriorityLevelWithMaxLamports *PriorityLevelWithMaxLamports `json:"priorityLevelWithMaxLamports,omitempty"`
}
type PriorityLevel ¶
type PriorityLevel string
type PriorityLevelWithMaxLamports ¶
type PriorityLevelWithMaxLamports struct {
PriorityLevel PriorityLevel `json:"priorityLevel"`
MaxLamports int64 `json:"maxLamports"`
}
type QuoteResponse ¶
type QuoteResponse struct {
InputMint string `json:"inputMint"`
InAmount decimal.Decimal `json:"inAmount"`
OutputMint string `json:"outputMint"`
OutAmount decimal.Decimal `json:"outAmount"`
OtherAmountThreshold decimal.Decimal `json:"otherAmountThreshold"`
SwapMode string `json:"swapMode"`
SlippageBps int `json:"slippageBps"`
PlatformFee *PlatformFee `json:"platformFee"`
PriceImpactPct decimal.Decimal `json:"priceImpactPct"`
RoutePlan []RoutePlan `json:"routePlan"`
}
type SimulationError ¶
type Stats ¶
type Stats struct {
PriceChange decimal.Decimal `json:"priceChange"`
LiquidityChange decimal.Decimal `json:"liquidityChange"`
VolumeChange decimal.Decimal `json:"volumeChange"`
BuyVolume decimal.Decimal `json:"buyVolume"`
SellVolume decimal.Decimal `json:"sellVolume"`
BuyOrganicVolume decimal.Decimal `json:"buyOrganicVolume"`
SellOrganicVolume decimal.Decimal `json:"sellOrganicVolume"`
NumBuys int `json:"numBuys"`
NumSells int `json:"numSells"`
NumTraders int `json:"numTraders"`
NumOrganicBuyers int `json:"numOrganicBuyers"`
NumNetBuyers int `json:"numNetBuyers"`
}
type SwapInfo ¶
type SwapInfo struct {
AmmKey string `json:"ammKey"`
Label string `json:"label"`
InputMint string `json:"inputMint"`
OutputMint string `json:"outputMint"`
InAmount decimal.Decimal `json:"inAmount"`
OutAmount decimal.Decimal `json:"outAmount"`
FeeAmount decimal.Decimal `json:"feeAmount"`
FeeMint string `json:"feeMint"`
}
type SwapRequest ¶
type SwapRequest struct {
UserPublicKey string `json:"userPublicKey"`
QuoteResponse QuoteResponse `json:"quoteResponse"`
PrioritizationFeeLamports PrioritizationFeeLamports `json:"prioritizationFeeLamports"`
DynamicComputeUnitLimit bool `json:"dynamicComputeUnitLimit"`
}
type SwapResponse ¶
type SwapResponse struct {
SwapTransaction string `json:"swapTransaction"`
LastValidBlockHeight int64 `json:"lastValidBlockHeight"`
PrioritizationFeeLamports int64 `json:"prioritizationFeeLamports"`
SimulationError *SimulationError `json:"simulationError"`
}
type TokenInfo ¶
type TokenInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Icon string `json:"icon"`
Decimals int `json:"decimals"`
CircSupply decimal.Decimal `json:"circSupply"`
TotalSupply decimal.Decimal `json:"totalSupply"`
TokenProgram string `json:"tokenProgram"`
FirstPool FirstPool `json:"firstPool"`
HolderCount int `json:"holderCount"`
Audit Audit `json:"audit"`
OrganicScore decimal.Decimal `json:"organicScore"`
OrganicScoreLabel string `json:"organicScoreLabel"`
IsVerified bool `json:"isVerified"`
Cexes []string `json:"cexes"`
Tags []string `json:"tags"`
FDV decimal.Decimal `json:"fdv"`
MCap decimal.Decimal `json:"mcap"`
UsdPrice decimal.Decimal `json:"usdPrice"`
PriceBlockId int64 `json:"priceBlockId"`
Liquidity decimal.Decimal `json:"liquidity"`
Stats5m Stats `json:"stats5m"`
Stats1h Stats `json:"stats1h"`
Stats6h Stats `json:"stats6h"`
Stats24h Stats `json:"stats24h"`
CtLikes int `json:"ctLikes"`
SmartCtLikes int `json:"smartCtLikes"`
UpdatedAt time.Time `json:"updatedAt"`
}
Click to show internal directories.
Click to hide internal directories.