A comprehensive Go SDK for interacting with the Bitpin cryptocurrency exchange API. This SDK provides a simple and intuitive way to integrate Bitpin's trading functionality into your Go applications.
This is an unofficial SDK and is not affiliated with, endorsed by, or connected to Bitpin. Use at your own risk. The author(s) of this SDK are not responsible for any losses incurred through its use.
- Complete implementation of Bitpin's REST API
- Comprehensive market data access
- Order management (create, cancel, query)
- Wallet operations
- Authentication and token management
- Rate limiting and error handling
- Type-safe request/response structs
go get github.com/amiwrpremium/go-bitpinpackage main
import (
"fmt"
"github.com/amiwrpremium/go-bitpin"
)
func main() {
// Initialize client with options
opts := bitpin.ClientOptions{
ApiKey: "your-api-key",
SecretKey: "your-secret-key",
AutoRefresh: true,
}
client, err := bitpin.NewClient(opts)
if err != nil {
panic(err)
}
// Get market information
markets, err := client.GetMarkets()
if err != nil {
panic(err)
}
// Print available markets
for _, market := range *markets {
fmt.Printf("Market: %s, Base: %s, Quote: %s\n",
market.Symbol, market.Base, market.Quote)
}
}For detailed documentation and examples, please visit the Go Package Documentation.
For information about Bitpin's API, visit their official API documentation.
client, err := bitpin.NewClient(bitpin.ClientOptions{
ApiKey: "your-api-key",
SecretKey: "your-secret-key",
})params := types.GetWalletParams{
Assets: []string{"BTC", "USDT"},
Limit: 10,
}
wallets, err := client.GetWallets(params)
if err != nil {
panic(err)
}orderParams := types.CreateOrderParams{
Symbol: "BTC_USDT",
Type: "limit",
Side: "buy",
Price: "50000",
BaseAmount: "0.001",
}
order, err := client.CreateOrder(orderParams)
if err != nil {
panic(err)
}The SDK uses custom error types to provide detailed information about API errors:
if err != nil {
if apiErr, ok := err.(*bitpin.APIError); ok {
fmt.Printf("API Error: Status %d, Message: %s\n",
apiErr.StatusCode, apiErr.Message)
}
}The SDK can be configured with various options:
opts := bitpin.ClientOptions{
HttpClient: &http.Client{}, // Custom HTTP client
Timeout: 10 * time.Second,
BaseUrl: "https://api.bitpin.market", // Custom base URL
AutoAuth: true,
AutoAuth: true,
AutoRefresh: true,
}Comprehensive examples for all methods can be found in the EXAMPLES.md file.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please open an issue on GitHub.