JSPM

@motosan-whale/core

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q56004F
  • License MIT

Shared types, interfaces, and utilities for the motosan-whale SDK

Package Exports

  • @motosan-whale/core

Readme

@motosan-whale/core

Layer 0: Zero-dependency types and interfaces for the motosan-whale SDK.

Part of the motosan-whale SDK — agent-first whale tracking tools.

Install

pnpm add @motosan-whale/core

Usage

import type {
  Chain, RawTransaction, ToolResult,
  ChainSource, NansenSource, StreamingSource,
  TargetedSnapshot, TargetedDiff,
} from '@motosan-whale/core'
import { diffTargetedSnapshots } from '@motosan-whale/core'

API

Types

  • Chain — supported chain identifiers
  • RawTransaction — normalized transaction type
  • TokenInfo, TokenTransfer — token-related types
  • WalletEnrichment, SmartMoneyAlert, TokenFlow — Nansen data types
  • TokenAccountDetail — detailed info for a single SPL token account
  • WalletMintTarget — wallet+mint pair used as a batch query target
  • WalletMintAccounts — aggregated token accounts for a wallet+mint pair
  • BatchMintBalanceResult — result of a batch wallet+mint balance query
  • TargetedSnapshot — point-in-time snapshot of specific wallet+mint targets
  • TargetedDiff, TargetedDiffEntry — structured diff between two targeted snapshots
  • QueryOptions, LargeTxQuery, AlertQuery, TopWalletsQuery, TrendingTokensQuery — query option types
  • ToolResult<T> — standard tool return type
  • TxCallback, Unsubscribe — streaming callback types

Interfaces

  • ChainSource — on-chain data (transactions, balances, token accounts)
  • NansenSource — Nansen analytics (smart money, alerts, token flows). Replaces the deprecated DiscoverySource / EnrichmentSource interfaces, which are still exported as aliases.
  • StreamingSource — real-time subscriptions (WebSocket / event streams). Methods:
    • watchAddress(address, chain, callback) — subscribe to new txs for an address
    • watchLargeTxs(opts, callback) — subscribe to large txs matching filter criteria
    • dispose() — tear down all subscriptions

Utilities

  • diffTargetedSnapshots(before, after) — compare two TargetedSnapshots and return a TargetedDiff with increased, decreased, unchanged, newTargets, and missingTargets buckets.
  • withMetadata(data, meta) — attach metadata to a tool result
  • diffSnapshots(before, after) — diff two full snapshots

License

MIT