madeonsol 2.29.0 → 2.31.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.
package/README.md CHANGED
@@ -1301,7 +1301,7 @@ stream.subscribe(["kol:trades", "deployer:alerts"]);
1301
1301
  // stream.unsubscribe([...]) / stream.close() when done
1302
1302
  ```
1303
1303
 
1304
- Channels: `kol:trades`, `kol:coordination`, `kol:first_touches`, `deployer:alerts`, `wallet_tracker:events`, `copytrade:signals`, `price_alert:events`, `sniper:deploys`, `token:graduations`, `token:prices` (**new** in the channel list — event `token:price`, per-mint price/MC ticks; PRO+, REQUIRES `filters.mints` — PRO 25 / ULTRA 100 / BUSINESS 250 per connection; a state stream, so ticks carry no id/seq and are never replayed) (every pump.fun graduation in real time, tracked deployer or not — typed `GraduationEvent`), `token:locks` (**new 2.25** — event `token:lock` for every NEW Streamflow / Jupiter Lock / Bonfida lock or vesting contract, typed `TokenLockStreamEvent`; PRO+; updates are not pushed — poll `client.token.locks()`), `token:fee_claims` (**new 2.25** — event `token:fee_claim` for every pump.fun fee event: distributions, social-handle claims, config changes, typed `TokenFeeClaimStreamEvent`; PRO+), `token:surges` (**new 2.26** — events `token:surge` / `token:revival` the moment a momentum fire is confirmed, typed `TokenSurgeStreamEvent` with `tape` / `kol` / `early_buyers` / `deployer` / `risk_flags[]`; server-side filters `kinds[]`, `tiers[]`, `launchpads[]`, `exclude_flags[]`, `min_mc_usd` / `max_mc_usd`, `deployer_tier[]` — typed `TokenSurgesSubscribeFilters`; PRO+; the +1 h `outcome` is REST-only — poll `client.token.surges()`). Lifecycle: `open`, `close`, `reconnect`, `subscribed`, `heartbeat`, `warning`, `cursor`, `replay`, `gap`, `fatal`, `error`. Node 22+ uses the global `WebSocket`; on Node < 22 also `npm i ws`.
1304
+ Channels: `kol:trades`, `kol:coordination`, `kol:first_touches`, `deployer:alerts`, `wallet_tracker:events`, `copytrade:signals`, `price_alert:events`, `sniper:deploys`, `token:graduations`, `token:prices` (**new** in the channel list — event `token:price`, per-mint price/MC ticks; PRO+, REQUIRES `filters.mints` — PRO 25 / ULTRA 100 / BUSINESS 250 per connection; a state stream, so ticks carry no id/seq and are never replayed) (every pump.fun graduation in real time, tracked deployer or not — typed `GraduationEvent`), `token:locks` (**new 2.25** — event `token:lock` for every NEW Streamflow / Jupiter Lock / Bonfida lock or vesting contract, typed `TokenLockStreamEvent`; PRO+; updates are not pushed — poll `client.token.locks()`), `token:fee_claims` (**new 2.25** — event `token:fee_claim` for every pump.fun fee event: distributions, social-handle claims, config changes, typed `TokenFeeClaimStreamEvent`; PRO+), `token:surges` (**new 2.26** — events `token:surge` / `token:revival` the moment a momentum fire is confirmed, typed `TokenSurgeStreamEvent` with `tape` / `kol` / `early_buyers` / `deployer` / `risk_flags[]`; server-side filters `kinds[]`, `tiers[]`, `launchpads[]`, `exclude_flags[]`, `min_mc_usd` / `max_mc_usd`, `deployer_tier[]` — typed `TokenSurgesSubscribeFilters`; PRO+; the +1 h `outcome` is REST-only — poll `client.token.surges()`), `token:candles`, `token:risk`, `wallet:scores` (**new, server 2026-09-23** — live 1-minute candles, risk-input changes and wallet-score changes; all PRO+ and scoped, see below). Lifecycle: `open`, `close`, `reconnect`, `subscribed`, `heartbeat`, `warning`, `cursor`, `replay`, `gap`, `fatal`, `error`. Node 22+ uses the global `WebSocket`; on Node < 22 also `npm i ws`.
1305
1305
 
1306
1306
  ##### Recovery: cursor, resume, de-duplication *(new in 2.28.0)*
1307
1307
 
@@ -1344,6 +1344,34 @@ console.log(await stream.listSubscriptions()); // [{ subId, channels, filters },
1344
1344
  stream.unsubscribe("deploys");
1345
1345
  ```
1346
1346
 
1347
+ #### Lock lifecycle on `token:locks` *(server 2026-09-23)*
1348
+
1349
+ Add `filters.lifecycle: true` to a `token:locks` subscription to also receive `token:lock_claimed`, `token:lock_cancelled`, `token:lock_closed`, `token:lock_updated` (`change`: `topup` | `extended` | `schedule_changed` | `recipient_changed`), `token:unlock_upcoming` (next unlock within 24 h) and `token:unlock_available` (passed within 30 min — **claimable per the schedule, not claimed**). Without `lifecycle` the channel is unchanged. Optional `events[]`, `unlock_kinds[]`, `mints[]` (≤ 500) and `include_automatic_claims` (default `false`: Streamflow keeper-cranked withdrawals, ~90 % of claims, are hidden unless set). Types `TokenLockLifecycleFilters` / `TokenLockLifecycleEvent`; raw string amounts, no USD field, no events for history.
1350
+
1351
+ ```ts
1352
+ const stream = client.stream.connect();
1353
+ stream.subscribe({ subId: "locks", channels: ["token:locks"], filters: { lifecycle: true, events: ["token:lock_claimed", "token:unlock_available"], mints: [MINT] } });
1354
+ stream.on("token:unlock_available", (e: TokenUnlockScheduleEvent) => console.log(e.unlock_kind, e.amount_raw, "claimable, not claimed"));
1355
+ ```
1356
+
1357
+ #### Candles, risk inputs and wallet scores *(server 2026-09-23)*
1358
+
1359
+ Three PRO+ channels, all **scoped** (per-connection cap PRO 25 / ULTRA 100 / BUSINESS 250, counted across named subscriptions; over the cap or without a scope the channel is rejected, never truncated):
1360
+
1361
+ - **`token:candles`** — `filters.mints` (REQUIRED, a budget separate from `token:prices`). `candle:closed` carries the stored 1-minute row (`TokenCandleClosedEvent`, id `candle:solana:<mint>:<bucket epoch s>`, ≈ ≤ 25 s after the minute ends; fully flat zero-trade minutes are skipped) and resumes durably. `filters.updates: true` adds `candle:update`, the in-progress minute (`TokenCandleUpdateEvent`, ≤ 1 per mint per second, a state stream: no id, never replayed, no snapshot). Filters `TokenCandlesFilters`.
1362
+ - **`token:risk`** — `filters.mints` (REQUIRED). Risk-INPUT changes, not a score stream: `risk:authority_changed` (mint / freeze authority revoked, Token-2022 transfer fee changed) and `risk:supply_inflated` (first crossing of 0.5 % / 5 % supply drift), plus one `risk:inputs` snapshot frame per mint (`frame.snapshot === true`) on subscribe, scope change and resume. Optional `risk_events[]`, `risk_snapshot` (default `true`). Types `TokenRiskFilters`, `TokenRiskAuthorityChangedEvent`, `TokenRiskSupplyInflatedEvent`, `TokenRiskInputsSnapshot`.
1363
+ - **`wallet:scores`** — `filters.wallets` (REQUIRED, base58). `deployer:tier_changed` (`DeployerTierChangedEvent`; `entered_ranking: true` when a wallet leaves `unranked`) and `kol:score_state_changed` (`is_cold` / `is_heating_up` / `auto_strategy_tag`, `KolScoreStateChangedEvent`). Every frame carries `computed_at` + `source` (`live_write` / `scheduled_recompute` / `matview_refresh`): "recomputed at T", not "changed at T". Optional `score_events[]`.
1364
+
1365
+ ```ts
1366
+ const stream = client.stream.connect();
1367
+ stream.subscribe({ subId: "candles", channels: ["token:candles"], filters: { mints: [MINT], updates: true } });
1368
+ stream.subscribe({ subId: "risk", channels: ["token:risk"], filters: { mints: [MINT] } });
1369
+ stream.subscribe({ subId: "scores", channels: ["wallet:scores"], filters: { wallets: [DEPLOYER] } });
1370
+ stream.on("candle:closed", (c: TokenCandleClosedEvent) => console.log(c.bucket_start, c.open_price_usd, c.close_price_usd, c.volume_usd));
1371
+ stream.on("risk:authority_changed", (e: TokenRiskAuthorityChangedEvent) => console.log(e.mint, e.field, e.before, "→", e.after));
1372
+ stream.on("deployer:tier_changed", (e: DeployerTierChangedEvent) => console.log(e.wallet, e.tier_before, "→", e.tier_after, e.source));
1373
+ ```
1374
+
1347
1375
  #### `client.stream.sessions()` / `client.stream.deleteSession(id)` *(new in 2.17 — PRO+)*
