Skip to content

Releases: tigusigalpa/nansen-go

v1.2.0

Choose a tag to compare

@tigusigalpa tigusigalpa released this 05 Oct 20:38

v1.2.0

Exact Numeric Request Filters

Added an additive exact-number request API for sending decimal bounds to Nansen without float64 precision loss.

Method Exact filter type
Profiler.AddressCurrentBalanceExact ProfilerAddressBalancesExactFilters
SmartMoney.NetflowExact SmartMoneyNetflowExactFilters
SmartMoney.HoldingsExact SmartMoneyHoldingsExactFilters
SmartMoney.HistoricalHoldingsExact SmartMoneyHistoricalHoldingsExactFilters

New Types

  • ExactNumericRangeFilter
  • ExactNumberFromLexeme

Exact numeric bounds are serialized directly as JSON number lexemes. They are never converted through float64, parsed as floating-point values, or encoded as JSON strings.

Validation

  • Preserves omitted bounds separately from explicit zero.
  • Rejects malformed numeric input before any HTTP request.
  • Rejects strings, arrays, objects, booleans, multiple JSON values, NaN, Infinity, and unsupported null bounds.
  • Preserves existing endpoint routes, request fields, authentication, retries, and response decoding.
  • Validates the documented date format and supported chain set for exact historical holdings requests.

Tests and Documentation

  • Added offline transport tests for all supported exact request methods.
  • Tests verify large integers and high-precision decimals are transmitted unchanged.
  • Added validation tests confirming malformed bounds result in zero HTTP attempts.
  • Updated README with exact request API coverage and usage examples.

Compatibility

This release is fully backward compatible. Existing request types, methods, and NumericRangeFilter behavior remain unchanged.

v1.1.0

Choose a tag to compare

@tigusigalpa tigusigalpa released this 03 Oct 12:52

v1.1.0

New Features

  • Added typed Profiler Address Labels support:
    • POST /api/v1/profiler/address/labels
    • POST /api/v1/profiler/address/premium-labels
  • Added endpoint-specific ProfilerLabelsChain validation and required address validation.
  • Added typed Smart Money Historical Holdings support:
    • POST /api/v1/smart-money/historical-holdings
  • Added date-range validation and endpoint-specific chain validation for historical holdings.

Data Integrity

  • Added ExactNumber for lossless provider numeric values.
  • Historical holdings now preserve numeric JSON lexemes without float64 conversion.
  • Preserves the distinction between absent, null, and zero numeric values.
  • New labels and historical-holdings responses retain raw provider response bytes and unknown outer response fields.

Documentation and Examples

  • Updated README with Address Labels, Premium Labels, Historical Holdings, and ExactNumber usage.
  • Updated Profiler example with Address Labels usage.
  • Updated Smart Money example with Historical Holdings usage.

Testing

  • Added offline acceptance tests using httptest.
  • Tests verify endpoint paths, exact request bodies, raw response retention, unknown fields, and lossless decimal values.

Reliability

  • Response body close errors are now handled across all HTTP request paths.
  • Multiple read/decode and close failures are preserved using errors.Join.

v1.0.4

Choose a tag to compare

@tigusigalpa tigusigalpa released this 02 Sep 18:01

v1.0.4

Test Coverage

  • Increased test coverage from 56% to 83.7%.
  • Added coverage for all public Nansen API service methods:
    • Smart Money
    • Token God Mode
    • Profiler
    • Portfolio
    • Historical endpoints

Tests

  • Added tests for successful response-body discarding and invalid JSON responses.
  • Added coverage for exponential backoff behavior.
  • Added tests for API error formatting and Retry-After parsing.
  • Added tests for client options and pointer helper functions.

Validation

  • go test ./... passes successfully.

v1.0.3

Choose a tag to compare

@tigusigalpa tigusigalpa released this 02 Sep 17:47

v1.0.3

Fixes

  • Fixed CI lint failure by handling errors returned from io.Copy when response bodies are discarded.
  • Fixed the coverage workflow referencing non-existent ./price and ./transport packages.
  • Coverage tests now run against all project packages with ./....

Quality

  • Added complete GoDoc comments for exported API types, functions, options, errors, and constant groups.
  • golint ./... now completes without issues.
  • Applied gofmt formatting across the updated Go source files.

v1.0.2

Choose a tag to compare

@tigusigalpa tigusigalpa released this 16 Aug 07:53

v1.0.2

Improvements

  • Added GitHub Actions CI for pushes and pull requests.
  • CI checks formatting with gofmt, runs go vet, and executes tests with the race detector.
  • Checks run on Go 1.22 and the latest stable Go version.

Fixes

  • WithBaseURL now validates absolute HTTP(S) URLs.
  • Trailing slashes are removed from base URLs to prevent double slashes in API paths.
  • Base URLs containing query parameters or fragments are now rejected.
  • New safely handles nil options and returns an error instead of panicking.

Tests

  • Added tests for base URL validation and normalization.
  • Added a test for nil option handling.

v1.0.0

Choose a tag to compare

@tigusigalpa tigusigalpa released this 14 Jul 18:56

nansen-go v1.0.0

First stable release of nansen-go — a lightweight, dependency-free Go client for the Nansen AI API.

Highlights

  • Zero third-party dependencies — built entirely on the Go standard library.
  • Context-aware API — every method takes a context.Context for clean timeouts and cancellation.
  • Concurrency-safe client — create once, share across as many goroutines as you like.
  • Functional options — configure with WithBaseURL, WithHTTPClient, WithTimeout, and WithRetry.
  • Strong typing — chains, sort fields, trader types, and labels as constants; optional request fields use pointers so zero-values are never sent by accident.

Endpoints

  • Smart Money — Netflows, Holdings, DEX Trades.
  • Token God Mode & Screener — Token Screener, Flow Intelligence, Who Bought/Sold.
  • Profiler — Address Current Balances, Address DEX Trades.
  • Portfolio — DeFi Holdings.
  • Historical Data (Backtesting) — token flow summaries and point-in-time smart-money balances under /api/v1beta1/.

Reliability

  • Automatic retries with exponential backoff — opt in via WithRetry; retries HTTP 429, transient 5xx responses, and recoverable network errors.
  • Rate-limit aware — honors Retry-After, RateLimit-Reset, and X-RateLimit-Reset, and surfaces RateLimit-Remaining / X-RateLimit-Remaining on returned errors.
  • Shared timeout budget — a single timeout spans all retry attempts, so you always stay within the bound you set.

Error handling

  • Custom APIError exposing StatusCode, Message, RawBody, Headers, RetryAfter, and RateLimitRemaining.
  • Sentinel errors (ErrNotFound, ErrUnauthorized, ErrRateLimited, and more) compatible with errors.Is.

Developer experience

  • Pointer helpers: StringPtr, IntPtr, BoolPtr, Float64Ptr.
  • Ready-to-run examples for the Screener, Profiler, and Smart Money endpoints.
  • Unit tests covering retry/backoff behavior, error mapping, and option validation.
  • Full documentation and MIT license.

Installation

go get github.com/tigusigalpa/nansen-go@v1.0.0