@floorlaunchpad/sdk 0.3.1 → 0.3.2
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/CHANGELOG.md +31 -0
- package/README.md +6 -5
- package/dist/evm/chains.js +1 -1
- package/dist/indexer/bodies.js +16 -0
- package/dist/indexer/client.js +3 -0
- package/dist/indexer/contract.js +8 -2
- package/dist/indexer/paths.js +6 -0
- package/dist/indexer/read.js +13 -0
- package/dist/v2/devbuy.js +15 -0
- package/docs/floor-line.md +203 -34
- package/examples/floor-line.html +373 -76
- package/package.json +1 -1
- package/src/evm/chains.ts +1 -1
- package/src/indexer/bodies.ts +19 -0
- package/src/indexer/client.ts +6 -0
- package/src/indexer/contract.ts +9 -3
- package/src/indexer/paths.ts +6 -0
- package/src/indexer/read.ts +13 -0
- package/src/v2/devbuy.ts +33 -0
package/examples/floor-line.html
CHANGED
|
@@ -3,102 +3,399 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<title>
|
|
6
|
+
<title>Show the FLOOR</title>
|
|
7
7
|
<style>
|
|
8
|
-
:root { --bg:#000000; --panel:#101113; --text:#F4F5F7; --muted:#
|
|
9
|
-
* { box-sizing:
|
|
10
|
-
body { margin:0; background:var(--bg); color:var(--text); font:15px/1.5 system-ui, sans-serif; }
|
|
11
|
-
main { max-width:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.
|
|
17
|
-
.
|
|
18
|
-
.
|
|
8
|
+
:root { --bg:#000000; --panel:#101113; --panel2:#16181B; --line:#23262B; --text:#F4F5F7; --muted:#8A94A3; --price:#8EA0BC; --floor:#FF6A1A; --up:#2EBD85; --down:#F6465D; }
|
|
9
|
+
* { box-sizing:border-box; }
|
|
10
|
+
body { margin:0; background:var(--bg); color:var(--text); font:15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
11
|
+
main { max-width:1180px; margin:0 auto; padding:28px 16px 64px; }
|
|
12
|
+
a { color:var(--floor); }
|
|
13
|
+
h1 { font-size:28px; line-height:1.2; margin:0 0 8px; letter-spacing:-0.01em; }
|
|
14
|
+
h1 em { font-style:normal; color:var(--floor); }
|
|
15
|
+
h2 { font-size:17px; margin:0 0 12px; }
|
|
16
|
+
.lede { color:var(--muted); max-width:760px; margin:0 0 24px; }
|
|
17
|
+
.lede b { color:var(--text); font-weight:600; }
|
|
18
|
+
.panel { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px; min-width:0; }
|
|
19
|
+
.layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:16px; }
|
|
20
|
+
@media (max-width:900px) { .layout { grid-template-columns:minmax(0,1fr); } }
|
|
21
|
+
|
|
22
|
+
/* the mock token page */
|
|
23
|
+
.tok { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
|
|
24
|
+
.ava { width:40px; height:40px; border-radius:50%; background:linear-gradient(135deg,#2a2d33,#4a505a); display:grid; place-items:center; font-weight:700; }
|
|
25
|
+
.name { font-weight:700; font-size:18px; }
|
|
26
|
+
.name small { color:var(--muted); font-weight:500; font-size:14px; }
|
|
27
|
+
.pill { font-size:12px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted); }
|
|
28
|
+
.pill.grad { color:var(--floor); border-color:rgba(255,106,26,.45); }
|
|
29
|
+
.stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:14px; }
|
|
30
|
+
@media (max-width:560px) { .stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
|
|
31
|
+
.stat { background:var(--panel2); border-radius:8px; padding:8px 10px; min-width:0; position:relative; }
|
|
32
|
+
.stat .k { font-size:12px; color:var(--muted); }
|
|
33
|
+
.stat .v { font-size:18px; font-weight:650; font-variant-numeric:tabular-nums; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
34
|
+
.stat.ask { outline:1px dashed rgba(255,106,26,.6); outline-offset:2px; }
|
|
35
|
+
.stat.ask .v { color:var(--floor); }
|
|
36
|
+
.tag { position:absolute; top:-9px; right:8px; font-size:10px; letter-spacing:.06em; text-transform:uppercase; background:var(--floor); color:#000; padding:0 6px; border-radius:4px; font-weight:700; }
|
|
37
|
+
.tag.bonus { background:var(--panel); color:var(--muted); border:1px solid var(--line); }
|
|
38
|
+
|
|
39
|
+
.bar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
|
|
40
|
+
.seg { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
|
|
41
|
+
.seg button { background:transparent; color:var(--muted); border:0; padding:5px 10px; font:inherit; font-size:13px; cursor:pointer; transition:color .15s, background .15s; }
|
|
42
|
+
.seg button[aria-pressed=true] { background:var(--panel2); color:var(--text); }
|
|
43
|
+
.legend { display:flex; gap:14px; font-size:13px; color:var(--muted); margin-left:auto; }
|
|
44
|
+
.legend span::before { content:""; display:inline-block; width:16px; height:2px; margin-right:6px; vertical-align:middle; background:currentColor; }
|
|
19
45
|
.legend .p { color:var(--price); } .legend .f { color:var(--floor); }
|
|
46
|
+
.chartwrap { position:relative; }
|
|
20
47
|
svg { width:100%; height:auto; display:block; }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.
|
|
48
|
+
.ask-chart { position:absolute; top:6px; left:8px; }
|
|
49
|
+
.replay { display:flex; gap:10px; align-items:center; margin-top:8px; }
|
|
50
|
+
.replay button { background:var(--panel2); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:5px 12px; font:inherit; font-size:13px; cursor:pointer; }
|
|
51
|
+
input[type=range] { flex:1; accent-color:var(--floor); }
|
|
52
|
+
.read { margin-top:6px; color:var(--muted); font-size:13px; min-height:1.5em; }
|
|
24
53
|
.read b { color:var(--text); font-weight:600; }
|
|
25
|
-
|
|
54
|
+
|
|
55
|
+
/* the ask */
|
|
56
|
+
.ask ol, .ask ul { margin:0 0 12px; padding-left:20px; }
|
|
57
|
+
.ask li { margin:4px 0; }
|
|
58
|
+
.ask .min li::marker { color:var(--floor); font-weight:700; }
|
|
59
|
+
.ask h3 { font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:14px 0 6px; }
|
|
60
|
+
.ask h3:first-of-type { margin-top:0; }
|
|
61
|
+
.swatch { display:inline-block; width:10px; height:10px; border-radius:2px; background:var(--floor); vertical-align:middle; margin-right:4px; }
|
|
62
|
+
.ask p { color:var(--muted); font-size:13px; margin:8px 0 0; }
|
|
63
|
+
|
|
64
|
+
/* code */
|
|
65
|
+
.code { margin-top:16px; }
|
|
66
|
+
.tabs { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:10px; }
|
|
67
|
+
.tabs button { background:transparent; border:1px solid var(--line); color:var(--muted); border-radius:8px; padding:5px 10px; font:inherit; font-size:13px; cursor:pointer; transition:color .15s, border-color .15s; }
|
|
68
|
+
.tabs button[aria-selected=true] { color:var(--text); border-color:var(--floor); }
|
|
69
|
+
.codebox { position:relative; background:#0A0B0C; border:1px solid var(--line); border-radius:8px; }
|
|
70
|
+
pre { margin:0; padding:14px; overflow:auto; font:13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space:pre; max-height:460px; }
|
|
71
|
+
.copy { position:absolute; top:8px; right:8px; background:var(--panel2); color:var(--text); border:1px solid var(--line); border-radius:6px; padding:3px 9px; font:inherit; font-size:12px; cursor:pointer; }
|
|
72
|
+
.note { color:var(--muted); font-size:13px; margin:8px 0 0; }
|
|
73
|
+
footer { color:var(--muted); font-size:13px; margin-top:24px; }
|
|
26
74
|
</style>
|
|
27
75
|
</head>
|
|
28
76
|
<body>
|
|
29
77
|
<main>
|
|
30
|
-
<h1>
|
|
31
|
-
<p class="
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
78
|
+
<h1>Show the <em>FLOOR</em> on your UI</h1>
|
|
79
|
+
<p class="lede">Every FLOOR launch has a floor: a price in its quote token that the program's own money stands behind, and that never falls. <b>We ask for two things: the FLOOR line on the chart and the FLOOR price on the token page.</b> Anything more is a bonus. It is a request, not a requirement, and it is highly appreciated. Below is what it looks like, then the code.</p>
|
|
80
|
+
|
|
81
|
+
<div class="layout">
|
|
82
|
+
<section class="panel" aria-label="Example token page">
|
|
83
|
+
<div class="tok">
|
|
84
|
+
<div class="ava" aria-hidden="true">D</div>
|
|
85
|
+
<div class="name">DEMO <small>/ USDC</small></div>
|
|
86
|
+
<span class="pill" id="phase">Bonding</span>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="stats">
|
|
89
|
+
<div class="stat"><div class="k">Price</div><div class="v" id="sPrice">–</div></div>
|
|
90
|
+
<div class="stat ask"><span class="tag">asked</span><div class="k">FLOOR</div><div class="v" id="sFloor">–</div></div>
|
|
91
|
+
<div class="stat"><span class="tag bonus">bonus</span><div class="k">Backed</div><div class="v" id="sBacked">–</div></div>
|
|
92
|
+
<div class="stat"><div class="k">Market cap</div><div class="v" id="sMcap">–</div></div>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="bar">
|
|
95
|
+
<div class="seg" role="group" aria-label="Chart units">
|
|
96
|
+
<button type="button" data-mode="price" aria-pressed="true">Price</button>
|
|
97
|
+
<button type="button" data-mode="mcap" aria-pressed="false">Market cap</button>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="legend"><span class="p">Price</span><span class="f">FLOOR</span></div>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="chartwrap">
|
|
102
|
+
<svg id="chart" viewBox="0 0 760 380" role="img" aria-label="Candles with the FLOOR line under them"></svg>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="replay">
|
|
105
|
+
<button type="button" id="play">Replay</button>
|
|
106
|
+
<input id="at" type="range" min="0" value="0" aria-label="Move through the launch">
|
|
107
|
+
</div>
|
|
37
108
|
<div class="read" id="read"></div>
|
|
38
|
-
</
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
109
|
+
</section>
|
|
110
|
+
|
|
111
|
+
<aside class="panel ask" aria-label="What we ask">
|
|
112
|
+
<h3>The minimum</h3>
|
|
113
|
+
<ol class="min">
|
|
114
|
+
<li><b>The FLOOR line on the price chart.</b> <span class="swatch"></span><code>#FF6A1A</code>, 2 px, a step line, labelled <code>FLOOR</code>, under the price.</li>
|
|
115
|
+
<li><b>The FLOOR price on the token page,</b> next to the price.</li>
|
|
116
|
+
</ol>
|
|
117
|
+
<h3>Bonus</h3>
|
|
118
|
+
<ul>
|
|
119
|
+
<li><code>% backed</code> (floor ÷ price)</li>
|
|
120
|
+
<li>A FLOOR column in lists and screeners</li>
|
|
121
|
+
<li>The FLOOR price in a wallet's holding row</li>
|
|
122
|
+
<li>An alert near the floor</li>
|
|
123
|
+
</ul>
|
|
124
|
+
<h3>Rules of thumb</h3>
|
|
125
|
+
<ul>
|
|
126
|
+
<li>No line before graduation. Never draw a missing floor as 0.</li>
|
|
127
|
+
<li>It only steps up, in the quote token.</li>
|
|
128
|
+
<li>Keep it after graduation: same program, same pair.</li>
|
|
129
|
+
<li>In market-cap mode, scale it by the same supply as the price.</li>
|
|
130
|
+
</ul>
|
|
131
|
+
<p>The full guide is <code>docs/floor-line.md</code>. Shipped it, or stuck? contact@floor.supply</p>
|
|
132
|
+
</aside>
|
|
59
133
|
</div>
|
|
134
|
+
|
|
135
|
+
<section class="panel code" aria-label="The code">
|
|
136
|
+
<h2>The code</h2>
|
|
137
|
+
<div class="tabs" role="tablist" id="tabs"></div>
|
|
138
|
+
<div class="codebox"><button type="button" class="copy" id="copy">Copy</button><pre id="code"></pre></div>
|
|
139
|
+
<p class="note" id="codenote"></p>
|
|
140
|
+
</section>
|
|
141
|
+
|
|
142
|
+
<footer id="run"></footer>
|
|
60
143
|
</main>
|
|
144
|
+
|
|
145
|
+
<script type="text/plain" id="c-api" data-label="Partner API" data-note="Server to server; ask for a key at contact@floor.supply. floorPriceQuote is null before graduation.">// 1. the FLOOR price for the token page
|
|
146
|
+
const H = { headers: { Authorization: `Bearer ${process.env.FLOOR_API_KEY}` } };
|
|
147
|
+
const API = "https://floor.supply/api/v1";
|
|
148
|
+
|
|
149
|
+
const { data: launch } = await (await fetch(`${API}/launches/${chain}/${token}`, H)).json();
|
|
150
|
+
const price = launch.market.priceQuote;
|
|
151
|
+
const floor = launch.market.floorPriceQuote; // null: no floor yet
|
|
152
|
+
const backed = launch.market.backedPct; // bonus: floor / price, in %
|
|
153
|
+
|
|
154
|
+
// 2. the history of the line: the floor after every trade
|
|
155
|
+
const { data: trades, meta } = await (await fetch(`${API}/launches/${chain}/${token}/trades?limit=100`, H)).json();
|
|
156
|
+
const floorPoints = trades
|
|
157
|
+
.filter((t) => t.floorPriceQuote !== null)
|
|
158
|
+
.map((t) => ({ time: t.time, value: t.floorPriceQuote }))
|
|
159
|
+
.reverse(); // oldest first
|
|
160
|
+
// older pages: ?before=${meta.nextBefore}</script>
|
|
161
|
+
|
|
162
|
+
<script type="text/plain" id="c-lwc" data-label="Lightweight Charts" data-note="lightweight-charts v5. LineType.WithSteps holds the floor between trades and steps it up at the trade that lifts it.">import { createChart, CandlestickSeries, LineSeries, LineType } from "lightweight-charts";
|
|
163
|
+
|
|
164
|
+
const chart = createChart(el, { autoSize: true });
|
|
165
|
+
const candles = chart.addSeries(CandlestickSeries);
|
|
166
|
+
const floorLine = chart.addSeries(LineSeries, {
|
|
167
|
+
color: "#FF6A1A",
|
|
168
|
+
lineWidth: 2,
|
|
169
|
+
lineType: LineType.WithSteps,
|
|
170
|
+
title: "FLOOR",
|
|
171
|
+
priceLineVisible: false,
|
|
172
|
+
lastValueVisible: true,
|
|
173
|
+
crosshairMarkerVisible: false,
|
|
174
|
+
autoscaleInfoProvider: () => null, // the floor never stretches the price scale
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
candles.setData(ohlc); // your candles
|
|
178
|
+
floorLine.setData(floorPoints); // [{ time, value }], none before graduation
|
|
179
|
+
|
|
180
|
+
// live, on each trade
|
|
181
|
+
if (trade.floorPriceQuote !== null) {
|
|
182
|
+
floorLine.update({ time: trade.time, value: trade.floorPriceQuote });
|
|
183
|
+
}</script>
|
|
184
|
+
|
|
185
|
+
<script type="text/plain" id="c-tv" data-label="TradingView" data-note="The Charting Library (Advanced Charts): a locked horizontal line at the current floor. For the full step history, plot the floor series as a custom indicator in the same style.">const chart = widget.activeChart();
|
|
186
|
+
|
|
187
|
+
const id = await chart.createShape(
|
|
188
|
+
{ price: floor },
|
|
189
|
+
{
|
|
190
|
+
shape: "horizontal_line",
|
|
191
|
+
lock: true,
|
|
192
|
+
disableSelection: true,
|
|
193
|
+
disableSave: true,
|
|
194
|
+
text: "FLOOR",
|
|
195
|
+
overrides: {
|
|
196
|
+
linecolor: "#FF6A1A",
|
|
197
|
+
linewidth: 2,
|
|
198
|
+
showLabel: true,
|
|
199
|
+
textcolor: "#FF6A1A",
|
|
200
|
+
showPrice: true,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
// when a trade lifts the floor
|
|
206
|
+
chart.getShapeById(id).setPoints([{ price: newFloor }]);</script>
|
|
207
|
+
|
|
208
|
+
<script type="text/plain" id="c-chain" data-label="From the chain" data-note="For indexers that read events themselves. sqrtF has 72 fraction bits; it is 0 before graduation. Keep the math in bigint: sqrtF squared does not fit in 128 bits.">// EVM: FloorAmm `Trade` event, field `sqrtF` (uint128)
|
|
209
|
+
// Solana: floor_amm `TradeV2` event (Anchor CPI event), field `sqrt_f` (u128)
|
|
210
|
+
//
|
|
211
|
+
// floor (whole quote per whole token) = sqrtF^2 * 10^6 / (2^144 * 10^quoteDecimals)
|
|
212
|
+
|
|
213
|
+
function floorOf(sqrtF, quoteDecimals) {
|
|
214
|
+
if (sqrtF === 0n) return null; // no floor yet
|
|
215
|
+
return Number((sqrtF * sqrtF * 10n ** 6n * 10n ** 12n) >> 144n) / 10 ** (quoteDecimals + 12);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// quoteDecimals: 6 for USDC, 9 for SOL, 18 for ETH
|
|
219
|
+
const floor = floorOf(BigInt(event.sqrtF), quoteDecimals);</script>
|
|
220
|
+
|
|
221
|
+
<script type="text/plain" id="c-svg" data-label="Plain SVG" data-note="What this page runs: walk the trades oldest first; hold the floor flat, then step up.">function floorPath(points, x, y) {
|
|
222
|
+
// points: [{ i, floor }] oldest first; floor null before graduation
|
|
223
|
+
let d = "", prev = null;
|
|
224
|
+
points.forEach((p, k) => {
|
|
225
|
+
if (p.floor === null) { prev = null; return; }
|
|
226
|
+
d += prev === null
|
|
227
|
+
? `M${x(k)},${y(p.floor)}`
|
|
228
|
+
: `L${x(k)},${y(prev)}L${x(k)},${y(p.floor)}`;
|
|
229
|
+
prev = p.floor;
|
|
230
|
+
});
|
|
231
|
+
return d; // <path d=... stroke="#FF6A1A" stroke-width="2" fill="none">
|
|
232
|
+
}</script>
|
|
233
|
+
|
|
234
|
+
<script type="text/plain" id="c-stat" data-label="Token page" data-note="The FLOOR price next to the price. Before graduation: FLOOR with a dash, or leave it out."><div class="stat">
|
|
235
|
+
<span class="label">FLOOR</span>
|
|
236
|
+
<span class="value" style="color:#FF6A1A">${fmt(floor)}</span>
|
|
237
|
+
<span class="note">${backed.toFixed(0)}% backed</span> <!-- bonus -->
|
|
238
|
+
</div></script>
|
|
239
|
+
|
|
61
240
|
<script>
|
|
62
|
-
const DATA = /*DATA*/{"run":"A simulated launch with a USDC quote at $1:
|
|
63
|
-
const
|
|
241
|
+
const DATA = /*DATA*/{"run":"A simulated launch with a USDC quote at $1: 74 buys and 8 sells","quoteDecimals":6,"series":[{"i":0,"price":0.01,"floor":null,"graduated":false,"side":"open"},{"i":1,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":2,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":3,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":4,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":5,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":6,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":7,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":8,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":9,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":10,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":11,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":12,"price":0.01,"floor":null,"graduated":false,"side":"buy"},{"i":13,"price":0.01022274,"floor":0.01,"graduated":true,"side":"buy"},{"i":14,"price":0.01045981,"floor":0.01,"graduated":true,"side":"buy"},{"i":15,"price":0.01069961,"floor":0.01,"graduated":true,"side":"buy"},{"i":16,"price":0.01092692,"floor":0.01,"graduated":true,"side":"buy"},{"i":17,"price":0.01110845,"floor":0.01,"graduated":true,"side":"buy"},{"i":18,"price":0.0112915,"floor":0.01,"graduated":true,"side":"buy"},{"i":19,"price":0.01147605,"floor":0.01,"graduated":true,"side":"buy"},{"i":20,"price":0.0116621,"floor":0.01,"graduated":true,"side":"buy"},{"i":21,"price":0.01184832,"floor":0.01,"graduated":true,"side":"buy"},{"i":22,"price":0.0119884,"floor":0.01,"graduated":true,"side":"buy"},{"i":23,"price":0.01212932,"floor":0.01,"graduated":true,"side":"buy"},{"i":24,"price":0.01227106,"floor":0.01,"graduated":true,"side":"buy"},{"i":25,"price":0.01284634,"floor":0.01,"graduated":true,"side":"buy"},{"i":26,"price":0.01329322,"floor":0.01,"graduated":true,"side":"buy"},{"i":27,"price":0.01373598,"floor":0.01030198,"graduated":true,"side":"buy"},{"i":28,"price":0.01414542,"floor":0.01060907,"graduated":true,"side":"buy"},{"i":29,"price":0.01448348,"floor":0.01086261,"graduated":true,"side":"buy"},{"i":30,"price":0.01482555,"floor":0.01111917,"graduated":true,"side":"buy"},{"i":31,"price":0.01517165,"floor":0.01137874,"graduated":true,"side":"buy"},{"i":32,"price":0.01545607,"floor":0.01159206,"graduated":true,"side":"buy"},{"i":33,"price":0.0157178,"floor":0.01178835,"graduated":true,"side":"buy"},{"i":34,"price":0.01598174,"floor":0.01198631,"graduated":true,"side":"buy"},{"i":35,"price":0.01624789,"floor":0.01218592,"graduated":true,"side":"buy"},{"i":36,"price":0.01651626,"floor":0.0123872,"graduated":true,"side":"buy"},{"i":37,"price":0.01674282,"floor":0.01255712,"graduated":true,"side":"buy"},{"i":38,"price":0.01694468,"floor":0.01270851,"graduated":true,"side":"buy"},{"i":39,"price":0.01714776,"floor":0.01286082,"graduated":true,"side":"buy"},{"i":40,"price":0.01735205,"floor":0.01301404,"graduated":true,"side":"buy"},{"i":41,"price":0.01755756,"floor":0.01316817,"graduated":true,"side":"buy"},{"i":42,"price":0.01776429,"floor":0.01332322,"graduated":true,"side":"buy"},{"i":43,"price":0.01797224,"floor":0.01347918,"graduated":true,"side":"buy"},{"i":44,"price":0.01815632,"floor":0.01361724,"graduated":true,"side":"buy"},{"i":45,"price":0.01831214,"floor":0.01373411,"graduated":true,"side":"buy"},{"i":46,"price":0.01846863,"floor":0.01385147,"graduated":true,"side":"buy"},{"i":47,"price":0.0186258,"floor":0.01396935,"graduated":true,"side":"buy"},{"i":48,"price":0.01878363,"floor":0.01408772,"graduated":true,"side":"buy"},{"i":49,"price":0.01859303,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":50,"price":0.01841113,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":51,"price":0.01823746,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":52,"price":0.01806707,"floor":0.01408772,"graduated":true,"side":"sell"},{"i":53,"price":0.01853992,"floor":0.01408772,"graduated":true,"side":"buy"},{"i":54,"price":0.01901433,"floor":0.01426075,"graduated":true,"side":"buy"},{"i":55,"price":0.01949479,"floor":0.0146211,"graduated":true,"side":"buy"},{"i":56,"price":0.01990367,"floor":0.01492776,"graduated":true,"side":"buy"},{"i":57,"price":0.02026771,"floor":0.01520078,"graduated":true,"side":"buy"},{"i":58,"price":0.02063506,"floor":0.0154763,"graduated":true,"side":"buy"},{"i":59,"price":0.02100574,"floor":0.0157543,"graduated":true,"side":"buy"},{"i":60,"price":0.02137974,"floor":0.0160348,"graduated":true,"side":"buy"},{"i":61,"price":0.02166974,"floor":0.01625231,"graduated":true,"side":"buy"},{"i":62,"price":0.02195119,"floor":0.01646339,"graduated":true,"side":"buy"},{"i":63,"price":0.02223446,"floor":0.01667585,"graduated":true,"side":"buy"},{"i":64,"price":0.02251957,"floor":0.01688968,"graduated":true,"side":"buy"},{"i":65,"price":0.0228065,"floor":0.01710487,"graduated":true,"side":"buy"},{"i":66,"price":0.02309526,"floor":0.01732144,"graduated":true,"side":"buy"},{"i":67,"price":0.02336672,"floor":0.01752504,"graduated":true,"side":"buy"},{"i":68,"price":0.02358335,"floor":0.01768751,"graduated":true,"side":"buy"},{"i":69,"price":0.02346715,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":70,"price":0.02335372,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":71,"price":0.02321907,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":72,"price":0.02307369,"floor":0.01768751,"graduated":true,"side":"sell"},{"i":73,"price":0.02335063,"floor":0.01768751,"graduated":true,"side":"buy"},{"i":74,"price":0.02356718,"floor":0.01768751,"graduated":true,"side":"buy"},{"i":75,"price":0.02378474,"floor":0.01783855,"graduated":true,"side":"buy"},{"i":76,"price":0.02400331,"floor":0.01800248,"graduated":true,"side":"buy"},{"i":77,"price":0.02422288,"floor":0.01816716,"graduated":true,"side":"buy"},{"i":78,"price":0.02444346,"floor":0.0183326,"graduated":true,"side":"buy"},{"i":79,"price":0.02466505,"floor":0.01849879,"graduated":true,"side":"buy"},{"i":80,"price":0.02488764,"floor":0.01866573,"graduated":true,"side":"buy"},{"i":81,"price":0.02511124,"floor":0.01883343,"graduated":true,"side":"buy"},{"i":82,"price":0.02533585,"floor":0.01900189,"graduated":true,"side":"buy"}]}/*END*/;
|
|
242
|
+
const SUPPLY = 1e9; // a FLOOR launch mints 1B tokens; market cap = price x total supply
|
|
64
243
|
const pts = DATA.series;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
244
|
+
|
|
245
|
+
/* ---------- the candles: three trades to a candle ---------- */
|
|
246
|
+
const PER = 3;
|
|
247
|
+
function candlesUpTo(n) {
|
|
248
|
+
const out = [];
|
|
249
|
+
for (let s = 1; s <= n; s += PER) {
|
|
250
|
+
const e = Math.min(s + PER - 1, n);
|
|
251
|
+
const seg = pts.slice(s, e + 1);
|
|
252
|
+
const open = pts[s - 1].price, close = seg[seg.length - 1].price;
|
|
253
|
+
const hi = Math.max(open, ...seg.map((p) => p.price)), lo = Math.min(open, ...seg.map((p) => p.price));
|
|
254
|
+
const fl = seg[seg.length - 1].floor;
|
|
255
|
+
out.push({ s, e, open, close, hi, lo, floor: fl });
|
|
256
|
+
}
|
|
257
|
+
return out;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* ---------- drawing ---------- */
|
|
261
|
+
const W = 760, H = 380, L = 8, R = 78, T = 34, B = 26;
|
|
69
262
|
const NS = "http://www.w3.org/2000/svg";
|
|
70
263
|
const svg = document.getElementById("chart");
|
|
71
|
-
const el = (tag, attrs, text) => { const e = document.createElementNS(NS, tag); for (const k in attrs) e.setAttribute(k, attrs[k]); if (text) e.textContent = text;
|
|
72
|
-
|
|
264
|
+
const el = (tag, attrs, text, parent = svg) => { const e = document.createElementNS(NS, tag); for (const k in attrs) e.setAttribute(k, attrs[k]); if (text != null) e.textContent = text; parent.appendChild(e); return e; };
|
|
265
|
+
let mode = "price";
|
|
266
|
+
const unit = (v) => (mode === "mcap" ? v * SUPPLY : v);
|
|
267
|
+
const fmtP = (v) => (v >= 1000 ? "$" + (v >= 1e6 ? (v / 1e6).toFixed(2) + "M" : (v / 1e3).toFixed(1) + "K") : "$" + v.toPrecision(4));
|
|
73
268
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
269
|
+
function floorPath(points, x, y) {
|
|
270
|
+
let d = "", prev = null;
|
|
271
|
+
points.forEach((p, k) => {
|
|
272
|
+
if (p.floor === null) { prev = null; return; }
|
|
273
|
+
d += prev === null ? `M${x(k)},${y(p.floor)}` : `L${x(k)},${y(prev)}L${x(k)},${y(p.floor)}`;
|
|
274
|
+
prev = p.floor;
|
|
275
|
+
});
|
|
276
|
+
return d;
|
|
78
277
|
}
|
|
79
|
-
el("text", { x: L, y: H - 6, fill: "#9AA3B2", "font-size": 11 }, "trades, in order");
|
|
80
|
-
// the price line, then the floor line under it (a step line: it holds between trades)
|
|
81
|
-
const priceD = pts.map((p, i) => `${i ? "L" : "M"}${x(i)},${y(p.price)}`).join("");
|
|
82
|
-
let floorD = "", pen = false, prev = null;
|
|
83
|
-
pts.forEach((p, i) => {
|
|
84
|
-
if (p.floor === null) { pen = false; return; }
|
|
85
|
-
floorD += pen ? `L${x(i)},${y(prev)}L${x(i)},${y(p.floor)}` : `M${x(i)},${y(p.floor)}`;
|
|
86
|
-
pen = true; prev = p.floor;
|
|
87
|
-
});
|
|
88
|
-
el("path", { d: priceD, fill: "none", stroke: "#8EA0BC", "stroke-width": 2 });
|
|
89
|
-
el("path", { d: floorD, fill: "none", stroke: "#FF6A1A", "stroke-width": 2 });
|
|
90
|
-
const last = pts[pts.length - 1];
|
|
91
|
-
el("text", { x: W - R - 4, y: y(last.floor) + 16, "text-anchor": "end", fill: "#FF6A1A", "font-size": 12 }, "FLOOR");
|
|
92
|
-
const mark = el("line", { y1: T, y2: H - B, stroke: "#F4F5F7", "stroke-opacity": 0.4 });
|
|
93
278
|
|
|
94
|
-
|
|
95
|
-
|
|
279
|
+
function draw(n) {
|
|
280
|
+
svg.textContent = "";
|
|
281
|
+
const cs = candlesUpTo(Math.max(n, 1));
|
|
282
|
+
const all = candlesUpTo(pts.length - 1);
|
|
283
|
+
const slots = all.length;
|
|
284
|
+
const cw = (W - L - R) / slots;
|
|
285
|
+
const xs = (k) => L + cw * (k + 0.5);
|
|
286
|
+
// the scale follows the candles only; the floor never stretches it
|
|
287
|
+
const lo = Math.min(...all.map((c) => c.lo)), hi = Math.max(...all.map((c) => c.hi));
|
|
288
|
+
const pad = (hi - lo) * 0.12;
|
|
289
|
+
const min = unit(lo - pad * 3), max = unit(hi + pad);
|
|
290
|
+
const y = (v) => T + (1 - (unit(v) - min) / (max - min)) * (H - T - B);
|
|
291
|
+
|
|
292
|
+
// grid and axis
|
|
293
|
+
for (let k = 0; k <= 4; k++) {
|
|
294
|
+
const v = min + ((max - min) * k) / 4;
|
|
295
|
+
const yy = T + (1 - k / 4) * (H - T - B);
|
|
296
|
+
el("line", { x1: L, x2: W - R, y1: yy, y2: yy, stroke: "#1B1E22" });
|
|
297
|
+
el("text", { x: W - R + 8, y: yy + 4, fill: "#8A94A3", "font-size": 11 }, fmtP(v));
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Bonding: the flat opening window, no floor yet
|
|
301
|
+
const gradK = all.findIndex((c) => c.floor !== null);
|
|
302
|
+
if (gradK > 0) {
|
|
303
|
+
el("rect", { x: L, y: T, width: cw * gradK, height: H - T - B, fill: "#16181B" });
|
|
304
|
+
el("text", { x: L + 8, y: H - B - 8, fill: "#8A94A3", "font-size": 11 }, "Bonding: no floor yet");
|
|
305
|
+
el("line", { x1: L + cw * gradK, x2: L + cw * gradK, y1: T, y2: H - B, stroke: "#FF6A1A", "stroke-opacity": 0.35, "stroke-dasharray": "3 4" });
|
|
306
|
+
el("text", { x: L + cw * gradK + 6, y: T + 12, fill: "#FF6A1A", "font-size": 11, "fill-opacity": 0.8 }, "Graduated: the floor starts");
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// candles
|
|
310
|
+
cs.forEach((c, k) => {
|
|
311
|
+
const up = c.close >= c.open, col = up ? "#2EBD85" : "#F6465D";
|
|
312
|
+
el("line", { x1: xs(k), x2: xs(k), y1: y(c.hi), y2: y(c.lo), stroke: col });
|
|
313
|
+
const top = y(Math.max(c.open, c.close)), bot = y(Math.min(c.open, c.close));
|
|
314
|
+
el("rect", { x: xs(k) - cw * 0.32, width: cw * 0.64, y: top, height: Math.max(1, bot - top), fill: col });
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// the FLOOR line: a step line under the price
|
|
318
|
+
const fp = cs.map((c) => ({ floor: c.floor }));
|
|
319
|
+
const d = floorPath(fp, (k) => L + cw * k, y);
|
|
320
|
+
const lastC = cs[cs.length - 1];
|
|
321
|
+
if (d) {
|
|
322
|
+
const path = el("path", { d: d + (lastC.floor !== null ? `L${L + cw * cs.length},${y(lastC.floor)}` : ""), fill: "none", stroke: "#FF6A1A", "stroke-width": 2 });
|
|
323
|
+
// the inline tag and the axis value
|
|
324
|
+
const fy = y(lastC.floor);
|
|
325
|
+
const ex = L + cw * cs.length;
|
|
326
|
+
el("rect", { x: ex - 52, y: fy - 9, width: 46, height: 16, fill: "#000" });
|
|
327
|
+
el("text", { x: ex - 29, y: fy + 4, fill: "#FF6A1A", "font-size": 11, "font-weight": 700, "text-anchor": "middle" }, "FLOOR");
|
|
328
|
+
el("rect", { x: W - R + 2, y: fy - 9, width: R - 4, height: 18, rx: 3, fill: "#FF6A1A" });
|
|
329
|
+
el("text", { x: W - R + 8, y: fy + 4, fill: "#000", "font-size": 11, "font-weight": 700 }, fmtP(unit(lastC.floor)));
|
|
330
|
+
}
|
|
331
|
+
// the last price on the axis
|
|
332
|
+
const py = y(lastC.close);
|
|
333
|
+
el("rect", { x: W - R + 2, y: py - 9, width: R - 4, height: 18, rx: 3, fill: "#8EA0BC" });
|
|
334
|
+
el("text", { x: W - R + 8, y: py + 4, fill: "#000", "font-size": 11, "font-weight": 700 }, fmtP(unit(lastC.close)));
|
|
335
|
+
// the ask marker
|
|
336
|
+
el("text", { x: L + 8, y: 18, fill: "#FF6A1A", "font-size": 11, "font-weight": 700 }, "ASKED: the FLOOR line");
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* ---------- the stats and the readout ---------- */
|
|
340
|
+
const $ = (id) => document.getElementById(id);
|
|
96
341
|
function show() {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
342
|
+
const n = +at.value, p = pts[n];
|
|
343
|
+
draw(n);
|
|
344
|
+
$("sPrice").textContent = fmtP(p.price);
|
|
345
|
+
$("sFloor").textContent = p.floor === null ? "—" : fmtP(p.floor);
|
|
346
|
+
$("sBacked").textContent = p.floor === null ? "—" : Math.round((100 * p.floor) / p.price) + "%";
|
|
347
|
+
$("sMcap").textContent = fmtP(p.price * SUPPLY);
|
|
348
|
+
const ph = $("phase");
|
|
349
|
+
ph.textContent = p.graduated ? "Graduated" : "Bonding";
|
|
350
|
+
ph.className = "pill" + (p.graduated ? " grad" : "");
|
|
351
|
+
let why = "";
|
|
352
|
+
if (p.floor === null) why = "Bonding sells at one flat price, so there is no floor and no line yet.";
|
|
353
|
+
else if (p.side === "sell") why = "A sell: the price comes down, the floor holds.";
|
|
354
|
+
else if (n > 0 && pts[n - 1].floor !== null && p.floor > pts[n - 1].floor) why = "A buy: part of its money joins the floor, which steps up.";
|
|
355
|
+
else why = "A buy: the floor holds until enough money has joined it to step up.";
|
|
356
|
+
$("read").innerHTML = `Trade ${n} of ${pts.length - 1} (${p.side}): price <b>${p.price}</b>` + (p.floor === null ? "" : `, FLOOR <b>${p.floor}</b>`) + ` USDC. ${why}`;
|
|
100
357
|
}
|
|
101
|
-
at
|
|
358
|
+
const at = $("at");
|
|
359
|
+
at.max = pts.length - 1; at.value = pts.length - 1;
|
|
360
|
+
at.addEventListener("input", show);
|
|
361
|
+
document.querySelectorAll(".seg button").forEach((b) => b.addEventListener("click", () => {
|
|
362
|
+
mode = b.dataset.mode;
|
|
363
|
+
document.querySelectorAll(".seg button").forEach((x) => x.setAttribute("aria-pressed", String(x === b)));
|
|
364
|
+
show();
|
|
365
|
+
}));
|
|
366
|
+
let timer = null;
|
|
367
|
+
$("play").addEventListener("click", () => {
|
|
368
|
+
if (timer) { clearInterval(timer); timer = null; $("play").textContent = "Replay"; return; }
|
|
369
|
+
at.value = 0; $("play").textContent = "Stop";
|
|
370
|
+
timer = setInterval(() => {
|
|
371
|
+
if (+at.value >= pts.length - 1) { clearInterval(timer); timer = null; $("play").textContent = "Replay"; return; }
|
|
372
|
+
at.value = +at.value + 1; show();
|
|
373
|
+
}, 90);
|
|
374
|
+
});
|
|
375
|
+
show();
|
|
376
|
+
|
|
377
|
+
/* ---------- the code tabs ---------- */
|
|
378
|
+
const blocks = [...document.querySelectorAll('script[type="text/plain"]')];
|
|
379
|
+
const tabs = $("tabs");
|
|
380
|
+
function pick(b) {
|
|
381
|
+
[...tabs.children].forEach((t) => t.setAttribute("aria-selected", String(t.dataset.id === b.id)));
|
|
382
|
+
const tmp = document.createElement("textarea"); tmp.innerHTML = b.textContent; // decode the HTML tab's entities
|
|
383
|
+
$("code").textContent = tmp.value.trim();
|
|
384
|
+
$("codenote").textContent = b.dataset.note;
|
|
385
|
+
}
|
|
386
|
+
blocks.forEach((b, i) => {
|
|
387
|
+
const t = document.createElement("button");
|
|
388
|
+
t.type = "button"; t.role = "tab"; t.dataset.id = b.id; t.textContent = b.dataset.label;
|
|
389
|
+
t.addEventListener("click", () => pick(b));
|
|
390
|
+
tabs.appendChild(t);
|
|
391
|
+
if (i === 0) pick(b);
|
|
392
|
+
});
|
|
393
|
+
$("copy").addEventListener("click", async () => {
|
|
394
|
+
try { await navigator.clipboard.writeText($("code").textContent); $("copy").textContent = "Copied"; } catch { $("copy").textContent = "Select and copy"; }
|
|
395
|
+
setTimeout(() => ($("copy").textContent = "Copy"), 1500);
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
$("run").textContent = DATA.run + ". The numbers come from the SDK's own math on a simulated launch, not from a live token.";
|
|
102
399
|
</script>
|
|
103
400
|
</body>
|
|
104
401
|
</html>
|
package/package.json
CHANGED
package/src/evm/chains.ts
CHANGED
|
@@ -133,7 +133,7 @@ export const FLOOR_SALTS = {
|
|
|
133
133
|
export const FLOOR_AMM_ADDRESS: string | null = "0xF10000bd05c2C01793C6d55F027346469683d225";
|
|
134
134
|
|
|
135
135
|
export const FLOOR_AMM_FROM_BLOCK: Readonly<Record<ChainKey, number | null>> = {
|
|
136
|
-
ethereum: 26327910, base: 53421827, bsc: 131270813, arbitrum: 520655168, arc: 29205598, robinhood: 104455459, hyperevm:
|
|
136
|
+
ethereum: 26327910, base: 53421827, bsc: 131270813, arbitrum: 520655168, arc: 29205598, robinhood: 104455459, hyperevm: 50398055,
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
const cat = (...h: string[]): string => "0x" + h.map((x) => bytesToHex(hexToBytes(x)).slice(2)).join("");
|
package/src/indexer/bodies.ts
CHANGED
|
@@ -130,6 +130,8 @@ export const LISTED_LAUNCH = object({
|
|
|
130
130
|
backedPpm: nullable(int),
|
|
131
131
|
volume24hUsd: nullable(decimal),
|
|
132
132
|
marketCapUsd: nullable(decimal),
|
|
133
|
+
|
|
134
|
+
trendingScore: nullable(big),
|
|
133
135
|
});
|
|
134
136
|
export type ListedLaunch = Infer<typeof LISTED_LAUNCH>;
|
|
135
137
|
|
|
@@ -273,6 +275,14 @@ export const LAUNCH_CLAIMS = object({ indexed, claims: array(LAUNCH_CLAIM) });
|
|
|
273
275
|
export const DEV_BUYS = object({ indexed, teamBuyUnlocked: bool, teamBuyUnlockedTs: nullable(int), devBuys: array(DEV_BUY) });
|
|
274
276
|
export type DevBuys = Infer<typeof DEV_BUYS>;
|
|
275
277
|
|
|
278
|
+
export const MEMBER_SOLD_ROW = object({ launch: str, member: str, place: int, amount: big, quoteOut: big, block: int, timestamp: int, tx: str, id: str });
|
|
279
|
+
export type MemberSoldRow = Infer<typeof MEMBER_SOLD_ROW>;
|
|
280
|
+
export const MEMBER_SOLD = object({ indexed, memberSold: array(MEMBER_SOLD_ROW) });
|
|
281
|
+
export type MemberSoldBody = Infer<typeof MEMBER_SOLD>;
|
|
282
|
+
|
|
283
|
+
export const LAUNCH_ACCOUNT = object({ indexed, launch: str, mint: str, slot: int, data: str });
|
|
284
|
+
export type LaunchAccountBody = Infer<typeof LAUNCH_ACCOUNT>;
|
|
285
|
+
|
|
276
286
|
export const CANDLE_INTERVALS = ["1s", "5s", "1m", "5m", "15m", "1h", "4h", "1d"] as const;
|
|
277
287
|
export type CandleInterval = (typeof CANDLE_INTERVALS)[number];
|
|
278
288
|
|
|
@@ -508,12 +518,21 @@ export const ROLES = object({
|
|
|
508
518
|
creatorOf: array(str),
|
|
509
519
|
creatorRefOf: array(object({ launch: str, tier: int })),
|
|
510
520
|
teamSlotOf: array(object({ launch: str, place: int })),
|
|
521
|
+
|
|
522
|
+
handleSlotOf: array(object({ launch: str, place: int, handle: str })),
|
|
511
523
|
holdings: array(object({ launch: str, token: str, amount: big })),
|
|
512
524
|
}),
|
|
513
525
|
claimed: record(big),
|
|
514
526
|
});
|
|
515
527
|
export type Roles = Infer<typeof ROLES>;
|
|
516
528
|
|
|
529
|
+
export const HANDLE_PLACES = object({
|
|
530
|
+
indexed,
|
|
531
|
+
handle: str,
|
|
532
|
+
places: array(object({ launch: str, place: int })),
|
|
533
|
+
});
|
|
534
|
+
export type HandlePlaces = Infer<typeof HANDLE_PLACES>;
|
|
535
|
+
|
|
517
536
|
export const TRADER_BOARD = object({
|
|
518
537
|
indexed,
|
|
519
538
|
window: oneOf(...TRADER_WINDOWS),
|
package/src/indexer/client.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface RouteArgs {
|
|
|
28
28
|
trades: L & TradesQuery;
|
|
29
29
|
launchClaims: L & { claimer?: string };
|
|
30
30
|
devBuys: L;
|
|
31
|
+
memberSold: L;
|
|
32
|
+
launchAccount: L;
|
|
31
33
|
traders: L & { window?: TraderWindow; limit?: number };
|
|
32
34
|
quoteChain: L;
|
|
33
35
|
devTrades: L & { limit?: number };
|
|
@@ -48,6 +50,7 @@ export interface RouteArgs {
|
|
|
48
50
|
claimView: W;
|
|
49
51
|
people: W;
|
|
50
52
|
roles: W;
|
|
53
|
+
handlePlaces: { handle: string };
|
|
51
54
|
traderBoard: { window?: TraderWindow; limit?: number } | void;
|
|
52
55
|
launcherBoard: { limit?: number } | void;
|
|
53
56
|
tokenHolders: { token: string; limit?: number; offset?: number };
|
|
@@ -83,6 +86,8 @@ export const routePath: { [N in RouteName]: (a: RouteArgs[N]) => string } = {
|
|
|
83
86
|
trades: ({ launch, ...q }) => indexerPath.trades(launch, q),
|
|
84
87
|
launchClaims: ({ launch, ...q }) => indexerPath.launchClaims(launch, q),
|
|
85
88
|
devBuys: (a) => indexerPath.devBuys(a.launch),
|
|
89
|
+
memberSold: (a) => indexerPath.memberSold(a.launch),
|
|
90
|
+
launchAccount: (a) => indexerPath.launchAccount(a.launch),
|
|
86
91
|
traders: ({ launch, ...q }) => indexerPath.traders(launch, q),
|
|
87
92
|
quoteChain: (a) => indexerPath.quoteChain(a.launch),
|
|
88
93
|
devTrades: ({ launch, ...q }) => indexerPath.devTrades(launch, q),
|
|
@@ -103,6 +108,7 @@ export const routePath: { [N in RouteName]: (a: RouteArgs[N]) => string } = {
|
|
|
103
108
|
claimView: (a) => indexerPath.claimView(a.wallet),
|
|
104
109
|
people: (a) => indexerPath.people(a.wallet),
|
|
105
110
|
roles: (a) => indexerPath.roles(a.wallet),
|
|
111
|
+
handlePlaces: (a) => indexerPath.handlePlaces(a.handle),
|
|
106
112
|
traderBoard: (a) => indexerPath.traderBoard(a ?? {}),
|
|
107
113
|
launcherBoard: (a) => indexerPath.launcherBoard(a ?? {}),
|
|
108
114
|
tokenHolders: (a) => `/floor-amm/holders/${encodeURIComponent(need(a.token, "token"))}${query({ limit: a.limit, offset: a.offset })}`,
|