Repository navigation
Releases: tigusigalpa/nansen-go
Releases · tigusigalpa/nansen-go
Release list
v1.2.0
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
ExactNumericRangeFilterExactNumberFromLexeme
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 unsupportednullbounds. - 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
v1.1.0
New Features
- Added typed Profiler Address Labels support:
POST /api/v1/profiler/address/labelsPOST /api/v1/profiler/address/premium-labels
- Added endpoint-specific
ProfilerLabelsChainvalidation 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
ExactNumberfor lossless provider numeric values. - Historical holdings now preserve numeric JSON lexemes without
float64conversion. - 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
ExactNumberusage. - 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
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-Afterparsing. - Added tests for client options and pointer helper functions.
Validation
go test ./...passes successfully.
v1.0.3
v1.0.3
Fixes
- Fixed CI lint failure by handling errors returned from
io.Copywhen response bodies are discarded. - Fixed the coverage workflow referencing non-existent
./priceand./transportpackages. - 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
gofmtformatting across the updated Go source files.
v1.0.2
v1.0.2
Improvements
- Added GitHub Actions CI for pushes and pull requests.
- CI checks formatting with
gofmt, runsgo vet, and executes tests with the race detector. - Checks run on Go 1.22 and the latest stable Go version.
Fixes
WithBaseURLnow 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.
Newsafely handlesniloptions and returns an error instead of panicking.
Tests
- Added tests for base URL validation and normalization.
- Added a test for
niloption handling.
v1.0.0
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.Contextfor clean timeouts and cancellation. - Concurrency-safe client — create once, share across as many goroutines as you like.
- Functional options — configure with
WithBaseURL,WithHTTPClient,WithTimeout, andWithRetry. - 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, andX-RateLimit-Reset, and surfacesRateLimit-Remaining/X-RateLimit-Remainingon returned errors. - Shared timeout budget — a single timeout spans all retry attempts, so you always stay within the bound you set.
Error handling
- Custom
APIErrorexposingStatusCode,Message,RawBody,Headers,RetryAfter, andRateLimitRemaining. - Sentinel errors (
ErrNotFound,ErrUnauthorized,ErrRateLimited, and more) compatible witherrors.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