madeonsol-x402 4.2.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ import { createTerminalTokenView } from "./terminal-watch.js";
2
+ /**
3
+ * The existing stream's public `on` overloads use specific event signatures.
4
+ * Narrowly adapt those overloads to the small event-port used by the shared
5
+ * controller, without changing stream/client behavior.
6
+ *
7
+ * Exported for BROWSER terminals that must not hold an API key: pair it with
8
+ * `createTerminalTokenView({ stream: terminalStreamPort(stream), read })`, where
9
+ * `stream` gets its short-lived token from your backend (`getToken`) and `read`
10
+ * calls your backend, which calls the keyed intelligence endpoint.
11
+ */
12
+ export function terminalStreamPort(stream) {
13
+ const listenerPort = stream;
14
+ return {
15
+ subscribe({ subId, channels, filters }) {
16
+ stream.subscribe({ subId, channels: channels, filters });
17
+ },
18
+ unsubscribe(subId) { stream.unsubscribe(subId); },
19
+ on(event, listener) { listenerPort.on(event, listener); },
20
+ off(event, listener) { listenerPort.off(event, listener); },
21
+ };
22
+ }
23
+ /** Creates an active, terminal-scoped view; returns a handle with dispose(). */
24
+ export function createSolanaTerminalWatch(client, mint, options) {
25
+ if (!options || !options.stream)
26
+ throw new Error("shared_stream_required");
27
+ if (!options.subId || !/^[A-Za-z0-9_.-]{1,64}$/.test(options.subId) || options.subId === "default") {
28
+ throw new Error("unique_named_sub_id_required");
29
+ }
30
+ // A named subscribe REPLACES that subId's filters on the server. Never allow
31
+ // a different terminal widget to silently commandeer an existing watch.
32
+ if (options.stream.getSubscriptions().some(sub => sub.subId === options.subId)) {
33
+ throw new Error("named_sub_id_already_in_use");
34
+ }
35
+ const watch = createTerminalTokenView({
36
+ chain: "solana",
37
+ address: mint,
38
+ tier: options.tier,
39
+ include: options.include,
40
+ includeKolBroadcast: options.includeKolBroadcast,
41
+ subId: options.subId,
42
+ stream: terminalStreamPort(options.stream),
43
+ read: modules => client.tokenIntelligence(mint, { include: [...modules] }),
44
+ onChange: options.onChange,
45
+ onLive: options.onLive,
46
+ minModuleRefreshMs: options.minModuleRefreshMs,
47
+ debounceMs: options.debounceMs,
48
+ });
49
+ watch.start();
50
+ return watch;
51
+ }
52
+ //# sourceMappingURL=terminal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal.js","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,uBAAuB,EACe,MAAM,qBAAqB,CAAC;AAsB3E;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAuB;IACxD,MAAM,YAAY,GAAG,MAGpB,CAAC;IACF,OAAO;QACL,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE;YACpC,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAA2B,EAAE,OAAO,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,WAAW,CAAC,KAAK,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjD,EAAE,CAAC,KAAK,EAAE,QAAQ,IAAI,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QACzD,GAAG,CAAC,KAAK,EAAE,QAAQ,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,yBAAyB,CACvC,MAAqB,EACrB,IAAY,EACZ,OAAmC;IAEnC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC3E,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACnG,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IACD,6EAA6E;IAC7E,wEAAwE;IACxE,IAAI,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/E,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,KAAK,GAAG,uBAAuB,CAAC;QACpC,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,OAAoC;QACrD,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;QAChD,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC;QAC1C,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAgC,EAAE,CAAC;QACzG,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;IACH,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,OAAO,KAAK,CAAC;AACf,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1203,6 +1203,28 @@ export interface CapTableBuyer {
1203
1203
  first_sell_at?: string | null;
1204
1204
  /** first_sell_at == null (swap-ledger scoped: a plain transfer out still reads as holding). */
1205
1205
  still_holding?: boolean;
1206
+ /** 2026-10, only with verify_current_balances=true (ULTRA+): the current balance of this mint. */
1207
+ balance_now?: {
1208
+ amount_raw: string;
1209
+ decimals: number | null;
1210
+ amount: string;
1211
+ holding: boolean;
1212
+ token_accounts: number;
1213
+ slot: number;
1214
+ };
1215
+ /** 2026-10, only with verify_current_balances=true: the balance (unlike still_holding, the swap ledger). */
1216
+ holding_status?: "verified_nonzero" | "verified_zero";
1217
+ /** 2026-10, only with verify_current_balances=true: zero balance although no sell is on the swap ledger. */
1218
+ exited_without_sell?: boolean;
1219
+ /** 2026-10, only with include_scout_scores=true: KOL buyers' scout score as of first_buy_at (no hindsight); null for non-KOLs. */
1220
+ scout_score?: {
1221
+ as_of: string;
1222
+ first_touches_30d: number;
1223
+ avg_followers_4h: number | null;
1224
+ swarm_3plus_pct: number | null;
1225
+ swarm_5plus_pct: number | null;
1226
+ scout_tier: "S" | "A" | "B" | "C" | null;
1227
+ } | null;
1206
1228
  is_bundle: boolean;
1207
1229
  is_kol: boolean;
1208
1230
  kol_name: string | null;
