exchange

package
v0.0.0-...-4d23701 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exchange

type Exchange interface {
	SwapSolForToken(amountSol float64, token string, slippage float64, priorityFee float64) (any, error)

	SwapTokenForSol(amountToken float64, token string, slippageToken float64, priorityFee float64) (any, error)
}

type PumpFun

type PumpFun struct {
	// contains filtered or unexported fields
}

func NewPumpFun

func NewPumpFun(apiKey string, client *http.Client, rpcClient *rpc.Client) *PumpFun

func (*PumpFun) ParseTransaction

func (p *PumpFun) ParseTransaction(sr *SwapResponse) (float64, error)

func (*PumpFun) SwapRequest

func (p *PumpFun) SwapRequest(request SwapRequest) (*SwapResponse, error)

func (*PumpFun) SwapSolForToken

func (p *PumpFun) SwapSolForToken(amountSol float64, token string, slippage float64, priorityFee float64) (*SwapResponse, error)

func (*PumpFun) SwapTokenForSol

func (p *PumpFun) SwapTokenForSol(amountToken float64, token string, slippage float64, priorityFee float64) (*SwapResponse, error)

type SwapRequest

type SwapRequest struct {
	Action           string  `json:"action"`
	Mint             string  `json:"mint"`
	Amount           float64 `json:"amount"`
	DenominatedInSol bool    `json:"denominatedInSol,string"`
	Slippage         float64 `json:"slippage"`
	PriorityFee      float64 `json:"priorityFee"`
	Pool             string  `json:"pool"`
}

type SwapResponse

type SwapResponse struct {
	Signature string `json:"signature"`
	Errors    []any  `json:"errors"`
	Request   SwapRequest
	Filled    float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL