Releases: tigusigalpa/nansen-php
Releases · tigusigalpa/nansen-php
Release list
v1.1.0
v1.1.0
Added
- GitHub Actions workflows for CI, PHP 8.1–8.4 test matrix, coverage reporting, Codecov uploads, and CodeQL workflow-security analysis.
- Dependabot configuration for Composer dependencies and GitHub Actions.
RequestBuilder::with()andRequestBuilder::withAll()for endpoint-level request fields.perPage()pagination helper and v1 pagination metadata:page,perPage, andisLastPage.- Historical helpers:
historicalData()->tokenFlowSummary()historicalData()->smartMoneyTokenBalances()
search()->entityName()for the documented entity-name search endpoint.- Configurable
max_retry_delay. - Portfolio response accessors:
summaryandprotocols.
Changed
- Updated Profiler, Portfolio, Search, and Historical endpoint contracts to match Nansen API v1.
- Profiler address and chain values are now sent as top-level request fields.
- Portfolio requests now use the required
wallet_addressfield. orderBy()now serializes the API-required array of sort orders.limit()is retained as a compatibility alias forpagination.per_page; preferpage()andperPage()in new code.- Laravel now uses a container-bound PSR-18 HTTP client when no explicit Nansen client class is configured.
- Updated README and examples with current request fields, pagination, sorting, and response structures.
Fixed
- Recreated request bodies for every retry attempt.
- Added retries for transient transport failures and 5xx responses.
- Added support for
RateLimit-ResetandX-RateLimit-Resetheaders. - Added bounded exponential retry backoff.
- Improved API error-message extraction, including
detailresponses. - Added a consistent SDK
User-Agentheader for default and custom PSR-18 clients. - Corrected the address-labels endpoint to
/api/v1/profiler/address/labels.
Compatibility Notes
- Use
search()->entityName($query)instead of legacygeneral()orentity()search methods. - Portfolio responses now expose their native structure through
$response->summaryand$response->protocols. The legacy$response->itemsalias remains available. - Existing calls using
limit()continue to work, but now sendpagination.per_pageas required by Nansen API v1.
Quality
- 28 PHPUnit tests with 90 assertions.
- Added request-contract coverage for Profiler, Portfolio, Search, and Historical endpoints.
v1.0.0
v1.0.0 — Initial Release
A framework-agnostic PHP client for the Nansen AI API, with first-class Laravel 10–13 support.
Features
- Fluent, chainable query builder —
->smartMoney()->netflows()->chains(['ethereum'])->limit(10)->get() - Endpoint coverage:
smartMoney():netflows(),holdings(),dexTrades()tokenGodMode():tokenScreener(),flowIntelligence(),whoBoughtSold()profiler():addressBalance(),addressDexTrades(),addressLabels()portfolio():defiHoldings()search():general(),entity()historicalData()— v1beta1 backtesting endpoints
- Shared query modifiers across every endpoint:
chains(),filters(),orderBy(),limit(),offset(),pagination()(repeatedfilters()calls merge instead of overwriting) - Typed DTO responses with real
RecordCollectionlists (countable, iterable, indexable) instead of loose arrays — every DTO also exposes the untouched payload via->rawfor forward compatibility - Automatic rate-limit handling —
429responses trigger backoff/retry honoringRetry-After - Clear exception hierarchy —
ApiException,RateLimitException(withretryAfter()/remaining()),UnauthorizedException,NotFoundException - Bring your own HTTP client — Guzzle by default, or bind any PSR-18 implementation
- Laravel integration — auto-discovered
NansenServiceProvider, publishableconfig/nansen.php, and aNansenfacade - Fully tested — PHPUnit suite runs against a mocked HTTP client, no API key or network access required
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12 (optional)
Installation
composer require tigusigalpa/nansen-php