@@ -1267,6 +1289,22 @@ export interface TokenCapTableResponse {
1267
1289
  /** v1.23.4 — trade-coverage disclosure (keyed route; absent on the x402 mirror and older cached responses). */
1268
1290
  coverage?: TradeCoverage;
1269
1291
  /** 2026-10 — whether early-buyer ranks 1..20 can be trusted (a recorded ingest gap overlapping launch→last ranked buy means a true early buyer may be missing). Absent on older responses. */
1292
+ /** 2026-10, only with include_scout_scores=true. */
1293
+ scout_scores_status?: "ok" | "unavailable" | "timeout" | "error";
1294
+ scout_scores_note?: string;
1295
+ /** 2026-10, only with verify_current_balances=true (ULTRA+), after every scored buyer was read. */
1296
+ onchain_balance_verification?: {
1297
+ source: string;
1298
+ checked_at: string;
1299
+ slot_min: number;
1300
+ slot_max: number;
1301
+ verified_wallets: number;
1302
+ complete: boolean;
1303
+ verified_still_holding: number;
1304
+ verified_exited: number;
1305
+ exited_without_sell: number;
1306
+ note: string;
1307
+ };
1270
1308
  ranks_completeness?: {
1271
1309
  ranks_complete: "observed_from_launch" | "gap_overlap" | "not_verified" | "no_ranks";
1272
1310
  rank_basis: "first_persisted_buys_at_or_above_floor";
@@ -1281,6 +1319,17 @@ export interface TokenCapTableResponse {
1281
1319
  }
1282
1320
  export interface TokenBuyerQualityResponse {
1283
1321
  mint: string;
1322
+ /** 2026-10, REST only with include_balances=true (PRO+): the dump-cluster early buyers' CURRENT holdings; totals only when every member was read. */
1323
+ dump_cluster_held_now?: {
1324
+ cohort_size: number;
1325
+ members: number;
1326
+ held_now: Record<string, unknown>;
1327
+ wallets: Array<{
1328
+ wallet: string;
1329
+ balance_now: Record<string, unknown> | null;
1330
+ }>;
1331
+ note: string;
1332
+ };
1284
1333
  score: number;
1285
1334
  confidence: BuyerQualityConfidence;
1286
1335
  signal: BuyerQualitySignal;
@@ -1633,6 +1682,15 @@ export interface BundleWallet {
1633
1682
  win_rate?: number | null;
1634
1683
  bot_confidence?: string | null;
1635
1684
  tokens_held?: number;
1685
+ /** 2026-10, only with include_balances=true: current balance of the mint; null when the cohort read failed. */
1686
+ balance_now?: {
1687
+ amount_raw: string;
1688
+ decimals: number | null;
1689
+ amount: string;
1690
+ holding: boolean;
1691
+ token_accounts: number;
1692
+ slot: number;
1693
+ } | null;
1636
1694
  }
1637
1695
  /**
1638
1696
  * Bundle-cohort holdings for a token. `held_pct_of_supply` (net held / circulating
@@ -1643,6 +1701,23 @@ export interface BundleWallet {
1643
1701
  export interface TokenBundleResponse {
1644
1702
  mint: string;
1645
1703
  bundle: BundleSummary;
1704
+ /** 2026-10, only with include_balances=true (PRO+): balance-based held figures; totals only when complete. */
1705
+ held_now?: {
1706
+ source: "solana_rpc_getTokenAccountsByOwner";
1707
+ checked_at: string;
1708
+ wallets: number;
1709
+ verified_wallets: number;
1710
+ holding_wallets: number;
1711
+ complete: boolean;
1712
+ incomplete_reason: string | null;
1713
+ slot_min: number | null;
1714
+ slot_max: number | null;
1715
+ tokens_held_raw: string | null;
1716
+ tokens_held: string | null;
1717
+ /** RATIO in [0, 1] of circulating_supply_raw. */
1718
+ held_pct_of_supply: number | null;
1719
+ supply_basis: "circulating_supply_raw" | null;
1720
+ };
1646
1721
  wallets: BundleWallet[];
1647
1722
  /** v1.23.4 — trade-coverage disclosure (keyed route; absent on older cached responses). */
1648
1723
  coverage?: TradeCoverage;
@@ -2946,6 +3021,8 @@ export interface WalletTrade {
2946
3021
  market_price_usd: number | null;
2947
3022
  block_time: number;
2948
3023
  traded_at: string;
3024
+ /** Exact on-chain amounts — see {@link TradeRawAmounts}. Present once exact amounts are enabled server-side. */
3025
+ amounts?: TradeRawAmounts;
2949
3026
  }
2950
3027
  export interface WalletTradesResponse {
2951
3028
  /** Trade-data coverage disclosure. */
@@ -3020,6 +3097,25 @@ export interface TokenTrade {
3020
3097
  slot: number | null;
3021
3098
  block_time: number;
3022
3099
  traded_at: string;
3100
+ /** Exact on-chain amounts — see {@link TradeRawAmounts}. Present once exact amounts are enabled server-side. */
3101
+ amounts?: TradeRawAmounts;
3102
+ }
3103
+ /** Exact amounts of one Solana trade (#508). Integers are decimal STRINGS (u64
3104
+ * base units exceed the JS number range; parse with BigInt).
3105
+ * `raw_known: false` = a row stored before exact amounts existed: every field
3106
+ * is null = UNKNOWN, never 0. `sol_amount` / `token_amount` on the row keep their
3107
+ * meaning (gross SOL incl. fee/rent; 6-decimal rounded UI amount). */
3108
+ export interface TradeRawAmounts {
3109
+ /** |net change of the traded mint|, base units (token_amount = token_raw / 10^token_decimals, exact). */
3110
+ token_raw: string | null;
3111
+ token_decimals: number | null;
3112
+ /** Signed lamports (negative = paid), tx fee + token-account rent excluded; null unless SOL is the proven settlement. */
3113
+ sol_net_lamports: string | null;
3114
+ /** The one non-SOL token moved the other way (USDC, PUMP, an xStock …); quote and SOL both null = settlement unknown. */
3115
+ quote_mint: string | null;
3116
+ quote_raw: string | null;
3117
+ quote_decimals: number | null;
3118
+ raw_known: boolean;
3023
3119
  }
3024
3120
  /** Mint-scoped trade tape. `coverage` is the honesty block: the tape starts
3025
3121
  * 2026-04-12 (`history_start`, unix sec) and is pump.fun-pipeline scoped
@@ -3061,12 +3157,18 @@ export interface TokenTopTrader {
3061
3157
  sells: number;
3062
3158
  bought_sol: number;
3063
3159
  sold_sol: number;
3160
+ /** Realized SOL PnL on the matched portion; cost basis per `cost_method`. */
3064
3161
  realized_pnl_sol: number;
3065
- unrealized_pnl_sol: number;
3066
- total_pnl_sol: number;
3067
- held_value_sol: number;
3162
+ /** null when still holding a token we cannot price (never valued at 0). */
3163
+ unrealized_pnl_sol: number | null;
3164
+ total_pnl_sol: number | null;
3165
+ held_value_sol: number | null;
3068
3166
  roi: number | null;
3069
3167
  still_holding: boolean;
3168
+ /** FIFO only: tokens sold without an observed earlier buy (proceeds excluded from realized PnL). null under average_cost. */
3169
+ unmatched_sell_tokens?: number | null;
3170
+ /** FIFO only: every sold token matched an observed buy. null under average_cost. */
3171
+ cost_basis_complete?: boolean | null;
3070
3172
  first_trade_at: string;
3071
3173
  last_trade_at: string;
3072
3174
  is_kol: boolean;
@@ -3081,6 +3183,9 @@ export interface TokenTopTradersResponse {
3081
3183
  mint: string;
3082
3184
  sort: "pnl" | "roi";
3083
3185
  window_days: number;
3186
+ /** "fifo" = same cost basis as /wallet/{address}/pnl; "average_cost" = legacy fallback (overstates profit on unmatched sells). */
3187
+ cost_method?: "fifo" | "average_cost";
3188
+ cost_method_note?: string;
3084
3189
  traders: TokenTopTrader[];
3085
3190
  summary: {
3086
3191
  returned: number;
@@ -3468,7 +3573,10 @@ export interface SniperDeploy {
3468
3573
  deployer_runner_rate?: number | null;
3469
3574
  deployer_labeled_tokens?: number | null;
3470
3575
  confirmed_on_chain: boolean | null;
3576
+ /** ShredPrism: FIRST observed successful confirmed-or-stronger outcome (observation time, not consensus time). Current status = confirmed_on_chain / execution_status. */
3471
3577
  confirmed_at: string | null;
3578
+ /** ShredPrism: first observed successful finalized outcome; null for legacy deshred rows. */
3579
+ finalized_at?: string | null;
3472
3580
  /** v1.21 — slot-window snipe rollup (slots [-1..+3]). Null until the ~10-min
3473
3581
  * settle window has passed — absent, not zero. */
3474
3582
  footprint?: SniperFootprint | null;
@@ -3487,6 +3595,28 @@ export interface SniperRecentResponse {
3487
3595
  data_age_seconds: number | null;
3488
3596
  /** Present (true) only when watchlist=true and your watchlist is empty. */
3489
3597
  watchlist_empty?: boolean;
3598
+ /** Which rows are still STORED per source (retention, not detection coverage). Nothing is
3599
+ * stored inside `gap`: legacy deshred ended at the 2026-10-06 switch; ShredPrism rows are deleted after 6 h. */
3600
+ history?: SniperHistory;
3601
+ }
3602
+ export interface SniperHistory {
3603
+ sources: Array<{
3604
+ source: "deshred";
3605
+ status: "retired";
3606
+ newest_row_at: string;
3607
+ } | {
3608
+ source: "shredprism";
3609
+ status: "live";
3610
+ retention_hours: number;
3611
+ retained_from: string;
3612
+ }>;
3613
+ gap: {
3614
+ from: string;
3615
+ to: string;
3616
+ } | null;
3617
+ source_switch_date: string;
3618
+ confirmed_at_semantics: string;
3619
+ note: string;
3490
3620
  }
3491
3621
  /** One DEX pool a token trades in. `is_active` distinguishes live vs parked venues. */
3492
3622
  export interface TokenPool {
@@ -3651,7 +3781,34 @@ export interface TokenDepthResponse {
3651
3781
  };
3652
3782
  }
3653
3783
  /** Wallet-intelligence labels on a holder. Empty = unknown to us, NOT verified clean. */
3654
- export type TokenHolderLabel = "deployer" | "kol" | "early_buyer" | "buyer" | "bundle" | "bot" | "dump_cluster";
3784
+ /** sniper / bundler_wallet / dumper / alpha_tracked appear only with `include_wallet_flags=true`. Empty labels = unknown to us, not verified clean. */
3785
+ export type TokenHolderLabel = "deployer" | "kol" | "early_buyer" | "buyer" | "bundle" | "bot" | "dump_cluster" | "sniper" | "bundler_wallet" | "dumper" | "alpha_tracked";
3786
+ /** Per label: `evaluated: false` means insufficient evidence, NOT a verified negative. */
3787
+ export type WalletFlagLabelCoverage = Record<string, {
3788
+ evaluated: boolean;
3789
+ reason?: string;
3790
+ }>;
3791
+ /** Per-holder flags, only with `include_wallet_flags=true` (TR-07). Null when the flag sources were unavailable. */
3792
+ export interface TokenHolderWalletFlags {
3793
+ is_sniper: boolean;
3794
+ is_bundler: boolean;
3795
+ is_dumper: boolean;
3796
+ is_kol: boolean;
3797
+ is_alpha_tracked: boolean;
3798
+ is_bot_high_confidence: boolean;
3799
+ label_coverage: WalletFlagLabelCoverage;
3800
+ }
3801
+ /** Top-level flag status, only with `include_wallet_flags=true`. */
3802
+ export interface WalletFlagsMeta {
3803
+ status: "available" | "partial" | "unavailable";
3804
+ rule_version?: string;
3805
+ note?: string;
3806
+ [key: string]: unknown;
3807
+ }
3808
+ export interface TokenHoldersParams {
3809
+ /** Opt in to per-holder `wallet_flags` + `wallet_flags_meta` (PRO+, tier-disclosed rows only). */
3810
+ include_wallet_flags?: boolean;
3811
+ }
3655
3812
  /** One ranked holder (owner wallet, token accounts merged). */
3656
3813
  export interface TokenHolder {
3657
3814
  rank: number;
@@ -3670,6 +3827,8 @@ export interface TokenHolder {
3670
3827
  early_buyer_rank: number | null;
3671
3828
  bot_confidence: "none" | "low" | "medium" | "high" | null;
3672
3829
  historical_win_rate: number | null;
3830
+ /** Only with `include_wallet_flags=true`; null when the flag sources were unavailable. */
3831
+ wallet_flags?: TokenHolderWalletFlags | null;
3673
3832
  }
3674
3833
  /**
3675
3834
  * An owner EXCLUDED from the circulating denominator, named where we can:
@@ -3700,6 +3859,10 @@ export interface TokenHoldersConcentration {
3700
3859
  token_accounts_nonzero: number | null;
3701
3860
  /** Raw u64 as STRINGS. */
3702
3861
  supply_raw: string | null;
3862
+ /** Where supply_raw came from: the mint account read in this request (normal), the cache, or getTokenSupply. null when withheld. */
3863
+ supply_source?: "mint_account" | "token_prices_cache" | "rpc_token_supply" | null;
3864
+ /** false = no supply consistent with the disclosed balances; every percentage is then null. */
3865
+ supply_consistent?: boolean;
3703
3866
  circulating_raw: string | null;
3704
3867
  decimals: number | null;
3705
3868
  /** Shares over the circulating denominator (supply minus excluded). top50/top100 are null on the top-20 fallback. */
@@ -3767,6 +3930,8 @@ export interface TokenHoldersResponse {
3767
3930
  census_fallback_reason: string | null;
3768
3931
  note: string;
3769
3932
  };
3933
+ /** Only with `include_wallet_flags=true`. */
3934
+ wallet_flags_meta?: WalletFlagsMeta;
3770
3935
  }
3771
3936
  /** Locker program a contract lives under. LP locks are NOT covered (token / vesting locks only). */
3772
3937
  /** smithii_vesting / sablier_lockup are served only while listed in the response's meta.programs (verified admission). */
@@ -3942,7 +4107,7 @@ export interface TokenLocksSummary {
3942
4107
  active_cancelable_by_sender: number;
3943
4108
  }
3944
4109
  /** Panels a terminal can ask for. There is no default set: name every module you render. */
3945
- export type TokenIntelligenceModuleId = "snapshot" | "risk" | "buyer_quality" | "holders" | "flow" | "kol" | "locks" | "top_traders";
4110
+ export type TokenIntelligenceModuleId = "snapshot" | "risk" | "buyer_quality" | "holders" | "holder_count" | "flow" | "kol" | "locks" | "top_traders";
3946
4111
  /** Per-module outcome; a non-ready module never carries `data` (a failure is never a zero). */
3947
4112
  export type TokenIntelligenceModuleStatus = "ready" | "partial_history" | "unverified" | "unavailable" | "timeout";
3948
4113
  /** Query params for GET /tokens/{mint}/intelligence (and the RHC twin). */
@@ -3950,8 +4115,11 @@ export interface TokenIntelligenceParams {
3950
4115
  /**
3951
4116
  * Required. Modules as an array or a comma-separated string. Budget: at most
3952
4117
  * 5 modules and total cost 8 (snapshot 2, risk 2, buyer_quality 2, holders 3,
3953
- * flow 3, kol 1, locks 1, top_traders 2); over budget is HTTP 400
4118
+ * holder_count 1, flow 3, kol 1, locks 1, top_traders 2); over budget is HTTP 400
3954
4119
  * `include_budget_exceeded` before any read. `holders` is opt-in only.
4120
+ * `holder_count` (Solana) is the last complete holder census, stored: `ready`
4121
+ * when fresh, `unverified` (`stale_measurement`) with the count and its
4122
+ * `as_of` when older, `unavailable` (`not_measured`) when unknown (never 0).
3955
4123
  */
3956
4124
  include: readonly TokenIntelligenceModuleId[] | string;
3957
4125
  }
@@ -5509,6 +5677,26 @@ export interface DeployerTokensParams {
5509
5677
  offset?: number;
5510
5678
  /** true = only tokens that graduated (bonded_at set); total / has_more count the bonded set. */
5511
5679
  only_bonded?: boolean;
5680
+ /** Opt in to `launches_24h` (distinct launches observed in our index over a rolling UTC 24 h window). */
5681
+ include_launches_24h?: boolean;
5682
+ }
5683
+ /**
5684
+ * Launches observed in OUR index over a rolling UTC 24 h window (TR-03).
5685
+ * Indexed observations only, not a chain-complete count. `count` is null
5686
+ * (never 0) unless `status` is `observed`.
5687
+ */
5688
+ export interface DeployerLaunches24h {
5689
+ window_start: string;
5690
+ window_end: string;
5691
+ count: number | null;
5692
+ status: "observed" | "source_unavailable" | "over_budget" | "source_incomplete" | "untracked_deployer";
5693
+ completeness: "indexed_observations_only";
5694
+ provenance?: string;
5695
+ row_cap_per_source?: number;
5696
+ source_rows?: {
5697
+ bonded?: number;
5698
+ pending?: number;
5699
+ };
5512
5700
  }
5513
5701
  /** `GET /deployer-hunter/{wallet}/tokens` — newest bond first. */
5514
5702
  export interface DeployerTokensResponse {
@@ -5522,6 +5710,8 @@ export interface DeployerTokensResponse {
5522
5710
  offset: number;
5523
5711
  has_more: boolean;
5524
5712
  coverage?: LaunchCoverage;
5713
+ /** Present only with `include_launches_24h=true`. */
5714
+ launches_24h?: DeployerLaunches24h;
5525
5715
  }
5526
5716
  export interface DeployerAlertStatsParams {
5527
5717
  /** Lookback window, e.g. `24h`, `7d`, `30d`. */
@@ -5649,4 +5839,78 @@ export interface RecentBondsResponse extends FreeTierDelayMeta {
5649
5839
  /** Pass back as `since` to fetch only newer bonds. */
5650
5840
  next_since?: string | null;
5651
5841
  }
5842
+ /** Filters for the `token:bundles` channel (all optional, AND-combined; invalid values reject the channel). */
5843
+ export interface TokenBundlesFilters {
5844
+ /** Only these mints (at most 250). */
5845
+ mints?: string[];
5846
+ /** Minimum distinct buyers in the cluster (3-50, count at detection). */
5847
+ min_wallets?: number;
5848
+ /** Minimum buyers new to the token (3-50). */
5849
+ min_new_wallets?: number;
5850
+ /** launch = within 5 minutes of the token's first sighting. */
5851
+ phases?: Array<"launch" | "later" | "unknown">;
5852
+ /** Only clusters where one transaction carried 3+ of the buyers. */
5853
+ atomic_only?: boolean;
5854
+ /** Only these event types (default both). */
5855
+ bundle_events?: Array<"token:bundle_cluster" | "token:bundle_exit">;
5856
+ }
5857
+ /**
5858
+ * `token:bundle_cluster` on WS `token:bundles` (PRO+): one NEW coordinated buy
5859
+ * cluster on a Solana token, launch or later: one slot where >= 3 wallets
5860
+ * bought and >= 3 of them had never bought the token before. Only stored buys
5861
+ * count (0.05 SOL / $3.50 persistence floor). `wallet_count` is the count at
5862
+ * detection; a cluster is announced once. Evidence, not a verdict. For the
5863
+ * share of supply these wallets hold now call `tokenBundleShare()`.
5864
+ */
5865
+ export interface TokenBundleClusterEvent {
5866
+ /** bundle_cluster_events row id (dedupe key). */
5867
+ id: number;
5868
+ chain: "solana";
5869
+ mint: string;
5870
+ slot: number;
5871
+ /** First buy of the cluster (ISO). */
5872
+ at: string;
5873
+ minutes_after_launch: number | null;
5874
+ phase: "launch" | "later" | "unknown";
5875
+ launch_at: string | null;
5876
+ wallet_count: number;
5877
+ new_wallets: number;
5878
+ /** Transactions carrying 3+ of the buyers (definitively coordinated). */
5879
+ atomic_txs: number;
5880
+ sol_volume: number | null;
5881
+ token_volume: number | null;
5882
+ /** Up to 50 buyer wallets. */
5883
+ wallets: string[];
5884
+ /** When bundle-watch detected it (ISO). */
5885
+ detected_at: string;
5886
+ }
5887
+ /**
5888
+ * `token:bundle_exit` on WS `token:bundles` (PRO+): an announced cluster's
5889
+ * wallets have sold `threshold_pct` (25 / 50 / 90 / 100) % of what they bought
5890
+ * IN the cluster, each threshold once. Carries the cluster's own fields, so the
5891
+ * channel filters apply alike. Only sells by the bundle wallets themselves,
5892
+ * followed for 7 days after detection; first 50 wallets of a larger cluster.
5893
+ */
5894
+ export interface TokenBundleExitEvent extends Omit<TokenBundleClusterEvent, "sol_volume" | "token_volume" | "wallets"> {
5895
+ cluster_id: number;
5896
+ cluster_detected_at: string | null;
5897
+ threshold_pct: 25 | 50 | 90 | 100;
5898
+ wallets_tracked: number;
5899
+ wallets_sold: number;
5900
+ /** Wallets that sold at least 99 % of their cluster buy. */
5901
+ wallets_exited: number;
5902
+ bought_tokens: number;
5903
+ sold_tokens: number;
5904
+ /** sum over wallets of min(sold, bought) / bought, 0..1. */
5905
+ sold_pct: number | null;
5906
+ realized_sol: number;
5907
+ last_sell_at: string | null;
5908
+ recent_sells: Array<{
5909
+ wallet: string;
5910
+ tx_signature: string;
5911
+ tokens: number | null;
5912
+ sol: number | null;
5913
+ at: string;
5914
+ }>;
5915
+ }
5652
5916
  //# sourceMappingURL=types.d.ts.map