madeonsol-x402 0.5.0 → 0.5.1
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 +36 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,6 +101,42 @@ const token = await rest.getStreamToken();
|
|
|
101
101
|
// token.dex_ws_url — all-DEX trade stream (Ultra only)
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
+
### DEX Firehose (Ultra)
|
|
105
|
+
|
|
106
|
+
Connect to `dex_ws_url` and use the multi-subscription protocol — up to **10 named subs per connection**, each with its own `sub_id`, server-side filters, and optional replay from a 500-trade in-memory ring buffer.
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import WebSocket from "ws";
|
|
110
|
+
|
|
111
|
+
const { dex_ws_url } = await rest.getStreamToken();
|
|
112
|
+
const ws = new WebSocket(dex_ws_url!);
|
|
113
|
+
|
|
114
|
+
ws.on("open", () => {
|
|
115
|
+
ws.send(JSON.stringify({
|
|
116
|
+
type: "subscribe",
|
|
117
|
+
sub_id: "fresh-pumpfun",
|
|
118
|
+
replay: 50, // up to 500 from ring buffer
|
|
119
|
+
filters: {
|
|
120
|
+
dex: "pumpfun", // pumpfun | pumpamm | pumpswap | raydium | jupiter | orca | meteora | launchlab
|
|
121
|
+
token_age_max_seconds: 300,
|
|
122
|
+
min_sol: 0.5,
|
|
123
|
+
action: "buy",
|
|
124
|
+
},
|
|
125
|
+
}));
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
ws.on("message", (raw) => {
|
|
129
|
+
const msg = JSON.parse(raw.toString());
|
|
130
|
+
if (msg.channel === "dex:trades") {
|
|
131
|
+
// { sub_id, data: { wallet, mint, action, sol_amount, dex, ... }, replay, ts }
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Operations** (all carry `sub_id`): `subscribe`, `update` (replace filters in place), `unsubscribe`, `list`, `ping`. **Filters:** `token_mint(s)` (≤50), `wallet(s)` (≤50), `dex`, `program`, `deployer_tier`, `token_age_max_seconds`, `market_cap_min/max_sol`, `min_sol`, `max_sol`, `action`. At least one targeting filter is required. Inbound rate limit: 5 messages/sec.
|
|
137
|
+
|
|
138
|
+
Full protocol reference: [madeonsol.com/api-docs#streaming](https://madeonsol.com/api-docs#streaming).
|
|
139
|
+
|
|
104
140
|
## Discovery
|
|
105
141
|
|
|
106
142
|
```ts
|