Versions in this module Expand all Collapse all v1 v1.0.0 Jul 14, 2026 Changes in this version + var ErrBadRequest = errors.New("nansen: bad request") + var ErrForbidden = errors.New("nansen: forbidden") + var ErrInternal = errors.New("nansen: internal server error") + var ErrNotFound = errors.New("nansen: resource not found") + var ErrPaymentRequired = errors.New("nansen: payment required") + var ErrRateLimited = errors.New("nansen: rate limited") + var ErrUnauthorized = errors.New("nansen: unauthorized") + var ErrValidation = errors.New("nansen: validation error") + func BoolPtr(b bool) *bool + func Float64Ptr(f float64) *float64 + func IntPtr(i int) *int + func StringPtr(s string) *string + type APIError struct + Headers http.Header + Message string + RateLimitRemaining *int + RawBody []byte + RetryAfter *time.Duration + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type BuyOrSell string + const Buy + const Sell + type Chain string + const ChainAll + const ChainArbitrum + const ChainAvalanche + const ChainBNB + const ChainBase + const ChainBitcoin + const ChainCitrea + const ChainEthereum + const ChainHyperEVM + const ChainHyperliquid + const ChainInjective + const ChainIotaEVM + const ChainLinea + const ChainMantle + const ChainMantra + const ChainMonad + const ChainNear + const ChainOptimism + const ChainPlasma + const ChainPolygon + const ChainRonin + const ChainScroll + const ChainSei + const ChainSolana + const ChainSonic + const ChainStarknet + const ChainSui + const ChainTon + const ChainTron + type Client struct + Historical *HistoricalService + Portfolio *PortfolioService + Profiler *ProfilerService + SmartMoney *SmartMoneyService + TokenGodMode *TokenGodModeService + func New(apiKey string, opts ...Option) (*Client, error) + type DateRange struct + From string + To string + type HistoricalService struct + func (s *HistoricalService) HistoricalSmartMoneyTokenBalances(ctx context.Context, req *SmartMoneyHistoricalTokenBalancesRequest) (*SmartMoneyHistoricalTokenBalancesResponse, error) + func (s *HistoricalService) HistoricalTokenFlowSummary(ctx context.Context, req *TGMHistoricalTokenFlowSummaryRequest) (*TGMHistoricalTokenFlowSummaryResponse, error) + type HistoricalSmartMoneyFilterType string + const HistoricalLabel180DSmartDexTrader + const HistoricalLabel180DSmartTrader + const HistoricalLabel30DSmartDexTrader + const HistoricalLabel30DSmartTrader + const HistoricalLabel90DSmartDexTrader + const HistoricalLabel90DSmartTrader + const HistoricalLabelFund + const HistoricalLabelSmartDexTrader + const HistoricalLabelSmartHLPerpsTrader + const HistoricalLabelSmartTrader + type HoldingsSummary struct + ProtocolCount int + TokenCount int + TotalAssetsUSD float64 + TotalDebtsUSD float64 + TotalRewardsUSD float64 + TotalValueUSD float64 + type IntegerRangeFilter struct + Max *int + Min *int + type NumericRangeFilter struct + Max *float64 + Min *float64 + type Option func(*Client) error + func WithBaseURL(url string) Option + func WithHTTPClient(client *http.Client) Option + func WithRetry(maxAttempts int, initialDelay, maxDelay time.Duration) Option + func WithTimeout(timeout time.Duration) Option + type PaginationInfo struct + IsLastPage bool + Page int + PerPage int + type PaginationRequest struct + Page *int + PerPage *int + type PortfolioDefiHoldingsRequest struct + WalletAddress string + type PortfolioDefiHoldingsResponse struct + Protocols []ProtocolHolding + Summary HoldingsSummary + type PortfolioService struct + func (s *PortfolioService) DeFiHoldings(ctx context.Context, req *PortfolioDefiHoldingsRequest) (*PortfolioDefiHoldingsResponse, error) + type PositionType string + const PositionBorrow + const PositionDeposit + const PositionMixed + const PositionStake + type ProfilerAddressBalancesFilters struct + PriceUSD *NumericRangeFilter + TokenAddress interface{} + TokenAmount *IntegerRangeFilter + TokenName interface{} + TokenSymbol interface{} + ValueUSD *NumericRangeFilter + type ProfilerAddressBalancesRequest struct + Address string + Chain Chain + EntityName string + Filters *ProfilerAddressBalancesFilters + HideSpamToken *bool + OrderBy []SortOrder + Pagination *PaginationRequest + type ProfilerAddressBalancesResponse struct + Data []ProfilerBalance + Pagination PaginationInfo + type ProfilerAddressBalancesSortField string + const BalanceSortTokenSymbol + const BalanceSortValueUSD + type ProfilerBalance struct + Address string + Chain string + PriceUsd *float64 + TokenAddress string + TokenAmount *float64 + TokenName *string + TokenSymbol string + ValueUsd *float64 + type ProfilerDexTrade struct + BlockTimestamp string + Chain string + TokenBoughtAddress string + TokenBoughtAgeDays *int + TokenBoughtAmount *float64 + TokenBoughtFDV *float64 + TokenBoughtMarketCap *float64 + TokenBoughtSymbol *string + TokenSoldAddress string + TokenSoldAgeDays *int + TokenSoldAmount *float64 + TokenSoldFDV *float64 + TokenSoldMarketCap *float64 + TokenSoldSymbol *string + TradeValueUSD *float64 + TraderAddress string + TraderAddressLabel *string + TransactionHash string + type ProfilerDexTradeFilters struct + TokenBoughtAddress string + TokenBoughtAgeDays *IntegerRangeFilter + TokenBoughtAmount *NumericRangeFilter + TokenBoughtFDV *NumericRangeFilter + TokenBoughtMarketCap *NumericRangeFilter + TokenBoughtSymbol string + TokenSoldAddress string + TokenSoldAgeDays *IntegerRangeFilter + TokenSoldAmount *NumericRangeFilter + TokenSoldFDV *NumericRangeFilter + TokenSoldMarketCap *NumericRangeFilter + TokenSoldSymbol string + TradeValueUSD *NumericRangeFilter + type ProfilerDexTradeRequest struct + Address string + Chain Chain + Date DateRange + Filters *ProfilerDexTradeFilters + OrderBy []SortOrder + Pagination *PaginationRequest + type ProfilerDexTradeResponse struct + Data []ProfilerDexTrade + Pagination PaginationInfo + type ProfilerDexTradeSortField string + const ProfilerDexSortBlockTimestamp + const ProfilerDexSortChain + const ProfilerDexSortTokenBoughtAgeDays + const ProfilerDexSortTokenBoughtAmount + const ProfilerDexSortTokenBoughtFDV + const ProfilerDexSortTokenBoughtMarketCap + const ProfilerDexSortTokenBoughtSymbol + const ProfilerDexSortTokenSoldAgeDays + const ProfilerDexSortTokenSoldAmount + const ProfilerDexSortTokenSoldFDV + const ProfilerDexSortTokenSoldMarketCap + const ProfilerDexSortTokenSoldSymbol + const ProfilerDexSortTradeValueUSD + const ProfilerDexSortTransactionHash + type ProfilerService struct + func (s *ProfilerService) AddressCurrentBalance(ctx context.Context, req *ProfilerAddressBalancesRequest) (*ProfilerAddressBalancesResponse, error) + func (s *ProfilerService) AddressDEXTrades(ctx context.Context, req *ProfilerDexTradeRequest) (*ProfilerDexTradeResponse, error) + type ProtocolHolding struct + Chain string + ProtocolName string + Tokens []ProtocolToken + TotalAssetsUSD float64 + TotalDebtsUSD float64 + TotalRewardsUSD float64 + TotalValueUSD float64 + type ProtocolToken struct + Address *string + Amount *float64 + PositionType PositionType + Symbol *string + ValueUSD *float64 + type SmartMoneyDexTrade struct + BlockTimestamp string + Chain string + TokenBoughtAddress string + TokenBoughtAgeDays int + TokenBoughtAmount *float64 + TokenBoughtFDV *float64 + TokenBoughtMarketCap *float64 + TokenBoughtSymbol string + TokenSoldAddress string + TokenSoldAgeDays int + TokenSoldAmount *float64 + TokenSoldFDV *float64 + TokenSoldMarketCap *float64 + TokenSoldSymbol string + TradeValueUSD *float64 + TraderAddress string + TraderAddressLabel string + TransactionHash string + type SmartMoneyDexTradesFilters struct + Chain interface{} + ExcludeSmartMoneyLabels []SmartMoneyLabel + IncludeSmartMoneyLabels []SmartMoneyLabel + TokenBoughtAddress interface{} + TokenBoughtAgeDays *NumericRangeFilter + TokenBoughtAmount *NumericRangeFilter + TokenBoughtFDV *NumericRangeFilter + TokenBoughtMarketCap *NumericRangeFilter + TokenBoughtSymbol interface{} + TokenSoldAddress interface{} + TokenSoldAgeDays *NumericRangeFilter + TokenSoldAmount *NumericRangeFilter + TokenSoldFDV *NumericRangeFilter + TokenSoldMarketCap *NumericRangeFilter + TokenSoldSymbol interface{} + TradeValueUSD *NumericRangeFilter + TraderAddress interface{} + TraderAddressLabel interface{} + TransactionHash interface{} + type SmartMoneyDexTradesRequest struct + Chains []Chain + Filters *SmartMoneyDexTradesFilters + OrderBy []SortOrder + Pagination *PaginationRequest + type SmartMoneyDexTradesResponse struct + Data []SmartMoneyDexTrade + Pagination PaginationInfo + type SmartMoneyDexTradesSortField string + const DexTradesSortBlockTimestamp + const DexTradesSortChain + const DexTradesSortTokenBoughtAddress + const DexTradesSortTokenBoughtAgeDays + const DexTradesSortTokenBoughtAmount + const DexTradesSortTokenBoughtFDV + const DexTradesSortTokenBoughtMarketCap + const DexTradesSortTokenBoughtSymbol + const DexTradesSortTokenSoldAddress + const DexTradesSortTokenSoldAgeDays + const DexTradesSortTokenSoldAmount + const DexTradesSortTokenSoldFDV + const DexTradesSortTokenSoldMarketCap + const DexTradesSortTokenSoldSymbol + const DexTradesSortTradeValueUSD + const DexTradesSortTraderAddress + const DexTradesSortTraderAddressLabel + const DexTradesSortTransactionHash + type SmartMoneyHistoricalTokenBalance struct + Balance24HPercentChange *float64 + Chain string + HoldersCount *int + MarketCapUsd *float64 + ShareOfHoldingsPercent *float64 + TokenAddress string + TokenAgeDays *int + TokenSectors []string + TokenSymbol string + ValueUsd *float64 + type SmartMoneyHistoricalTokenBalancesFilters struct + HoldersCount *IntegerRangeFilter + IncludeNativeTokens *bool + IncludeStablecoins *bool + SMFilter []HistoricalSmartMoneyFilterType + type SmartMoneyHistoricalTokenBalancesRequest struct + ApplyBlacklistFilter *bool + AsOfDate string + Chains []Chain + Filters *SmartMoneyHistoricalTokenBalancesFilters + Pagination *PaginationRequest + type SmartMoneyHistoricalTokenBalancesResponse struct + Data []SmartMoneyHistoricalTokenBalance + Pagination PaginationInfo + type SmartMoneyHolding struct + Balance24HPercentChange *float64 + Chain string + HoldersCount int + MarketCapUsd *float64 + ShareOfHoldingsPercent *float64 + TokenAddress string + TokenAgeDays int + TokenSectors []string + TokenSymbol string + ValueUsd *float64 + type SmartMoneyHoldingsFilters struct + Balance24HPercentChange *NumericRangeFilter + ExcludeSmartMoneyLabels []SmartMoneyLabel + HoldersCount *IntegerRangeFilter + IncludeNativeTokens *bool + IncludeSmartMoneyLabels []SmartMoneyLabel + IncludeStablecoins *bool + MarketCapUSD *NumericRangeFilter + ShareOfHoldingsPercent *NumericRangeFilter + TokenAddress interface{} + TokenAgeDays *NumericRangeFilter + TokenSectors []string + TokenSymbol interface{} + ValueUSD *NumericRangeFilter + type SmartMoneyHoldingsRequest struct + Chains []Chain + Filters *SmartMoneyHoldingsFilters + OrderBy []SortOrder + Pagination *PaginationRequest + type SmartMoneyHoldingsResponse struct + Data []SmartMoneyHolding + Pagination PaginationInfo + type SmartMoneyHoldingsSortField string + const HoldingsSortBalance24HChange + const HoldingsSortChain + const HoldingsSortHoldersCount + const HoldingsSortMarketCapUSD + const HoldingsSortShareOfHoldingsPct + const HoldingsSortTokenAddress + const HoldingsSortTokenAgeDays + const HoldingsSortTokenSymbol + const HoldingsSortValueUSD + type SmartMoneyLabel string + const Label180DSmartTrader + const Label30DSmartTrader + const Label90DSmartTrader + const LabelFund + const LabelSmartHLPerpsTrader + const LabelSmartTrader + type SmartMoneyNetflow struct + Chain string + MarketCapUsd *float64 + NetFlow1HUsd *float64 + NetFlow24HUsd *float64 + NetFlow30DUsd *float64 + NetFlow7DUsd *float64 + TokenAddress string + TokenAgeDays int + TokenSectors []string + TokenSymbol string + TraderCount int + type SmartMoneyNetflowFilters struct + ExcludeSmartMoneyLabels []SmartMoneyLabel + IncludeNativeTokens *bool + IncludeSmartMoneyLabels []SmartMoneyLabel + IncludeStablecoins *bool + MarketCapUSD *NumericRangeFilter + TokenAddress interface{} + TokenAgeDays *NumericRangeFilter + TokenSector []string + TraderCount *IntegerRangeFilter + type SmartMoneyNetflowRequest struct + Chains []Chain + Filters *SmartMoneyNetflowFilters + OrderBy []SortOrder + Pagination *PaginationRequest + type SmartMoneyNetflowResponse struct + Data []SmartMoneyNetflow + Pagination PaginationInfo + type SmartMoneyNetflowSortField string + const NetflowSortChain + const NetflowSortMarketCapUSD + const NetflowSortNetFlow1HUSD + const NetflowSortNetFlow24HUSD + const NetflowSortNetFlow30DUSD + const NetflowSortNetFlow7DUSD + const NetflowSortTokenAddress + const NetflowSortTokenAgeDays + const NetflowSortTokenSectors + const NetflowSortTokenSymbol + const NetflowSortTraderCount + type SmartMoneyService struct + func (s *SmartMoneyService) DEXTrades(ctx context.Context, req *SmartMoneyDexTradesRequest) (*SmartMoneyDexTradesResponse, error) + func (s *SmartMoneyService) Holdings(ctx context.Context, req *SmartMoneyHoldingsRequest) (*SmartMoneyHoldingsResponse, error) + func (s *SmartMoneyService) Netflow(ctx context.Context, req *SmartMoneyNetflowRequest) (*SmartMoneyNetflowResponse, error) + type SortDirection string + const SortAsc + const SortDesc + type SortOrder struct + Direction SortDirection + Field string + type TGMFlowIntelligence struct + ExchangeAvgFlowUSD *float64 + ExchangeNetFlowUSD *float64 + ExchangeWalletCount *int + FreshWalletsAvgFlowUSD *float64 + FreshWalletsNetFlowUSD *float64 + FreshWalletsWalletCount *int + PublicFigureAvgFlowUSD *float64 + PublicFigureNetFlowUSD *float64 + PublicFigureWalletCount *int + SmartTraderAvgFlowUSD *float64 + SmartTraderNetFlowUSD *float64 + SmartTraderWalletCount *int + TopPnLAvgFlowUSD *float64 + TopPnLNetFlowUSD *float64 + TopPnLWalletCount *int + WhaleAvgFlowUSD *float64 + WhaleNetFlowUSD *float64 + WhaleWalletCount *int + type TGMFlowIntelligenceFilters struct + ExchangeAvgFlowUSD *NumericRangeFilter + ExchangeNetFlowUSD *NumericRangeFilter + ExchangeWalletCount *IntegerRangeFilter + FreshWalletsAvgFlowUSD *NumericRangeFilter + FreshWalletsNetFlowUSD *NumericRangeFilter + FreshWalletsWalletCount *IntegerRangeFilter + PublicFigureAvgFlowUSD *NumericRangeFilter + PublicFigureNetFlowUSD *NumericRangeFilter + PublicFigureWalletCount *IntegerRangeFilter + SmartTraderAvgFlowUSD *NumericRangeFilter + SmartTraderNetFlowUSD *NumericRangeFilter + SmartTraderWalletCount *IntegerRangeFilter + TopPnLAvgFlowUSD *NumericRangeFilter + TopPnLNetFlowUSD *NumericRangeFilter + TopPnLWalletCount *IntegerRangeFilter + WhaleAvgFlowUSD *NumericRangeFilter + WhaleNetFlowUSD *NumericRangeFilter + WhaleWalletCount *IntegerRangeFilter + type TGMFlowIntelligenceRequest struct + Chain Chain + Filters *TGMFlowIntelligenceFilters + Timeframe *TGMFlowIntelligenceTimeframe + TokenAddress string + type TGMFlowIntelligenceResponse struct + Data []TGMFlowIntelligence + Warnings []string + type TGMFlowIntelligenceTimeframe string + const FlowTimeframe12H + const FlowTimeframe1D + const FlowTimeframe1H + const FlowTimeframe5M + const FlowTimeframe6H + const FlowTimeframe7D + type TGMHistoricalTokenFlowSummary struct + ExchangeAvgFlowUSD *float64 + ExchangeNetFlowUSD *float64 + ExchangeWalletCount *int + FreshWalletsAvgFlowUSD *float64 + FreshWalletsNetFlowUSD *float64 + FreshWalletsWalletCount *int + PublicFigureAvgFlowUSD *float64 + PublicFigureNetFlowUSD *float64 + PublicFigureWalletCount *int + SmartTraderAvgFlowUSD *float64 + SmartTraderNetFlowUSD *float64 + SmartTraderWalletCount *int + TokenSymbol *string + TopPnLAvgFlowUSD *float64 + TopPnLNetFlowUSD *float64 + TopPnLWalletCount *int + WhaleAvgFlowUSD *float64 + WhaleNetFlowUSD *float64 + WhaleWalletCount *int + type TGMHistoricalTokenFlowSummaryRequest struct + ApplyBlacklistFilter *bool + Chain Chain + DateRange DateRange + TokenAddress string + type TGMHistoricalTokenFlowSummaryResponse struct + Data []TGMHistoricalTokenFlowSummary + Warnings []string + type TGMWhoBoughtSold struct + Address string + AddressLabel *string + BoughtTokenVolume *float64 + BoughtVolumeUSD *float64 + SoldTokenVolume *float64 + SoldVolumeUSD *float64 + TokenTradeVolume *float64 + TradeVolumeUSD *float64 + type TGMWhoBoughtSoldFilters struct + Address interface{} + AddressLabel interface{} + BoughtTokenVolume *NumericRangeFilter + BoughtVolumeUSD *NumericRangeFilter + ExcludeSmartMoneyLabels []SmartMoneyLabel + IncludeSmartMoneyLabels []SmartMoneyLabel + SoldTokenVolume *NumericRangeFilter + SoldVolumeUSD *NumericRangeFilter + TokenTradeVolume *NumericRangeFilter + TradeVolumeUSD *NumericRangeFilter + type TGMWhoBoughtSoldRequest struct + BuyOrSell *BuyOrSell + Chain Chain + Date DateRange + Filters *TGMWhoBoughtSoldFilters + OrderBy []SortOrder + Pagination *PaginationRequest + TokenAddress string + type TGMWhoBoughtSoldResponse struct + Data []TGMWhoBoughtSold + Pagination PaginationInfo + type TGMWhoBoughtSoldSortField string + const WhoBoughtSoldSortBoughtTokenVolume + const WhoBoughtSoldSortBoughtVolumeUSD + const WhoBoughtSoldSortSoldTokenVolume + const WhoBoughtSoldSortSoldVolumeUSD + const WhoBoughtSoldSortTokenTradeVolume + const WhoBoughtSoldSortTradeVolumeUSD + type TokenGodModeService struct + func (s *TokenGodModeService) FlowIntelligence(ctx context.Context, req *TGMFlowIntelligenceRequest) (*TGMFlowIntelligenceResponse, error) + func (s *TokenGodModeService) TokenScreener(ctx context.Context, req *TokenScreenerRequest) (*TokenScreenerResponse, error) + func (s *TokenGodModeService) WhoBoughtSold(ctx context.Context, req *TGMWhoBoughtSoldRequest) (*TGMWhoBoughtSoldResponse, error) + type TokenScreenerFilters struct + BuyVolume *NumericRangeFilter + ExcludeSectors []string + ExcludeSmartMoneyLabels []SmartMoneyLabel + FDV *NumericRangeFilter + FDVMCRatio *NumericRangeFilter + IncludeSmartMoneyLabels []SmartMoneyLabel + IncludeStablecoins *bool + InflowFDVRatio *NumericRangeFilter + Liquidity *NumericRangeFilter + MarketCapUSD *NumericRangeFilter + Netflow *NumericRangeFilter + NofBuyers *IntegerRangeFilter + NofBuys *IntegerRangeFilter + NofSellers *IntegerRangeFilter + NofSells *IntegerRangeFilter + NofTraders *IntegerRangeFilter + OnlySmartMoney *bool + OutflowFDVRatio *NumericRangeFilter + PriceChange *NumericRangeFilter + PriceUSD *NumericRangeFilter + Sectors []string + SellVolume *NumericRangeFilter + TokenAddress interface{} + TokenAgeDays *NumericRangeFilter + TokenSymbol interface{} + TraderType *TraderType + Volume *NumericRangeFilter + type TokenScreenerRequest struct + Chains []Chain + Date *DateRange + Filters *TokenScreenerFilters + OrderBy []SortOrder + Pagination *PaginationRequest + Timeframe *TokenScreenerTimeframe + type TokenScreenerResponse struct + Data []TokenScreenerResult + Pagination PaginationInfo + type TokenScreenerResult struct + BuyVolume *float64 + Chain string + FDV *float64 + FDVMCRatio *float64 + InflowFDVRatio *float64 + Liquidity *float64 + MarketCapUSD *float64 + Netflow *float64 + NofBuyers *int + NofBuys *int + NofSellers *int + NofSells *int + NofTraders *int + OutflowFDVRatio *float64 + PriceChange *float64 + PriceUSD *float64 + SellVolume *float64 + TokenAddress string + TokenAgeDays *float64 + TokenAgeHours *float64 + TokenDeploymentDate *string + TokenSymbol string + Volume *float64 + type TokenScreenerSortField string + const ScreenerSortBuyVolume + const ScreenerSortChain + const ScreenerSortFDV + const ScreenerSortFDVMCRatio + const ScreenerSortInflowFDVRatio + const ScreenerSortLiquidity + const ScreenerSortMarketCapUSD + const ScreenerSortNetflow + const ScreenerSortNofBuyers + const ScreenerSortNofBuys + const ScreenerSortNofSellers + const ScreenerSortNofSells + const ScreenerSortNofTraders + const ScreenerSortOutflowFDVRatio + const ScreenerSortPriceChange + const ScreenerSortPriceUSD + const ScreenerSortSellVolume + const ScreenerSortTokenAddress + const ScreenerSortTokenAgeDays + const ScreenerSortTokenSymbol + const ScreenerSortVolume + type TokenScreenerTimeframe string + const Timeframe10M + const Timeframe1H + const Timeframe24H + const Timeframe30D + const Timeframe5M + const Timeframe6H + const Timeframe7D + type TraderType string + const TraderAll + const TraderConsistentPerpsWinner + const TraderHighWinrateHLPerps + const TraderPredictedWinner + const TraderPublicFigure + const TraderSmartMoney + const TraderTrending + const TraderWhale