@floorlaunchpad/sdk 0.3.2 → 0.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.
- package/CHANGELOG.md +66 -0
- package/README.md +14 -0
- package/dist/abi/evm.gen.js +1 -1
- package/dist/abi/solana.gen.js +1 -1
- package/dist/client/evm/index.js +16 -2
- package/dist/client/solana/index.js +19 -7
- package/dist/config/generated.js +26864 -402
- package/dist/config/registry.gen.js +33 -2
- package/dist/evm/chains.js +9 -1
- package/dist/evm/floor/abi.gen.js +1 -1
- package/dist/evm/floor/events.js +9 -1
- package/dist/evm/floor/legacy-events.js +25 -0
- package/dist/indexer/bodies.js +91 -17
- package/dist/indexer/client.js +34 -14
- package/dist/indexer/contract.js +132 -28
- package/dist/indexer/partners.js +3 -2
- package/dist/indexer/paths.js +61 -29
- package/dist/indexer/read.js +27 -15
- package/dist/indexer/search.js +130 -0
- package/dist/indexer/stack-edge.js +35 -0
- package/dist/indexer/stream.js +70 -23
- package/dist/math/v2/split.js +11 -3
- package/dist/solana/floor/events.js +1 -1
- package/dist/solana/floor/genesis.js +9 -3
- package/dist/solana/floor/instructions.js +14 -5
- package/dist/solana/floor/registry.js +4 -0
- package/dist/v2/solana.js +17 -2
- package/dist/v2/tx/solana.js +1 -1
- package/docs/bot.md +36 -1
- package/docs/cursor-pages.md +56 -0
- package/docs/floor-line.md +9 -4
- package/examples/floor-line.html +6 -6
- package/package.json +1 -1
- package/src/abi/evm.gen.ts +1 -1
- package/src/abi/solana.gen.ts +1 -1
- package/src/client/evm/index.ts +16 -2
- package/src/client/solana/index.ts +19 -7
- package/src/client/types.ts +1 -1
- package/src/config/generated.ts +26864 -402
- package/src/config/index.ts +9 -2
- package/src/config/registry.gen.ts +33 -2
- package/src/events/types.gen.ts +2 -1
- package/src/evm/chains.ts +9 -1
- package/src/evm/floor/abi.gen.ts +1 -1
- package/src/evm/floor/events.ts +11 -1
- package/src/evm/floor/legacy-events.ts +27 -0
- package/src/indexer/bodies.ts +99 -17
- package/src/indexer/client.ts +52 -30
- package/src/indexer/contract.ts +151 -29
- package/src/indexer/partners.ts +3 -2
- package/src/indexer/paths.ts +84 -29
- package/src/indexer/read.ts +33 -17
- package/src/indexer/search.ts +138 -0
- package/src/indexer/stack-edge.ts +46 -0
- package/src/indexer/stream.ts +78 -24
- package/src/math/v2/split.ts +11 -3
- package/src/solana/floor/events.ts +1 -1
- package/src/solana/floor/genesis.ts +8 -2
- package/src/solana/floor/instructions.ts +13 -5
- package/src/solana/floor/registry.ts +4 -0
- package/src/v2/solana.ts +20 -3
- package/src/v2/tx/solana.ts +1 -1
package/src/indexer/contract.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { Decoder } from "./decode.ts";
|
|
|
4
4
|
import { unknown } from "./decode.ts";
|
|
5
5
|
import * as B from "./bodies.ts";
|
|
6
6
|
import * as P from "./partners.ts";
|
|
7
|
-
import { FIRSTS_MAX, IDS_MAX, LAUNCHES_PAGE_MAX, LAUNCH_SORTS, STREAM_STATE_MAX } from "./paths.ts";
|
|
7
|
+
import { FIRSTS_MAX, IDS_MAX, INBOX_PAGE_DEFAULT, INBOX_PAGE_MAX, LAUNCHES_PAGE_DEFAULT, LAUNCHES_PAGE_MAX, LAUNCH_CURSOR_MAX, LAUNCH_SORTS, PRESET_FILTER_MAX, STREAM_STATE_MAX, WALLET_CURSOR_MAX, WALLET_PAGE_DEFAULT, WALLET_PAGE_MAX } from "./paths.ts";
|
|
8
|
+
import { SEARCH_PAGE_DEFAULT, SEARCH_PAGE_MAX, SEARCH_Q_MAX } from "./search.ts";
|
|
8
9
|
|
|
9
10
|
export const UNITS = {
|
|
10
11
|
site: "raw quote base units, token math units (6 dp), Q64.64 prices, unix s; bigint as decimal strings; USD as decimal strings",
|
|
@@ -68,6 +69,8 @@ export interface QueryKey {
|
|
|
68
69
|
readonly values?: readonly string[];
|
|
69
70
|
readonly min?: number;
|
|
70
71
|
readonly max?: number;
|
|
72
|
+
readonly item?: { readonly kind: "int"; readonly min: number; readonly max: number };
|
|
73
|
+
readonly without?: readonly string[];
|
|
71
74
|
readonly default?: string | number;
|
|
72
75
|
readonly required?: boolean;
|
|
73
76
|
}
|
|
@@ -79,7 +82,23 @@ export type Pagination =
|
|
|
79
82
|
|
|
80
83
|
| { readonly kind: "offset"; readonly limit: { readonly default: number; readonly max: number }; readonly total: "total" }
|
|
81
84
|
|
|
82
|
-
| {
|
|
85
|
+
| {
|
|
86
|
+
readonly kind: "cursor";
|
|
87
|
+
readonly limit: { readonly default: number; readonly max: number };
|
|
88
|
+
readonly cursor: "before";
|
|
89
|
+
readonly next: "next";
|
|
90
|
+
|
|
91
|
+
readonly optIn?: { readonly default: number; readonly max: number };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
| {
|
|
95
|
+
readonly kind: "keyset";
|
|
96
|
+
readonly limit: { readonly default: number; readonly max: number };
|
|
97
|
+
readonly cursor: "cursor";
|
|
98
|
+
readonly next: "next";
|
|
99
|
+
|
|
100
|
+
readonly optIn?: true;
|
|
101
|
+
}
|
|
83
102
|
|
|
84
103
|
| { readonly kind: "range"; readonly from: string; readonly to: string; readonly span?: { readonly interval: string; readonly max: number } };
|
|
85
104
|
|
|
@@ -107,6 +126,15 @@ const limit = (dflt: number, max: number) => ({ kind: "limit", limit: { default:
|
|
|
107
126
|
const cursor = (dflt: number, max: number) => ({ kind: "cursor", limit: { default: dflt, max }, cursor: "before", next: "next" }) as const;
|
|
108
127
|
const LIMIT = (dflt: number, max: number): QueryKey => ({ kind: "int", doc: "rows", min: 1, max, default: dflt });
|
|
109
128
|
const BEFORE: QueryKey = { kind: "cursor", doc: "a block, or a row id <block>:<txnIndex>:<eventIndex> (a page's next): rows strictly before it" };
|
|
129
|
+
const keyset = (dflt: number, max: number) => ({ kind: "keyset", limit: { default: dflt, max }, cursor: "cursor", next: "next" }) as const;
|
|
130
|
+
const PRESETS: QueryKey = { kind: "list", doc: "only launches of these presets (ids 0..255)", max: PRESET_FILTER_MAX, item: { kind: "int", min: 0, max: 255 } } as const;
|
|
131
|
+
|
|
132
|
+
const WALLET_PAGE = { kind: "keyset", limit: { default: WALLET_PAGE_DEFAULT, max: WALLET_PAGE_MAX }, cursor: "cursor", next: "next", optIn: true } as const;
|
|
133
|
+
const WALLET_PAGE_KEYS = (cursorDoc: string): Record<string, QueryKey> => ({
|
|
134
|
+
limit: { kind: "int", doc: "rows (asks a page)", min: 1, max: WALLET_PAGE_MAX, default: WALLET_PAGE_DEFAULT },
|
|
135
|
+
cursor: { kind: "string", doc: `a page's next (asks a page): ${cursorDoc}`, max: WALLET_CURSOR_MAX },
|
|
136
|
+
});
|
|
137
|
+
const KEYSET_CURSOR = (without: readonly string[]): QueryKey => ({ kind: "string", doc: "a page's next: the rows after its last one (opaque)", max: LAUNCH_CURSOR_MAX, ...(without.length > 0 ? { without } : {}) });
|
|
110
138
|
const WINDOW: QueryKey = { kind: "enum", doc: "the volume window", values: B.TRADER_WINDOWS, default: "24h" };
|
|
111
139
|
|
|
112
140
|
const GATED = ["not_ready", "upstream"] as const;
|
|
@@ -142,7 +170,16 @@ export const INDEXER_CONTRACT = {
|
|
|
142
170
|
}),
|
|
143
171
|
quotes: site({ pattern: "/floor-amm/quotes", body: B.QUOTES }),
|
|
144
172
|
summary: site({ pattern: "/floor-amm/summary", aliases: ["/floor-amm/v2/summary"], body: B.SUMMARY }),
|
|
145
|
-
floorRouted: site({
|
|
173
|
+
floorRouted: site({
|
|
174
|
+
pattern: "/floor-amm/floor-routed",
|
|
175
|
+
aliases: ["/floor-amm/v2/floor-routed"],
|
|
176
|
+
query: {
|
|
177
|
+
limit: LIMIT(LAUNCHES_PAGE_DEFAULT, LAUNCHES_PAGE_MAX),
|
|
178
|
+
cursor: { kind: "string", doc: "a page's next: the launches after this launch id, in create order", max: LAUNCH_CURSOR_MAX },
|
|
179
|
+
},
|
|
180
|
+
page: keyset(LAUNCHES_PAGE_DEFAULT, LAUNCHES_PAGE_MAX),
|
|
181
|
+
body: B.FLOOR_ROUTED,
|
|
182
|
+
}),
|
|
146
183
|
events: site({
|
|
147
184
|
pattern: "/floor-amm/events",
|
|
148
185
|
aliases: ["/events", "/v2/dex/events"],
|
|
@@ -158,19 +195,38 @@ export const INDEXER_CONTRACT = {
|
|
|
158
195
|
query: {
|
|
159
196
|
sort: { kind: "enum", doc: "the order (larger first with order=desc)", values: LAUNCH_SORTS, default: "created" },
|
|
160
197
|
order: { kind: "enum", doc: "asc or desc", values: ["asc", "desc"], default: "desc" },
|
|
161
|
-
q: { kind: "string", doc: "name or symbol contains, or an id, token or creator equals" },
|
|
198
|
+
q: { kind: "string", doc: "name or symbol contains, or an id, token or creator equals", max: SEARCH_Q_MAX },
|
|
162
199
|
ids: { kind: "list", doc: "these launches (ids or tokens), in the order asked without sort", max: IDS_MAX },
|
|
163
200
|
quote: { kind: "string", doc: "launches quoted in this coin" },
|
|
164
201
|
creator: { kind: "string", doc: "launches by this creator" },
|
|
165
202
|
rankable: { kind: "bool", doc: "true (or 1) listed only, false (or 0) unlisted only" },
|
|
166
203
|
graduated: { kind: "bool", doc: "graduated or not (true / false, or 1 / 0)" },
|
|
167
|
-
|
|
168
|
-
|
|
204
|
+
preset: PRESETS,
|
|
205
|
+
limit: LIMIT(LAUNCHES_PAGE_DEFAULT, LAUNCHES_PAGE_MAX),
|
|
206
|
+
cursor: KEYSET_CURSOR(["offset", "ids"]),
|
|
207
|
+
offset: { kind: "int", doc: "rows skipped (with total: an offset page)", min: 0, default: 0 },
|
|
169
208
|
},
|
|
170
|
-
|
|
209
|
+
|
|
210
|
+
page: keyset(LAUNCHES_PAGE_DEFAULT, LAUNCHES_PAGE_MAX),
|
|
171
211
|
errors: [...GATED, "bad_query"],
|
|
172
212
|
body: B.LAUNCHES,
|
|
173
213
|
}),
|
|
214
|
+
search: site({
|
|
215
|
+
pattern: "/floor-amm/search",
|
|
216
|
+
v2: true,
|
|
217
|
+
query: {
|
|
218
|
+
q: { kind: "string", doc: "the search: symbol, name or token (tiers 0-4, search.ts)", required: true, max: SEARCH_Q_MAX },
|
|
219
|
+
limit: LIMIT(SEARCH_PAGE_DEFAULT, SEARCH_PAGE_MAX),
|
|
220
|
+
cursor: KEYSET_CURSOR([]),
|
|
221
|
+
rankable: { kind: "bool", doc: "true (or 1) listed only, false (or 0) unlisted only" },
|
|
222
|
+
graduated: { kind: "bool", doc: "graduated or not (true / false, or 1 / 0)" },
|
|
223
|
+
quote: { kind: "string", doc: "launches quoted in this coin" },
|
|
224
|
+
preset: PRESETS,
|
|
225
|
+
},
|
|
226
|
+
page: keyset(SEARCH_PAGE_DEFAULT, SEARCH_PAGE_MAX),
|
|
227
|
+
errors: [...GATED, "bad_query"],
|
|
228
|
+
body: B.LAUNCH_SEARCH,
|
|
229
|
+
}),
|
|
174
230
|
launch: site({ pattern: "/floor-amm/launches/<launch>", v2: true, errors: LAUNCH_ERR, body: B.LAUNCH_ONE }),
|
|
175
231
|
launchState: site({ pattern: "/floor-amm/launches/<launch>/state", v2: true, errors: ["not_ready", "unknown_launch"], body: B.LAUNCH_STATE }),
|
|
176
232
|
milestones: site({ pattern: "/floor-amm/launches/<launch>/milestones", v2: true, errors: LAUNCH_ERR, body: B.LAUNCH_MILESTONES }),
|
|
@@ -183,16 +239,16 @@ export const INDEXER_CONTRACT = {
|
|
|
183
239
|
errors: [...LAUNCH_ERR, "bad_query"],
|
|
184
240
|
body: B.TRADES,
|
|
185
241
|
}),
|
|
186
|
-
launchClaims: site({ pattern: "/floor-amm/launches/<launch>/claims", v2: true, query: { claimer: { kind: "string", doc: "only this claimer's rows" } }, errors: LAUNCH_ERR, body: B.LAUNCH_CLAIMS }),
|
|
187
|
-
devBuys: site({ pattern: "/floor-amm/launches/<launch>/dev-buys", v2: true, errors: LAUNCH_ERR, body: B.DEV_BUYS }),
|
|
242
|
+
launchClaims: site({ pattern: "/floor-amm/launches/<launch>/claims", v2: true, query: { limit: LIMIT(100, 500), before: BEFORE, claimer: { kind: "string", doc: "only this claimer's rows" } }, page: cursor(100, 500), errors: [...LAUNCH_ERR, "bad_query"], body: B.LAUNCH_CLAIMS }),
|
|
243
|
+
devBuys: site({ pattern: "/floor-amm/launches/<launch>/dev-buys", v2: true, query: { limit: LIMIT(100, 500), before: BEFORE }, page: cursor(100, 500), errors: [...LAUNCH_ERR, "bad_query"], body: B.DEV_BUYS }),
|
|
188
244
|
|
|
189
|
-
memberSold: site({ pattern: "/floor-amm/launches/<launch>/member-sold", v2: true, errors: LAUNCH_ERR, body: B.MEMBER_SOLD }),
|
|
245
|
+
memberSold: site({ pattern: "/floor-amm/launches/<launch>/member-sold", v2: true, query: { limit: LIMIT(100, 500), before: BEFORE }, page: cursor(100, 500), errors: [...LAUNCH_ERR, "bad_query"], body: B.MEMBER_SOLD }),
|
|
190
246
|
|
|
191
247
|
launchAccount: site({ pattern: "/floor-amm/launches/<launch>/account", v2: true, errors: LAUNCH_ERR, body: B.LAUNCH_ACCOUNT }),
|
|
192
248
|
traders: site({ pattern: "/floor-amm/launches/<launch>/traders", v2: true, query: { window: WINDOW, limit: LIMIT(100, 500) }, page: limit(100, 500), errors: [...LAUNCH_ERR, "bad_query"], body: B.LAUNCH_TRADERS }),
|
|
193
249
|
quoteChain: site({ pattern: "/floor-amm/launches/<launch>/chain", v2: true, errors: LAUNCH_ERR, body: B.QUOTE_CHAIN }),
|
|
194
250
|
devTrades: site({ pattern: "/floor-amm/launches/<launch>/dev", v2: true, query: { limit: LIMIT(100, 500) }, page: limit(100, 500), errors: [...LAUNCH_ERR, "bad_query"], body: B.DEV_TRADES }),
|
|
195
|
-
burns: site({ pattern: "/floor-amm/launches/<launch>/burns", v2: true, errors: LAUNCH_ERR, body: B.BURNS }),
|
|
251
|
+
burns: site({ pattern: "/floor-amm/launches/<launch>/burns", v2: true, query: { limit: LIMIT(100, 500), before: BEFORE }, page: cursor(100, 500), errors: [...LAUNCH_ERR, "bad_query"], body: B.BURNS }),
|
|
196
252
|
launchLocks: site({ pattern: "/floor-amm/launches/<launch>/locks", v2: true, errors: LAUNCH_ERR, body: B.LAUNCH_LOCKS }),
|
|
197
253
|
marks: site({
|
|
198
254
|
pattern: "/floor-amm/launches/<launch>/marks",
|
|
@@ -246,17 +302,44 @@ export const INDEXER_CONTRACT = {
|
|
|
246
302
|
errors: [...WALLET_ERR, "unknown_launch"],
|
|
247
303
|
body: B.WALLET_TRADES,
|
|
248
304
|
}),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
305
|
+
|
|
306
|
+
tonActivity: site({
|
|
307
|
+
pattern: "/floor-amm/wallets/<wallet>/ton-activity",
|
|
308
|
+
query: { limit: LIMIT(100, 200), before: BEFORE },
|
|
309
|
+
page: cursor(100, 200),
|
|
310
|
+
errors: WALLET_ERR,
|
|
311
|
+
body: B.TON_ACTIVITY,
|
|
312
|
+
}),
|
|
313
|
+
tonOutcome: site({
|
|
314
|
+
pattern: "/floor-amm/wallets/<wallet>/ton-outcome",
|
|
315
|
+
query: { queryId: { kind: "string", doc: "the query id (uint64, decimal) the SDK message carried", required: true } },
|
|
316
|
+
errors: WALLET_ERR,
|
|
317
|
+
body: B.TON_OUTCOME,
|
|
318
|
+
}),
|
|
319
|
+
|
|
320
|
+
positions: site({ pattern: "/floor-amm/wallets/<wallet>/positions", v2: true, query: WALLET_PAGE_KEYS("opaque, launch create order"), page: WALLET_PAGE, errors: WALLET_ERR, body: B.POSITIONS }),
|
|
321
|
+
|
|
322
|
+
inbox: site({
|
|
323
|
+
pattern: "/floor-amm/wallets/<wallet>/inbox",
|
|
324
|
+
v2: true,
|
|
325
|
+
query: { limit: LIMIT(1_000, 1_000), before: { kind: "cursor", doc: "asks a page: empty = the newest; a page's next (opaque): items strictly before it" } },
|
|
326
|
+
page: { kind: "cursor", limit: { default: 1_000, max: 1_000 }, cursor: "before", next: "next", optIn: { default: INBOX_PAGE_DEFAULT, max: INBOX_PAGE_MAX } },
|
|
327
|
+
errors: WALLET_ERR,
|
|
328
|
+
body: B.INBOX,
|
|
329
|
+
}),
|
|
330
|
+
walletLocks: site({ pattern: "/floor-amm/wallets/<wallet>/locks", v2: true, query: WALLET_PAGE_KEYS("opaque, launch create order"), page: WALLET_PAGE, errors: WALLET_ERR, body: B.WALLET_LOCKS }),
|
|
331
|
+
claimHistory: site({ pattern: "/floor-amm/wallets/<wallet>/claims", query: WALLET_PAGE_KEYS("opaque, newest first"), page: WALLET_PAGE, errors: WALLET_ERR, body: B.CLAIM_HISTORY }),
|
|
253
332
|
firsts: site({ pattern: "/floor-amm/wallets/<wallet>/firsts", errors: WALLET_ERR, body: B.FIRSTS }),
|
|
254
333
|
firstsMany: site({ pattern: "/floor-amm/wallets/firsts", query: { wallets: { kind: "list", doc: "the wallets", required: true, min: 1, max: FIRSTS_MAX } }, errors: WALLET_ERR, body: B.FIRSTS_MANY }),
|
|
255
|
-
claimView: site({ pattern: "/floor-amm/claims/<wallet>", errors: [...WALLET_ERR, "no_reader"], body: B.CLAIM_VIEW }),
|
|
256
|
-
people: site({ pattern: "/floor-amm/referrals/<wallet>/people", errors: WALLET_ERR, body: B.PEOPLE }),
|
|
257
|
-
roles: site({ pattern: "/floor-amm/roles/<wallet>", errors: WALLET_ERR, body: B.ROLES }),
|
|
334
|
+
claimView: site({ pattern: "/floor-amm/claims/<wallet>", query: WALLET_PAGE_KEYS("a page's next: the last row key (l:<launch>, r:<account>, p:<traderRef>, o:<quote>), string order"), page: WALLET_PAGE, errors: [...WALLET_ERR, "bad_query", "no_reader"], body: B.CLAIM_VIEW }),
|
|
335
|
+
people: site({ pattern: "/floor-amm/referrals/<wallet>/people", query: WALLET_PAGE_KEYS("opaque, referred wallet order"), page: WALLET_PAGE, errors: WALLET_ERR, body: B.PEOPLE }),
|
|
336
|
+
roles: site({ pattern: "/floor-amm/roles/<wallet>", query: WALLET_PAGE_KEYS("opaque, a page of launches in create order"), page: WALLET_PAGE, errors: WALLET_ERR, body: B.ROLES }),
|
|
258
337
|
|
|
259
|
-
handlePlaces: site({
|
|
338
|
+
handlePlaces: site({
|
|
339
|
+
pattern: "/floor-amm/handles/<handle>/places",
|
|
340
|
+
query: { limit: LIMIT(100, 500), cursor: { kind: "string", doc: "a page's next: <launch>:<place>, rows strictly after it", max: WALLET_CURSOR_MAX } },
|
|
341
|
+
page: keyset(100, 500),
|
|
342
|
+
errors: WALLET_ERR, body: B.HANDLE_PLACES }),
|
|
260
343
|
|
|
261
344
|
traderBoard: site({ pattern: "/floor-amm/leaderboards/traders", v2: true, query: { window: WINDOW, limit: LIMIT(100, 500) }, page: limit(100, 500), errors: [...GATED, "bad_query"], body: B.TRADER_BOARD }),
|
|
262
345
|
launcherBoard: site({ pattern: "/floor-amm/leaderboards/launchers", v2: true, query: { limit: LIMIT(100, 500) }, page: limit(100, 500), errors: [...GATED, "bad_query"], body: B.LAUNCHER_BOARD }),
|
|
@@ -281,12 +364,14 @@ export const INDEXER_CONTRACT = {
|
|
|
281
364
|
query: {
|
|
282
365
|
ticker_id: { kind: "string", doc: "<token>_<quote>", required: true },
|
|
283
366
|
type: { kind: "enum", doc: "one side only", values: ["buy", "sell"] },
|
|
284
|
-
limit: { kind: "int", doc: "rows per side (0: all)", min: 0 },
|
|
367
|
+
limit: { kind: "int", doc: "rows per side (absent: 500; 0: all, refused past 5000 rows in all: 413, page with before)", min: 0, max: 5000, default: 500 },
|
|
368
|
+
before: BEFORE,
|
|
285
369
|
start_time: { kind: "unix", doc: "from (10^11 and over: milliseconds)" },
|
|
286
370
|
end_time: { kind: "unix", doc: "to (10^11 and over: milliseconds)" },
|
|
287
371
|
},
|
|
288
|
-
|
|
289
|
-
|
|
372
|
+
|
|
373
|
+
page: cursor(500, 5000),
|
|
374
|
+
errors: [...GATED, "bad_query", "not_found", "too_many"],
|
|
290
375
|
body: P.CG_HISTORICAL,
|
|
291
376
|
}),
|
|
292
377
|
llamaTvl: partner({ pattern: "/v2/defillama/tvl", errors: GATED, body: P.LLAMA_TVL }),
|
|
@@ -344,7 +429,7 @@ export const OPEN_ROUTES = {
|
|
|
344
429
|
|
|
345
430
|
export function routeLimit(name: RouteName): { readonly default: number; readonly max: number } | null {
|
|
346
431
|
const p: Pagination = INDEXER_CONTRACT[name].page;
|
|
347
|
-
return p.kind === "limit" || p.kind === "offset" || p.kind === "cursor" ? p.limit : null;
|
|
432
|
+
return p.kind === "limit" || p.kind === "offset" || p.kind === "cursor" || p.kind === "keyset" ? p.limit : null;
|
|
348
433
|
}
|
|
349
434
|
|
|
350
435
|
export const LIMITS = Object.fromEntries(ROUTE_NAMES.flatMap((n) => {
|
|
@@ -352,9 +437,29 @@ export const LIMITS = Object.fromEntries(ROUTE_NAMES.flatMap((n) => {
|
|
|
352
437
|
return l === null ? [] : [[n, l]];
|
|
353
438
|
})) as Readonly<Partial<Record<RouteName, { readonly default: number; readonly max: number }>>>;
|
|
354
439
|
|
|
355
|
-
export function clampLimit(name: RouteName, n: number): number {
|
|
356
|
-
const
|
|
357
|
-
|
|
440
|
+
export function clampLimit(name: RouteName, n: number, paged = false): number {
|
|
441
|
+
const p: Pagination = INDEXER_CONTRACT[name].page;
|
|
442
|
+
const l = paged && p.kind === "cursor" && p.optIn !== undefined ? p.optIn : routeLimit(name);
|
|
443
|
+
|
|
444
|
+
const lo = (INDEXER_CONTRACT[name].query as Record<string, QueryKey>).limit?.min ?? 1;
|
|
445
|
+
return l === null ? n : Math.min(Math.max(lo, Math.trunc(n)), l.max);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export function pageAsked(name: RouteName, _q?: URLSearchParams | Record<string, unknown>): boolean {
|
|
449
|
+
const p: Pagination = INDEXER_CONTRACT[name].page;
|
|
450
|
+
|
|
451
|
+
if (p.kind === "cursor" && p.optIn !== undefined) return true;
|
|
452
|
+
if (p.kind === "keyset" && p.optIn === true) return true;
|
|
453
|
+
return false;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export function pageLimit(name: RouteName, q: URLSearchParams): number {
|
|
457
|
+
const p: Pagination = INDEXER_CONTRACT[name].page;
|
|
458
|
+
if (p.kind === "cursor" && p.optIn !== undefined) {
|
|
459
|
+
const raw = q.get("limit");
|
|
460
|
+
return raw === null || raw === "" || !DIGITS.test(raw) ? p.optIn.default : Math.min(Math.max(1, Number(raw)), p.optIn.max);
|
|
461
|
+
}
|
|
462
|
+
return queryLimit(name, q);
|
|
358
463
|
}
|
|
359
464
|
|
|
360
465
|
const DIGITS = /^\d+$/;
|
|
@@ -370,7 +475,11 @@ export function queryRefusal(name: RouteName, q: URLSearchParams): string | null
|
|
|
370
475
|
const spec: Readonly<Record<string, QueryKey>> = INDEXER_CONTRACT[name].query;
|
|
371
476
|
for (const [key, k] of Object.entries(spec)) {
|
|
372
477
|
const raw = q.get(key);
|
|
373
|
-
if (raw === null || raw === "")
|
|
478
|
+
if (raw === null || raw === "") {
|
|
479
|
+
if (k.required === true && TABLE_REQUIRED.has(name)) return `${key} is required`;
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
482
|
+
for (const w of k.without ?? []) if ((q.get(w) ?? "") !== "") return `${key} cannot be given with ${w}`;
|
|
374
483
|
switch (k.kind) {
|
|
375
484
|
case "int": {
|
|
376
485
|
const lo = k.min ?? 0;
|
|
@@ -379,10 +488,15 @@ export function queryRefusal(name: RouteName, q: URLSearchParams): string | null
|
|
|
379
488
|
break;
|
|
380
489
|
}
|
|
381
490
|
case "list": {
|
|
382
|
-
const
|
|
383
|
-
if (k.max !== undefined &&
|
|
491
|
+
const parts = raw.split(",").filter((s) => s !== "");
|
|
492
|
+
if (k.max !== undefined && parts.length > k.max) return `at most ${k.max} ${key}`;
|
|
493
|
+
const it = k.item;
|
|
494
|
+
if (it !== undefined && parts.some((x) => !DIGITS.test(x) || Number(x) < it.min || Number(x) > it.max)) return `each ${key} must be an integer ${it.min}..${it.max}`;
|
|
384
495
|
break;
|
|
385
496
|
}
|
|
497
|
+
case "string":
|
|
498
|
+
if (k.max !== undefined && raw.length > k.max) return `${key} must be at most ${k.max} characters`;
|
|
499
|
+
break;
|
|
386
500
|
case "enum":
|
|
387
501
|
if (k.values !== undefined && !k.values.includes(raw)) return `${key} must be one of ${k.values.join(", ")}`;
|
|
388
502
|
break;
|
|
@@ -393,9 +507,17 @@ export function queryRefusal(name: RouteName, q: URLSearchParams): string | null
|
|
|
393
507
|
break;
|
|
394
508
|
}
|
|
395
509
|
}
|
|
510
|
+
|
|
511
|
+
const pg: Pagination = INDEXER_CONTRACT[name].page;
|
|
512
|
+
if (pg.kind === "cursor" && pg.optIn !== undefined && q.get(pg.cursor) !== null) {
|
|
513
|
+
const raw = q.get("limit");
|
|
514
|
+
if (raw !== null && raw !== "" && Number(raw) > pg.optIn.max) return `limit must be 1..${pg.optIn.max} with ${pg.cursor}`;
|
|
515
|
+
}
|
|
396
516
|
return spanRefusal(name, q);
|
|
397
517
|
}
|
|
398
518
|
|
|
519
|
+
const TABLE_REQUIRED: ReadonlySet<RouteName> = new Set<RouteName>(["search"]);
|
|
520
|
+
|
|
399
521
|
const BOOLS: Readonly<Record<string, boolean>> = { true: true, false: false, 1: true, 0: false };
|
|
400
522
|
|
|
401
523
|
export function queryArg(name: RouteName, q: URLSearchParams, key: string): string | undefined {
|
package/src/indexer/partners.ts
CHANGED
|
@@ -50,7 +50,8 @@ export const DEX_SUMMARY = object({
|
|
|
50
50
|
export type DexSummary = Infer<typeof DEX_SUMMARY>;
|
|
51
51
|
|
|
52
52
|
export const DEX_PAIR = object({
|
|
53
|
-
pair: object({ id: str, asset0Id: str, asset1Id: str, createdAtBlockNumber: int, createdAtBlockTimestamp: int, feeBps: nullable(num) }),
|
|
53
|
+
pair: object({ id: str, asset0Id: str, asset1Id: str, createdAtBlockNumber: int, createdAtBlockTimestamp: int, feeBps: nullable(num), dexKey: str, createdAtTxnId: optional(str), creator: str }),
|
|
54
|
+
launch: optional(object({ id: str, token: str })),
|
|
54
55
|
});
|
|
55
56
|
export type DexPair = Infer<typeof DEX_PAIR>;
|
|
56
57
|
|
|
@@ -81,7 +82,7 @@ export type CgTickers = Infer<typeof CG_TICKERS>;
|
|
|
81
82
|
export const CG_TRADE = object({ trade_id: int, price: decimal, base_volume: decimal, target_volume: decimal, trade_timestamp: int, type: oneOf("buy", "sell") });
|
|
82
83
|
export type CgTrade = Infer<typeof CG_TRADE>;
|
|
83
84
|
|
|
84
|
-
export const CG_HISTORICAL = object({ buy: optional(array(CG_TRADE)), sell: optional(array(CG_TRADE)) });
|
|
85
|
+
export const CG_HISTORICAL = object({ buy: optional(array(CG_TRADE)), sell: optional(array(CG_TRADE)), next: optional(nullable(str)) });
|
|
85
86
|
export type CgHistorical = Infer<typeof CG_HISTORICAL>;
|
|
86
87
|
|
|
87
88
|
export const LLAMA_TVL = object({ mode: LIQUIDITY_MODE, tvl: record(big), launchTokens: array(str) });
|
package/src/indexer/paths.ts
CHANGED
|
@@ -11,22 +11,23 @@ export const INDEXER_ROUTES = {
|
|
|
11
11
|
stream: { pattern: "/floor-amm/stream", keys: ["launch", "state", "lastEventId"] },
|
|
12
12
|
quotes: { pattern: "/floor-amm/quotes", keys: [] },
|
|
13
13
|
summary: { pattern: "/floor-amm/summary", keys: [] },
|
|
14
|
-
floorRouted: { pattern: "/floor-amm/floor-routed", keys: [] },
|
|
14
|
+
floorRouted: { pattern: "/floor-amm/floor-routed", keys: ["limit", "cursor"] },
|
|
15
15
|
events: { pattern: "/floor-amm/events", keys: ["fromBlock", "toBlock"] },
|
|
16
|
-
launches: { pattern: "/floor-amm/launches", keys: ["sort", "order", "q", "ids", "quote", "creator", "rankable", "graduated", "limit", "offset"] },
|
|
16
|
+
launches: { pattern: "/floor-amm/launches", keys: ["sort", "order", "q", "ids", "quote", "creator", "rankable", "graduated", "preset", "limit", "cursor", "offset"] },
|
|
17
|
+
search: { pattern: "/floor-amm/search", keys: ["q", "limit", "cursor", "rankable", "graduated", "quote", "preset"] },
|
|
17
18
|
launch: { pattern: "/floor-amm/launches/<launch>", keys: [] },
|
|
18
19
|
launchState: { pattern: "/floor-amm/launches/<launch>/state", keys: [] },
|
|
19
20
|
milestones: { pattern: "/floor-amm/launches/<launch>/milestones", keys: [] },
|
|
20
21
|
holders: { pattern: "/floor-amm/launches/<launch>/holders", keys: ["limit"] },
|
|
21
22
|
trades: { pattern: "/floor-amm/launches/<launch>/trades", keys: ["limit", "before", "traders"] },
|
|
22
|
-
launchClaims: { pattern: "/floor-amm/launches/<launch>/claims", keys: ["claimer"] },
|
|
23
|
-
devBuys: { pattern: "/floor-amm/launches/<launch>/dev-buys", keys: [] },
|
|
24
|
-
memberSold: { pattern: "/floor-amm/launches/<launch>/member-sold", keys: [] },
|
|
23
|
+
launchClaims: { pattern: "/floor-amm/launches/<launch>/claims", keys: ["limit", "before", "claimer"] },
|
|
24
|
+
devBuys: { pattern: "/floor-amm/launches/<launch>/dev-buys", keys: ["limit", "before"] },
|
|
25
|
+
memberSold: { pattern: "/floor-amm/launches/<launch>/member-sold", keys: ["limit", "before"] },
|
|
25
26
|
launchAccount: { pattern: "/floor-amm/launches/<launch>/account", keys: [] },
|
|
26
27
|
traders: { pattern: "/floor-amm/launches/<launch>/traders", keys: ["window", "limit"] },
|
|
27
28
|
quoteChain: { pattern: "/floor-amm/launches/<launch>/chain", keys: [] },
|
|
28
29
|
devTrades: { pattern: "/floor-amm/launches/<launch>/dev", keys: ["limit"] },
|
|
29
|
-
burns: { pattern: "/floor-amm/launches/<launch>/burns", keys: [] },
|
|
30
|
+
burns: { pattern: "/floor-amm/launches/<launch>/burns", keys: ["limit", "before"] },
|
|
30
31
|
launchLocks: { pattern: "/floor-amm/launches/<launch>/locks", keys: [] },
|
|
31
32
|
marks: { pattern: "/floor-amm/launches/<launch>/marks", keys: ["limit", "before"] },
|
|
32
33
|
price: { pattern: "/floor-amm/launches/<launch>/price", keys: [] },
|
|
@@ -34,29 +35,44 @@ export const INDEXER_ROUTES = {
|
|
|
34
35
|
candleBundle: { pattern: "/floor-amm/launches/<launch>/candle-bundle", keys: ["intervals", "limit"] },
|
|
35
36
|
candles: { pattern: "/floor-amm/candles", keys: ["launch", "interval", "from", "to", "before", "limit"] },
|
|
36
37
|
walletTrades: { pattern: "/floor-amm/wallets/<wallet>/trades", keys: ["limit", "before", "launch"] },
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
tonActivity: { pattern: "/floor-amm/wallets/<wallet>/ton-activity", keys: ["limit", "before"] },
|
|
39
|
+
tonOutcome: { pattern: "/floor-amm/wallets/<wallet>/ton-outcome", keys: ["queryId"] },
|
|
40
|
+
positions: { pattern: "/floor-amm/wallets/<wallet>/positions", keys: ["limit", "cursor"] },
|
|
41
|
+
inbox: { pattern: "/floor-amm/wallets/<wallet>/inbox", keys: ["limit", "before"] },
|
|
42
|
+
walletLocks: { pattern: "/floor-amm/wallets/<wallet>/locks", keys: ["limit", "cursor"] },
|
|
43
|
+
claimHistory: { pattern: "/floor-amm/wallets/<wallet>/claims", keys: ["limit", "cursor"] },
|
|
41
44
|
firsts: { pattern: "/floor-amm/wallets/<wallet>/firsts", keys: [] },
|
|
42
45
|
firstsMany: { pattern: "/floor-amm/wallets/firsts", keys: ["wallets"] },
|
|
43
|
-
claimView: { pattern: "/floor-amm/claims/<wallet>", keys: [] },
|
|
44
|
-
people: { pattern: "/floor-amm/referrals/<wallet>/people", keys: [] },
|
|
45
|
-
roles: { pattern: "/floor-amm/roles/<wallet>", keys: [] },
|
|
46
|
-
handlePlaces: { pattern: "/floor-amm/handles/<handle>/places", keys: [] },
|
|
46
|
+
claimView: { pattern: "/floor-amm/claims/<wallet>", keys: ["limit", "cursor"] },
|
|
47
|
+
people: { pattern: "/floor-amm/referrals/<wallet>/people", keys: ["limit", "cursor"] },
|
|
48
|
+
roles: { pattern: "/floor-amm/roles/<wallet>", keys: ["limit", "cursor"] },
|
|
49
|
+
handlePlaces: { pattern: "/floor-amm/handles/<handle>/places", keys: ["limit", "cursor"] },
|
|
47
50
|
traderBoard: { pattern: "/floor-amm/leaderboards/traders", keys: ["window", "limit"] },
|
|
48
51
|
launcherBoard: { pattern: "/floor-amm/leaderboards/launchers", keys: ["limit"] },
|
|
49
52
|
} as const satisfies Record<string, IndexerRoute>;
|
|
50
53
|
|
|
51
54
|
export type IndexerRouteName = keyof typeof INDEXER_ROUTES;
|
|
52
55
|
|
|
53
|
-
export const LAUNCH_SORTS = ["created", "newest", "volume1h", "volume24h", "volume7d", "volume", "marketCap", "liquidity", "backed", "trades24h", "holders", "change1h", "change24h", "lastTrade", "nearFloor", "trending", "newHolders24h"] as const;
|
|
56
|
+
export const LAUNCH_SORTS = ["created", "newest", "volume1h", "volume24h", "volume7d", "volume", "marketCap", "liquidity", "backed", "trades24h", "holders", "change1h", "change24h", "lastTrade", "nearFloor", "trending", "newHolders24h", "standingVolume", "standingMarketCap", "standingBacked", "maxloss"] as const;
|
|
54
57
|
export type LaunchSort = (typeof LAUNCH_SORTS)[number];
|
|
55
58
|
|
|
56
59
|
export const IDS_MAX = 100;
|
|
57
60
|
|
|
58
61
|
export const LAUNCHES_PAGE_MAX = 1_000;
|
|
59
62
|
|
|
63
|
+
export const LAUNCHES_PAGE_DEFAULT = 100;
|
|
64
|
+
|
|
65
|
+
export const LAUNCH_CURSOR_MAX = 512;
|
|
66
|
+
|
|
67
|
+
export const WALLET_PAGE_DEFAULT = 100;
|
|
68
|
+
export const WALLET_PAGE_MAX = 500;
|
|
69
|
+
|
|
70
|
+
export const WALLET_CURSOR_MAX = 256;
|
|
71
|
+
export const INBOX_PAGE_DEFAULT = 100;
|
|
72
|
+
export const INBOX_PAGE_MAX = 500;
|
|
73
|
+
|
|
74
|
+
export const PRESET_FILTER_MAX = 16;
|
|
75
|
+
|
|
60
76
|
export const FIRSTS_MAX = 100;
|
|
61
77
|
|
|
62
78
|
export const STREAM_STATE_MAX = 16;
|
|
@@ -79,6 +95,8 @@ const need = (s: string): string => {
|
|
|
79
95
|
};
|
|
80
96
|
const seg = (s: string): string => encodeURIComponent(need(s));
|
|
81
97
|
|
|
98
|
+
const presets = (p: readonly number[] | undefined): readonly string[] | undefined => (p === undefined || p.length === 0 ? undefined : p.map(String));
|
|
99
|
+
|
|
82
100
|
const launchPath = (id: string, tail = ""): string => `/floor-amm/launches/${seg(id)}${tail}`;
|
|
83
101
|
const walletPath = (w: string, tail: string): string => `/floor-amm/wallets/${seg(w)}${tail}`;
|
|
84
102
|
|
|
@@ -94,10 +112,33 @@ export interface LaunchesQuery {
|
|
|
94
112
|
|
|
95
113
|
rankable?: boolean;
|
|
96
114
|
graduated?: boolean;
|
|
115
|
+
|
|
116
|
+
preset?: readonly number[];
|
|
117
|
+
|
|
97
118
|
limit?: number;
|
|
119
|
+
|
|
120
|
+
cursor?: string;
|
|
98
121
|
offset?: number;
|
|
99
122
|
}
|
|
100
123
|
|
|
124
|
+
export interface LaunchSearchQuery {
|
|
125
|
+
|
|
126
|
+
q: string;
|
|
127
|
+
|
|
128
|
+
limit?: number;
|
|
129
|
+
|
|
130
|
+
cursor?: string;
|
|
131
|
+
rankable?: boolean;
|
|
132
|
+
graduated?: boolean;
|
|
133
|
+
quote?: string;
|
|
134
|
+
preset?: readonly number[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface WalletPage {
|
|
138
|
+
limit?: number;
|
|
139
|
+
cursor?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
101
142
|
export interface Page {
|
|
102
143
|
limit?: number;
|
|
103
144
|
|
|
@@ -144,27 +185,33 @@ export const indexerPath = {
|
|
|
144
185
|
},
|
|
145
186
|
quotes: (): string => "/floor-amm/quotes",
|
|
146
187
|
summary: (): string => "/floor-amm/summary",
|
|
147
|
-
floorRouted: (): string =>
|
|
188
|
+
floorRouted: (q: { limit?: number; cursor?: string } = {}): string => `/floor-amm/floor-routed${query({ limit: q.limit, cursor: q.cursor })}`,
|
|
148
189
|
events: (fromBlock: number, toBlock: number): string => `/floor-amm/events${query({ fromBlock, toBlock })}`,
|
|
149
190
|
|
|
150
191
|
launches: (q: LaunchesQuery = {}): string => {
|
|
151
192
|
if (q.ids !== undefined && q.ids.length > IDS_MAX) throw new RangeError(`at most ${IDS_MAX} ids`);
|
|
152
193
|
const sort = q.sort ?? (q.ids === undefined ? "created" : undefined);
|
|
153
|
-
|
|
194
|
+
if (q.preset !== undefined && q.preset.length > PRESET_FILTER_MAX) throw new RangeError(`at most ${PRESET_FILTER_MAX} presets`);
|
|
195
|
+
return `/floor-amm/launches${query({ sort, order: q.order, q: q.q, ids: q.ids, quote: q.quote, creator: q.creator, rankable: q.rankable, graduated: q.graduated, preset: presets(q.preset), limit: q.limit, cursor: q.cursor, offset: q.offset })}`;
|
|
196
|
+
},
|
|
197
|
+
search: (q: LaunchSearchQuery): string => {
|
|
198
|
+
if (q.q.trim() === "") throw new RangeError("an empty search");
|
|
199
|
+
if (q.preset !== undefined && q.preset.length > PRESET_FILTER_MAX) throw new RangeError(`at most ${PRESET_FILTER_MAX} presets`);
|
|
200
|
+
return `/floor-amm/search${query({ q: q.q, limit: q.limit, cursor: q.cursor, rankable: q.rankable, graduated: q.graduated, quote: q.quote, preset: presets(q.preset) })}`;
|
|
154
201
|
},
|
|
155
202
|
launch: (id: string): string => launchPath(id),
|
|
156
203
|
launchState: (id: string): string => launchPath(id, "/state"),
|
|
157
204
|
milestones: (id: string): string => launchPath(id, "/milestones"),
|
|
158
205
|
holders: (id: string, q: { limit?: number } = {}): string => launchPath(id, `/holders${query({ limit: q.limit })}`),
|
|
159
206
|
trades: (id: string, q: TradesQuery = {}): string => launchPath(id, `/trades${query({ limit: q.limit, before: q.before, traders: q.traders?.length ? q.traders : undefined })}`),
|
|
160
|
-
launchClaims: (id: string, q: { claimer?: string } = {}): string => launchPath(id, `/claims${query({ claimer: q.claimer })}`),
|
|
161
|
-
devBuys: (id: string): string => launchPath(id,
|
|
162
|
-
memberSold: (id: string): string => launchPath(id,
|
|
207
|
+
launchClaims: (id: string, q: Page & { claimer?: string } = {}): string => launchPath(id, `/claims${query({ limit: q.limit, before: q.before, claimer: q.claimer })}`),
|
|
208
|
+
devBuys: (id: string, q: Page = {}): string => launchPath(id, `/dev-buys${query({ limit: q.limit, before: q.before })}`),
|
|
209
|
+
memberSold: (id: string, q: Page = {}): string => launchPath(id, `/member-sold${query({ limit: q.limit, before: q.before })}`),
|
|
163
210
|
launchAccount: (id: string): string => launchPath(id, "/account"),
|
|
164
211
|
traders: (id: string, q: { window?: "1h" | "24h" | "7d" | "all"; limit?: number } = {}): string => launchPath(id, `/traders${query({ window: q.window, limit: q.limit })}`),
|
|
165
212
|
quoteChain: (id: string): string => launchPath(id, "/chain"),
|
|
166
213
|
devTrades: (id: string, q: { limit?: number } = {}): string => launchPath(id, `/dev${query({ limit: q.limit })}`),
|
|
167
|
-
burns: (id: string): string => launchPath(id,
|
|
214
|
+
burns: (id: string, q: Page = {}): string => launchPath(id, `/burns${query({ limit: q.limit, before: q.before })}`),
|
|
168
215
|
launchLocks: (id: string): string => launchPath(id, "/locks"),
|
|
169
216
|
marks: (id: string, q: Page = {}): string => launchPath(id, `/marks${query({ limit: q.limit, before: q.before })}`),
|
|
170
217
|
price: (id: string): string => launchPath(id, "/price"),
|
|
@@ -178,19 +225,27 @@ export const indexerPath = {
|
|
|
178
225
|
return `/floor-amm/candles${query({ launch: need(q.launch), interval: q.interval, from: q.from, to: q.to, before: q.before, limit: q.limit })}`;
|
|
179
226
|
},
|
|
180
227
|
walletTrades: (w: string, q: WalletTradesQuery = {}): string => walletPath(w, `/trades${query({ limit: q.limit, before: q.before, launch: q.launch })}`),
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
228
|
+
|
|
229
|
+
tonActivity: (w: string, q: Page = {}): string => walletPath(w, `/ton-activity${query({ limit: q.limit, before: q.before })}`),
|
|
230
|
+
tonOutcome: (w: string, queryId: bigint | string): string => walletPath(w, `/ton-outcome${query({ queryId: String(queryId) })}`),
|
|
231
|
+
|
|
232
|
+
positions: (w: string, q: WalletPage = {}): string => walletPath(w, `/positions${query({ limit: q.limit, cursor: q.cursor })}`),
|
|
233
|
+
|
|
234
|
+
inbox: (w: string, q: { limit?: number; before?: string } = {}): string => walletPath(w, `/inbox${query({ limit: q.limit, before: q.before })}`),
|
|
235
|
+
walletLocks: (w: string, q: WalletPage = {}): string => walletPath(w, `/locks${query({ limit: q.limit, cursor: q.cursor })}`),
|
|
236
|
+
|
|
237
|
+
claimHistory: (w: string, q: WalletPage = {}): string => walletPath(w, `/claims${query({ limit: q.limit, cursor: q.cursor })}`),
|
|
185
238
|
firsts: (w: string): string => walletPath(w, "/firsts"),
|
|
186
239
|
firstsMany: (wallets: readonly string[]): string => {
|
|
187
240
|
if (wallets.length === 0 || wallets.length > FIRSTS_MAX) throw new RangeError(`1..${FIRSTS_MAX} wallets`);
|
|
188
241
|
return `/floor-amm/wallets/firsts${query({ wallets })}`;
|
|
189
242
|
},
|
|
190
|
-
claimView: (w: string): string => `/floor-amm/claims/${seg(w)}`,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
243
|
+
claimView: (w: string, q: WalletPage = {}): string => `/floor-amm/claims/${seg(w)}${query({ limit: q.limit, cursor: q.cursor })}`,
|
|
244
|
+
|
|
245
|
+
people: (w: string, q: WalletPage = {}): string => `/floor-amm/referrals/${seg(w)}/people${query({ limit: q.limit, cursor: q.cursor })}`,
|
|
246
|
+
|
|
247
|
+
roles: (w: string, q: WalletPage = {}): string => `/floor-amm/roles/${seg(w)}${query({ limit: q.limit, cursor: q.cursor })}`,
|
|
248
|
+
handlePlaces: (handle: string, q: WalletPage = {}): string => `/floor-amm/handles/${seg(handle)}/places${query({ limit: q.limit, cursor: q.cursor })}`,
|
|
194
249
|
traderBoard: (q: { window?: "1h" | "24h" | "7d" | "all"; limit?: number } = {}): string => `/floor-amm/leaderboards/traders${query({ window: q.window, limit: q.limit })}`,
|
|
195
250
|
launcherBoard: (q: { limit?: number } = {}): string => `/floor-amm/leaderboards/launchers${query({ limit: q.limit })}`,
|
|
196
251
|
} as const satisfies Record<IndexerRouteName, (...a: never[]) => string>;
|