1348
1376
 
1349
1377
  Audit and evict your **live** WebSocket sessions across the KOL/deployer (`ws-streaming`) and all-DEX (`dex-stream`) services. `sessions()` lists each open connection; `deleteSession(id)` force-closes one — handy for freeing a connection slot held by a ghost/stale socket after a network drop.
@@ -1400,6 +1428,16 @@ ws.on("message", (raw) => {
1400
1428
  });
1401
1429
  ```
1402
1430
 
1431
+ #### Liquidity events — `dex:liquidity` *(server 2026-09-23)*
1432
+
1433
+ Add `liquidity: true` (in addition to trades) or `liquidity: "only"` to a subscribe for one `dex:liquidity` frame per liquidity instruction: `action` `pool_created` | `add` | `remove`, `id` = `<signature>:<ix>[.<inner>]`, `pool`, `mints[]` (raw `amount_raw`, `side` in/out), `reserves_before[]` / `reserves_after[]`, `share_of_reserves` (constant-product only), `material` (a removal of ≥ 25 % of reserves), `depth_effect`. Filters `pool(s)`, `actions[]`, `min_share_of_reserves`, `material_only`. Only fixture-verified instructions are emitted; concentrated pools report share/depth as unknown; DAMM v1, LaunchLab and Moonshot are not emitted; no USD field (`min_usd` is rejected); ring replay only.
1434
+
1435
+ ```ts
1436
+ ws.send(JSON.stringify({ type: "subscribe", sub_id: "lp-pulls", liquidity: "only",
1437
+ filters: { dex: ["raydium", "pumpswap", "meteora"], actions: ["remove"], material_only: true } }));
1438
+ // → { channel: "dex:liquidity", sub_id: "lp-pulls", id, data: { action, pool, mints, share_of_reserves, material, ... } }
1439
+ ```
1440
+
1403
1441
  #### Protocol — client → server
1404
1442
 
1405
1443
  | `type` | Required fields | Notes |
package/dist/index.d.ts CHANGED
@@ -2055,7 +2055,9 @@ export interface TokenUnlocksResponse {
2055
2055
  * lock-tracker the moment a NEW contract's account is first seen (~seconds after
2056
2056
  * the create tx). A compact writer payload, NOT the full live-derived REST row:
2057
2057
  * poll GET /tokens/{mint}/locks for the live state. Updates (claims / cancels /
2058
- * closes) are NOT pushed.
2058
+ * closes) are NOT pushed on a plain subscription — since 2026-09-23 they are
2059
+ * opt-in lifecycle events on the same channel (`filters.lifecycle: true`, see
2060
+ * {@link TokenLockLifecycleFilters} / {@link TokenLockLifecycleEvent}).
2059
2061
  */
2060
2062
  export interface TokenLockStreamEvent {
2061
2063
  lock_account: string;
@@ -2076,6 +2078,361 @@ export interface TokenLockStreamEvent {
2076
2078
  slot: number | null;
2077
2079
  created_at: string;
2078
2080
  }
2081
+ /** Lifecycle event names delivered on `token:locks` to a subscription with `filters.lifecycle: true`. */
2082
+ export type TokenLockLifecycleEventName = "token:lock_claimed" | "token:lock_cancelled" | "token:lock_closed" | "token:lock_updated" | "token:unlock_upcoming" | "token:unlock_available";
2083
+ /** Kind of unlock instant a schedule event describes. */
2084
+ export type TokenUnlockKind = "cliff" | "period" | "final" | "tranche";
2085
+ /**
2086
+ * Subscribe filters that switch `token:locks` to lifecycle mode. Without
2087
+ * `lifecycle: true` the channel carries only the `token:lock` create event,
2088
+ * byte-identical. Per (named) subscription, AND-combined; a malformed value
2089
+ * refuses the channel (`channels_rejected`) or the update (`invalid_filters`).
2090
+ */
2091
+ export interface TokenLockLifecycleFilters {
2092
+ lifecycle: true;
2093
+ /** Subset of the lifecycle event names. Create events always pass. */
2094
+ events?: TokenLockLifecycleEventName[];
2095
+ /** Narrows schedule events only. */
2096
+ unlock_kinds?: TokenUnlockKind[];
2097
+ /** Default false: Streamflow keeper-cranked withdrawals (~90 % of claims) are hidden unless true. */
2098
+ include_automatic_claims?: boolean;
2099
+ /** Token scope for creates AND lifecycle (≤ 500); applied only with `lifecycle: true`. */
2100
+ mints?: string[];
2101
+ }
2102
+ /** Fields every Solana lifecycle event carries. Frame `id` = `<event>:<event_key>`. */
2103
+ export interface TokenLockLifecycleBase {
2104
+ event_key: string;
2105
+ lock_account: string;
2106
+ mint: string;
2107
+ program: TokenLockProgram;
2108
+ /** Null on schedule events. */
2109
+ slot: number | null;
2110
+ observed_at: string | null;
2111
+ decimals?: number | null;
2112
+ }
2113
+ /** `token:lock_claimed` — withdrawn increased since the tracker's last observed state. */
2114
+ export interface TokenLockClaimedEvent extends TokenLockLifecycleBase {
2115
+ claimed_raw: string;
2116
+ withdrawn_raw: string;
2117
+ remaining_raw: string;
2118
+ partial: boolean;
2119
+ automatic_withdrawal: boolean | null;
2120
+ before: {
2121
+ withdrawn_raw: string;
2122
+ };
2123
+ after: {
2124
+ withdrawn_raw: string;
2125
+ };
2126
+ tx_signature: string | null;
2127
+ }
2128
+ /** `token:lock_cancelled`. */
2129
+ export interface TokenLockCancelledEvent extends TokenLockLifecycleBase {
2130
+ cancelled_at: string;
2131
+ withdrawn_raw: string | null;
2132
+ amount_raw: string | null;
2133
+ before: {
2134
+ cancelled_at: null;
2135
+ status: TokenLockStatus | null;
2136
+ };
2137
+ after: {
2138
+ cancelled_at: string;
2139
+ status: TokenLockStatus | null;
2140
+ };
2141
+ tx_signature: string | null;
2142
+ }
2143
+ /** `token:lock_closed` — Streamflow `closed` flag, or the account closed on chain. */
2144
+ export interface TokenLockClosedEvent extends TokenLockLifecycleBase {
2145
+ reason: "closed_flag" | "account_closed";
2146
+ withdrawn_raw?: string | null;
2147
+ amount_raw?: string | null;
2148
+ before: {
2149
+ status: TokenLockStatus | null;
2150
+ };
2151
+ after: {
2152
+ status: "closed";
2153
+ };
2154
+ tx_signature: string | null;
2155
+ }
2156
+ /** `token:lock_updated` — one event per change; `before` / `after` hold only the changed fields. */
2157
+ export interface TokenLockUpdatedEvent extends TokenLockLifecycleBase {
2158
+ change: "topup" | "extended" | "schedule_changed" | "recipient_changed";
2159
+ added_raw?: string;
2160
+ fields?: string[];
2161
+ before: Record<string, string | number | null>;
2162
+ after: Record<string, string | number | null>;
2163
+ tx_signature: string | null;
2164
+ }
2165
+ /**
2166
+ * `token:unlock_upcoming` (next unlock within 24 h) / `token:unlock_available`
2167
+ * (passed within the last 30 min — claimable PER THE SCHEDULE, NOT claimed).
2168
+ */
2169
+ export interface TokenUnlockScheduleEvent extends TokenLockLifecycleBase {
2170
+ unlock_at: string;
2171
+ unlock_kind: TokenUnlockKind;
2172
+ amount_raw: string | null;
2173
+ amount_reason: string | null;
2174
+ unlocked_total_raw: string | null;
2175
+ release_model: "periodic" | "continuous" | "tranched";
2176
+ claimable?: true;
2177
+ kind: TokenLockKind | null;
2178
+ sender: string | null;
2179
+ recipient: string | null;
2180
+ locked_amount_raw: string | null;
2181
+ withdrawn_raw: string | null;
2182
+ }
2183
+ /** Any lifecycle payload on `token:locks` — narrow on the frame's `event`. */
2184
+ export type TokenLockLifecycleEvent = TokenLockClaimedEvent | TokenLockCancelledEvent | TokenLockClosedEvent | TokenLockUpdatedEvent | TokenUnlockScheduleEvent;
2185
+ /**
2186
+ * `token:candles` subscribe filters (PRO+). `mints` is REQUIRED (base58) and
2187
+ * capped per CONNECTION across named subscriptions — PRO 25 / ULTRA 100 /
2188
+ * BUSINESS 250, a budget separate from `token:prices`. Over the cap, a missing
2189
+ * scope or a non-boolean `updates` rejects the channel, never truncates.
2190
+ */
2191
+ export interface TokenCandlesFilters {
2192
+ mints: string[];
2193
+ /** Also receive the in-progress minute as `candle:update` (a state stream). Default false. */
2194
+ updates?: boolean;
2195
+ }
2196
+ /**
2197
+ * `candle:closed` frame `data` on `token:candles` — the STORED 1-minute row
2198
+ * (`token_ohlc_1m`), identical live and on a durable resume. Every key is
2199
+ * always present (null when unknown). Frame id =
2200
+ * `candle:solana:<mint>:<bucket_start epoch s>` (not event-prefixed). A fully
2201
+ * flat zero-trade candle (o = h = l = c, trades 0) is never emitted.
2202
+ */
2203
+ export interface TokenCandleClosedEvent {
2204
+ chain: "solana";
2205
+ mint: string;
2206
+ bucket_start: string;
2207
+ /** bucket_start + 60 s. */
2208
+ bucket_end: string;
2209
+ /** When the row was first written (≈ ≤ 25 s after bucket_end). */
2210
+ closed_at: string | null;
2211
+ open_price_usd: number | null;
2212
+ high_price_usd: number | null;
2213
+ low_price_usd: number | null;
2214
+ close_price_usd: number | null;
2215
+ open_mc_usd: number | null;
2216
+ high_mc_usd: number | null;
2217
+ low_mc_usd: number | null;
2218
+ close_mc_usd: number | null;
2219
+ open_liquidity_usd: number | null;
2220
+ close_liquidity_usd: number | null;
2221
+ close_supply: number | null;
2222
+ volume_usd: number | null;
2223
+ volume_mev_usd: number | null;
2224
+ buy_volume_usd: number | null;
2225
+ sell_volume_usd: number | null;
2226
+ trades: number | null;
2227
+ buy_count: number | null;
2228
+ sell_count: number | null;
2229
+ dex: string | null;
2230
+ pool_address: string | null;
2231
+ write_id: string | null;
2232
+ final: true;
2233
+ source: "token_ohlc_1m";
2234
+ }
2235
+ /**
2236
+ * `candle:update` frame `data` (only with `filters.updates: true`) — the
2237
+ * producer's in-progress minute, ≤ 1 per mint per second. A state stream: no
2238
+ * id / seq, never replayed, no snapshot on subscribe.
2239
+ */
2240
+ export interface TokenCandleUpdateEvent {
2241
+ chain: "solana";
2242
+ mint: string;
2243
+ bucket_start: string;
2244
+ bucket_end: string;
2245
+ open_price_usd: number | null;
2246
+ high_price_usd: number | null;
2247
+ low_price_usd: number | null;
2248
+ close_price_usd: number | null;
2249
+ close_mc_usd: number | null;
2250
+ volume_usd: number | null;
2251
+ trades: number | null;
2252
+ final: false;
2253
+ /** The producer's timestamp of this state (ISO). */
2254
+ as_of: string | null;
2255
+ source: "mc-tracker:open_candle";
2256
+ }
2257
+ /** Event types on `token:risk`. */
2258
+ export type TokenRiskEventName = "risk:authority_changed" | "risk:supply_inflated";
2259
+ /**
2260
+ * `token:risk` subscribe filters (PRO+). `mints` is REQUIRED (base58), capped
2261
+ * per connection PRO 25 / ULTRA 100 / BUSINESS 250. Invalid values reject the
2262
+ * channel (`channels_rejected`) or the whole update (`invalid_filters`).
2263
+ */
2264
+ export interface TokenRiskFilters {
2265
+ mints: string[];
2266
+ /** Non-empty subset of the channel's event types. */
2267
+ risk_events?: TokenRiskEventName[];
2268
+ /** Send one `risk:inputs` snapshot per mint on subscribe / scope change / resume. Default true. */
2269
+ risk_snapshot?: boolean;
2270
+ }
2271
+ /**
2272
+ * `risk:authority_changed` — the stored mint / freeze authority went from not
2273
+ * revoked to revoked (once per mint + field, ever), or the Token-2022 transfer
2274
+ * fee changed with both values known. Never a re-enable, never a first
2275
+ * observation. Frame id = `risk:authority_changed:<event_key>`.
2276
+ */
2277
+ export interface TokenRiskAuthorityChangedEvent {
2278
+ chain: "solana";
2279
+ mint: string;
2280
+ /** `<mint>:mint_authority:revoked` | `<mint>:freeze_authority:revoked` | `<mint>:transfer_fee:<before>><after>:<observed_at ms>`. */
2281
+ event_key: string;
2282
+ field: "mint_authority" | "freeze_authority" | "transfer_fee";
2283
+ /** `{revoked}` for the authorities, `{transfer_fee_bps}` for the fee. */
2284
+ before: {
2285
+ revoked: boolean;
2286
+ } | {
2287
+ transfer_fee_bps: number;
2288
+ };
2289
+ after: {
2290
+ revoked: boolean;
2291
+ } | {
2292
+ transfer_fee_bps: number;
2293
+ };
2294
+ /** The full picture after the change. */
2295
+ mint_authority_revoked: boolean | null;
2296
+ freeze_authority_revoked: boolean | null;
2297
+ transfer_fee_bps: number | null;
2298
+ is_token_2022: boolean | null;
2299
+ /** When mc-tracker parsed the mint account that showed the change. */
2300
+ observed_at: string | null;
2301
+ /** The parse before: the change happened on chain in between. */
2302
+ previous_observed_at: string | null;
2303
+ written_at: string;
2304
+ slot: null;
2305
+ source: "token_prices";
2306
+ }
2307
+ /**
2308
+ * `risk:supply_inflated` — the first `supply_drift_events` row for the mint
2309
+ * reaching a level (warn 0.5 % / danger 5 %). Per-observation drift, not a
2310
+ * cumulative inflation. Frame id = `risk:supply_inflated:<event_key>`.
2311
+ */
2312
+ export interface TokenRiskSupplyInflatedEvent {
2313
+ chain: "solana";
2314
+ mint: string;
2315
+ /** `<mint>:supply_inflated:warn` | `<mint>:supply_inflated:danger`. */
2316
+ event_key: string;
2317
+ level: "warn" | "danger";
2318
+ /** 0.5 (warn) | 5 (danger). */
2319
+ threshold_pct: number;
2320
+ /** drift / expected of one drift row, in percent, 4 dp. */
2321
+ inflation_pct: number;
2322
+ /** Integer strings. */
2323
+ expected_supply_raw: string;
2324
+ onchain_supply_raw: string;
2325
+ drift_raw: string;
2326
+ detected_at: string;
2327
+ drift_event_id: number;
2328
+ window_days: 30;
2329
+ written_at: string;
2330
+ slot: null;
2331
+ source: "supply_drift_events";
2332
+ }
2333
+ /**
2334
+ * `risk:inputs` snapshot frame `data` (frame `snapshot: true`, no id / seq):
2335
+ * the CURRENT stored risk inputs of one scoped mint. Not the score or band —
2336
+ * `GET /tokens/{mint}/risk` computes those.
2337
+ */
2338
+ export interface TokenRiskInputsSnapshot {
2339
+ chain: "solana";
2340
+ mint: string;
2341
+ /** false = the mint is not in the price table (every input null). */
2342
+ tracked: boolean;
2343
+ mint_authority_revoked: boolean | null;
2344
+ freeze_authority_revoked: boolean | null;
2345
+ transfer_fee_bps: number | null;
2346
+ is_token_2022: boolean | null;
2347
+ authority_observed_at: string | null;
2348
+ /** Worst positive supply drift in the last 30 days; null when none. `level` null below 0.5 %. */
2349
+ supply_inflation: {
2350
+ inflation_pct: number;
2351
+ level: "warn" | "danger" | null;
2352
+ detected_at: string | null;
2353
+ window_days: 30;
2354
+ } | null;
2355
+ source: "token_prices+supply_drift_events";
2356
+ }
2357
+ /** Any event payload on `token:risk` — narrow on the frame's `event`. */
2358
+ export type TokenRiskEvent = TokenRiskAuthorityChangedEvent | TokenRiskSupplyInflatedEvent;
2359
+ /** Event types on `wallet:scores`. */
2360
+ export type WalletScoreEventName = "deployer:tier_changed" | "kol:score_state_changed";
2361
+ /**
2362
+ * `wallet:scores` subscribe filters (PRO+). `wallets` is REQUIRED — base58
2363
+ * deployer or KOL wallets — capped per connection per chain PRO 25 / ULTRA 100
2364
+ * / BUSINESS 250. A subscription that also holds `rhc:wallet_scores` may mix
2365
+ * in 0x addresses; an entry of a chain the subscription does not hold is refused.
2366
+ */
2367
+ export interface WalletScoresFilters {
2368
+ wallets: string[];
2369
+ /** Optional subset of the held channels' event types (e.g. `"rhc:deployer_tier_changed"` when mixing chains). */
2370
+ score_events?: Array<WalletScoreEventName | "rhc:deployer_tier_changed">;
2371
+ }
2372
+ /**
2373
+ * Where a score event came from. `computed_at` means "recomputed at T", not
2374
+ * "changed at T": `live_write` = a bond / deploy re-classified the deployer
2375
+ * (real time); `scheduled_recompute` = the 6-hourly stats worker (can lag the
2376
+ * stats by hours); `matview_refresh` = the KOL diff after each 10-min refresh.
2377
+ */
2378
+ export type WalletScoreSource = "live_write" | "scheduled_recompute" | "matview_refresh";
2379
+ /** Solana deployer tier values on `deployer:tier_changed`. */
2380
+ export type DeployerTierChangeValue = "elite" | "good" | "rising" | "moderate" | "cold" | "unranked";
2381
+ /**
2382
+ * `deployer:tier_changed` — `deployers.tier` changed. Frame id =
2383
+ * `deployer:tier_changed:<event_key>`. A wallet appearing is not an event;
2384
+ * entering a ranked tier is (`entered_ranking: true`, `tier_before: "unranked"`).
2385
+ */
2386
+ export interface DeployerTierChangedEvent {
2387
+ /** `<wallet>:<tier_before>><tier_after>:<txid>`. */
2388
+ event_key: string;
2389
+ chain: "solana";
2390
+ wallet: string;
2391
+ tier_before: DeployerTierChangeValue | null;
2392
+ tier_after: DeployerTierChangeValue | null;
2393
+ entered_ranking: boolean;
2394
+ is_tracked: boolean | null;
2395
+ /** As of the write. */
2396
+ stats: {
2397
+ total_tokens_deployed: number | null;
2398
+ total_bonded: number | null;
2399
+ instant_bonds: number | null;
2400
+ bonding_rate: number | null;
2401
+ recent_bond_rate: number | null;
2402
+ recent_outcomes: string | null;
2403
+ };
2404
+ computed_at: string;
2405
+ source: WalletScoreSource;
2406
+ }
2407
+ /** The categorical KOL score fields diffed on `kol:score_state_changed`. */
2408
+ export interface KolScoreState {
2409
+ is_cold: boolean | null;
2410
+ is_heating_up: boolean | null;
2411
+ auto_strategy_tag: KolStrategy | null;
2412
+ }
2413
+ /**
2414
+ * `kol:score_state_changed` — one event per KOL per `mv_kol_scores` refresh
2415
+ * where `is_cold`, `is_heating_up` or `auto_strategy_tag` differs (fields never
2416
+ * split). Frame id = `kol:score_state_changed:<event_key>`.
2417
+ */
2418
+ export interface KolScoreStateChangedEvent {
2419
+ /** `<wallet>:<computed_at epoch ms>`. */
2420
+ event_key: string;
2421
+ chain: "solana";
2422
+ wallet: string;
2423
+ kol_wallet_id: string | null;
2424
+ kol_name: string | null;
2425
+ /** All three for a KOL first seen after the seed. */
2426
+ changed: Array<keyof KolScoreState>;
2427
+ /** null for a first appearance. */
2428
+ before: KolScoreState | null;
2429
+ after: KolScoreState;
2430
+ computed_at: string;
2431
+ source: "matview_refresh";
2432
+ matview: "mv_kol_scores";
2433
+ }
2434
+ /** Any event payload on `wallet:scores` — narrow on the frame's `event`. */
2435
+ export type WalletScoreEvent = DeployerTierChangedEvent | KolScoreStateChangedEvent;
2079
2436
  /** pump.fun fee event types (`creator_claim` is excluded from the feed unless requested via `type=`). */
2080
2437
  export type TokenFeeEventType = "shares_created" | "shares_updated" | "shares_reset" | "distribution" | "social_pda_created" | "social_claim" | "creator_transferred" | "creator_claim";
2081
2438
  /** A shareholder on a SharingConfig: `{ address, share_bps }` (bps of the creator fee). */