Skip to content

SkyCryptWebsite/SkyHelper-Networth-Go

Repository files navigation

SkyHelper-Networth-Go

discord license Go Reference

Note

This repository is specifically designed for integration with SkyCryptv3. While this Go implementation focuses on core networth calculation functionality (including standard and non-cosmetic calculations), it does not include all features available in the Node.js module, such as UpdateManager and NetworthManager components.

SkyHelper's Networth Calculation as a Go module to calculate a player's SkyBlock networth by using their profile data provided by the Hypixel API.

Installation

go get github.com/SkyCryptWebsite/SkyHelper-Networth-Go

Quick Start

package main

import (
    "fmt"
    "github.com/SkyCryptWebsite/SkyHelper-Networth-Go"
)

func main() {
    userProfile := // https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1profile/get - profile.Members[uuid]
    museumData := // https://api.hypixel.net/v2/skyblock/museum - museum.Members[uuid]

	calculator, err := skyhelpernetworthgo.NewProfileNetworthCalculator(userProfile, museumData, profile.Banking.Balance)
	if err != nil {
		return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
			"error": fmt.Sprintf("Failed to create networth calculator: %v", err),
		})
	}

    networth := calculator.GetNetworth()
    nonCosmeticNetworth := calculator.GetNonCosmeticNetworth()

    fmt.Printf("Networth: %+v\n", networth)
    fmt.Printf("Non-Cosmetic Networth: %+v\n", networth)
}

Testing

Run the comprehensive test suite:

go test ./tests

# Run specific item tests
go test ./tests/ -run TestEnchantedBook
go test ./tests/ -run TestPets
go test ./tests/ -run TestGemstones

# Run with verbose output
go test -v ./tests/...

Benchmarking

Performance benchmarks are available to measure calculation speed:

# Run benchmarks
go test -bench=. ./benchmark/...

# Run specific benchmarks
go test -bench=BenchmarkNetworth ./benchmark/...

# Run benchmarks with memory profiling
go test -bench=. -benchmem ./benchmark/...

License

This project is licensed under the terms specified in LICENSE.MD.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages