Skip to content

Releases: tigusigalpa/nansen-php

Release list

v1.1.0

Choose a tag to compare

@tigusigalpa tigusigalpa released this 10 Sep 19:12

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() and RequestBuilder::withAll() for endpoint-level request fields.
  • perPage() pagination helper and v1 pagination metadata: page, perPage, and isLastPage.
  • Historical helpers:
    • historicalData()->tokenFlowSummary()
    • historicalData()->smartMoneyTokenBalances()
  • search()->entityName() for the documented entity-name search endpoint.
  • Configurable max_retry_delay.
  • Portfolio response accessors: summary and protocols.

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_address field.
  • orderBy() now serializes the API-required array of sort orders.
  • limit() is retained as a compatibility alias for pagination.per_page; prefer page() and perPage() 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-Reset and X-RateLimit-Reset headers.
  • Added bounded exponential retry backoff.
  • Improved API error-message extraction, including detail responses.
  • Added a consistent SDK User-Agent header 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 legacy general() or entity() search methods.
  • Portfolio responses now expose their native structure through $response->summary and $response->protocols. The legacy $response->items alias remains available.
  • Existing calls using limit() continue to work, but now send pagination.per_page as 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

Choose a tag to compare

@tigusigalpa tigusigalpa released this 15 Jul 15:07

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() (repeated filters() calls merge instead of overwriting)
  • Typed DTO responses with real RecordCollection lists (countable, iterable, indexable) instead of loose arrays — every DTO also exposes the untouched payload via ->raw for forward compatibility
  • Automatic rate-limit handling429 responses trigger backoff/retry honoring Retry-After
  • Clear exception hierarchyApiException, RateLimitException (with retryAfter()/remaining()), UnauthorizedException, NotFoundException
  • Bring your own HTTP client — Guzzle by default, or bind any PSR-18 implementation
  • Laravel integration — auto-discovered NansenServiceProvider, publishable config/nansen.php, and a Nansen facade
  • 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