Add relayinfo package and utility modules for NIP-11 support

Introduce the `relayinfo` package with `NIP-11` utilities, including `Fees`, `Limits`, and `NIPs` structures. Add utility modules for handling numbers, timestamps, and kinds. Integrate functionality for fetching and managing relay information.
This commit is contained in:
2025-08-21 15:22:17 +01:00
parent ecaf52b98f
commit 8add32bb78
16 changed files with 1541 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
package relayinfo
import "testing"
func TestAddSupportedNIP(t *testing.T) {
info := NewInfo(nil)
info.AddNIPs(12, 12, 13, 1, 12, 44, 2, 13, 2, 13, 0, 17, 19, 1, 18)
for i, v := range []int{0, 1, 2, 12, 13, 17, 18, 19, 44} {
if !info.HasNIP(v) {
t.Errorf("expected info.nips[%d] to equal %v, got %v",
i, v, info.Nips)
return
}
}
}