go-alchemy-sdk
is a Go client library for interacting with the Alchemy API to access blockchain data and services. This library aims to provide a simple and efficient interface for developers building on top of Solana and other blockchains supported by Alchemy.
- Solana Support: Access Solana blockchain data with ease.
- Customizable: Configure client options, including API keys and rate limits.
- Well-Documented: Comprehensive documentation and examples.
- Efficient: Optimized for performance and minimal overhead.
go get -u github.com/teyz/go-alchemy-sdk
Here’s an example to get started with the go-alchemy-sdk
:
package main
import (
"fmt"
"log"
alchemy "github.com/teyz/go-alchemy-sdk"
)
func main() {
// Create a new client with your Alchemy API key
client, err := alchemy.NewClient("your-alchemy-api-key")
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Example: Get the balance
balance, err := client.GetBalance("your-solana-address")
if err != nil {
log.Fatalf("Failed to get balance: %v", err)
}
fmt.Printf("Balance: %v\n", balance)
}
Full API documentation is available at pkg.go.dev.
GetBlock
: Retrieves block.GetTransaction
: Fetches transaction details by hash.GetBalance
: Gets the balance of an Solana address.- And more!
Contributions are welcome! Feel free to open issues or submit pull requests for any improvements or additional features.
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to Alchemy for providing an excellent API for blockchain developers.
- Inspired by libraries like solana-go.
Made with ❤️ by Bastien "Teyz" Rigaud.