solana-tracker-golang

command module
v0.0.0-...-f30fa59 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

README

solana-tracker-golang

This is a golang api for the solana tracker API.

Which is hosted here https://docs.solanatracker.io/swap-api/swap and I'm not affiliated with them or their services.

Usage Example

The easiest way is to look at the main.go method, which provides the following example


package main

import (
	"github.com/codingsandmore/solana-tracker-golang/tracker"
	"log"
	"net/http"
)

func main() {

	//get a new tracker
	swap := tracker.NewSolanaTracker(&http.Client{})

	//get a quote

	rate, err := swap.GetRate("So11111111111111111111111111111111111111112", "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R", 10, 15)

	//get the swap transaction
	tx, err := swap.GetSwapTransaction("So11111111111111111111111111111111111111112", "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R", 10, 15, "44ByXN2NgCeHJdsmbUvKrjcdRQJLJDuY8DqnqWMcwy5U",0.015)

	if err != nil {
		log.Fatal(err)
	}

	//do something with these information now
	log.Println(rate)
	log.Println(tx)
}
Getting the lib into your project
go get github.com/codingsandmore/solana-tracker-golang
Need coffee!!!

we would love to receive your support and would appreciate it, if you send us some SOL for coffee, if you consider this useful :)

D79Tjjs6GpsUL2Pxd7PNsWuBaRJs5Qdt1XNorXRD5Azd
Collaboration

Feel free to reach out to me, I'm always interested in some fun collaborations.

Disclaimer

all tools provided, are for learning purposes only, without any form or kind of warranty. Please use at your own risk.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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