@floorlaunchpad/sdk 0.6.0 → 0.8.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/CHANGELOG.md +279 -0
- package/README.md +12 -1
- package/dist/abi/evm-event-names.js +7 -0
- package/dist/abi/evm.gen.js +81 -2
- package/dist/abi/functions.gen.js +135 -1
- package/dist/abi/solana.gen.js +64 -0
- package/dist/client/solana/index.js +25 -6
- package/dist/config/generated.js +803 -26374
- package/dist/errors.js +21 -2
- package/dist/events/types.gen.js +1 -1
- package/dist/evm/chains.js +80 -0
- package/dist/evm/floor/abi.gen.js +115 -0
- package/dist/evm/floor/calls.js +5 -0
- package/dist/evm/squid.js +21 -5
- package/dist/evm/venues.js +302 -0
- package/dist/generated/interface.gen.js +93 -44
- package/dist/index.js +7 -0
- package/dist/indexer/bodies.js +288 -5
- package/dist/indexer/client.js +17 -1
- package/dist/indexer/contract.js +141 -15
- package/dist/indexer/paths.js +80 -7
- package/dist/indexer/read.js +25 -3
- package/dist/indexer/stream.js +2 -2
- package/dist/math/v2/book.js +24 -7
- package/dist/math/v2/create.js +1 -1
- package/dist/math/v2/escrow.js +205 -0
- package/dist/math/v2/fees.js +30 -4
- package/dist/math/v2/milestones.js +1 -1
- package/dist/math/v2/office.js +110 -0
- package/dist/math/v2/receipt.js +3 -3
- package/dist/math/v2/relay.js +263 -96
- package/dist/math/v2/rows.js +17 -0
- package/dist/math/v2/team.js +42 -1
- package/dist/math/v2/trade.js +3 -1
- package/dist/reprice.js +88 -0
- package/dist/route/quote.js +16 -0
- package/dist/scaledUi.js +113 -0
- package/dist/solana/floor/accounts.js +38 -5
- package/dist/solana/floor/events.js +62 -1
- package/dist/solana/floor/instructions.js +39 -1
- package/dist/solana/floor/program.js +3 -0
- package/dist/stockRefresh.js +99 -0
- package/dist/ton/consts.generated.js +2 -2
- package/dist/ton/gas.js +3 -3
- package/dist/v2/claims.js +28 -5
- package/dist/v2/devbuy.js +28 -3
- package/dist/v2/events.js +2 -0
- package/dist/v2/evm.js +183 -5
- package/dist/v2/layouts.js +102 -2
- package/dist/v2/office-events.js +127 -0
- package/dist/v2/office-evm.js +68 -0
- package/dist/v2/office-read.js +182 -0
- package/dist/v2/office-solana.js +134 -0
- package/dist/v2/office-trade.js +73 -0
- package/dist/v2/route-alt.js +1 -0
- package/dist/v2/route.js +1 -1
- package/dist/v2/solana.js +224 -5
- package/dist/v2/solanaSettle.js +2 -0
- package/dist/v2/tx/evm.js +66 -2
- package/dist/v2/tx/solana.js +3 -3
- package/dist/v2/types.js +4 -0
- package/docs/aggregator.md +19 -0
- package/docs/cursor-pages.md +9 -3
- package/docs/ton.md +1 -1
- package/examples/floor-line.html +1 -1
- package/package.json +26 -1
- package/src/abi/evm-event-names.ts +7 -0
- package/src/abi/evm.gen.ts +81 -2
- package/src/abi/functions.gen.ts +135 -1
- package/src/abi/solana.gen.ts +64 -0
- package/src/client/solana/index.ts +25 -6
- package/src/config/generated.ts +803 -26374
- package/src/errors.ts +21 -2
- package/src/events/types.gen.ts +458 -1
- package/src/evm/chains.ts +89 -0
- package/src/evm/floor/abi.gen.ts +115 -0
- package/src/evm/floor/calls.ts +5 -0
- package/src/evm/squid.ts +22 -6
- package/src/evm/venues.ts +340 -0
- package/src/generated/interface.gen.ts +93 -44
- package/src/index.ts +7 -0
- package/src/indexer/bodies.ts +308 -5
- package/src/indexer/client.ts +31 -4
- package/src/indexer/contract.ts +148 -17
- package/src/indexer/paths.ts +139 -7
- package/src/indexer/read.ts +27 -5
- package/src/indexer/stream.ts +4 -4
- package/src/math/v2/book.ts +23 -7
- package/src/math/v2/create.ts +1 -1
- package/src/math/v2/escrow.ts +213 -0
- package/src/math/v2/fees.ts +30 -4
- package/src/math/v2/milestones.ts +1 -1
- package/src/math/v2/office.ts +114 -0
- package/src/math/v2/receipt.ts +7 -3
- package/src/math/v2/relay.ts +269 -96
- package/src/math/v2/rows.ts +17 -0
- package/src/math/v2/team.ts +42 -1
- package/src/math/v2/trade.ts +3 -1
- package/src/reprice.ts +121 -0
- package/src/route/quote.ts +16 -0
- package/src/scaledUi.ts +123 -0
- package/src/solana/floor/accounts.ts +38 -5
- package/src/solana/floor/events.ts +63 -2
- package/src/solana/floor/instructions.ts +39 -1
- package/src/solana/floor/program.ts +3 -0
- package/src/stockRefresh.ts +131 -0
- package/src/ton/consts.generated.ts +2 -2
- package/src/ton/gas.ts +3 -3
- package/src/v2/claims.ts +34 -5
- package/src/v2/devbuy.ts +38 -3
- package/src/v2/events.ts +3 -1
- package/src/v2/evm.ts +209 -5
- package/src/v2/layouts.ts +102 -2
- package/src/v2/office-events.ts +133 -0
- package/src/v2/office-evm.ts +76 -0
- package/src/v2/office-read.ts +264 -0
- package/src/v2/office-solana.ts +159 -0
- package/src/v2/office-trade.ts +96 -0
- package/src/v2/route-alt.ts +1 -0
- package/src/v2/route.ts +1 -1
- package/src/v2/solana.ts +235 -5
- package/src/v2/solanaSettle.ts +2 -0
- package/src/v2/tx/evm.ts +66 -2
- package/src/v2/tx/solana.ts +5 -3
- package/src/v2/types.ts +76 -1
package/dist/indexer/bodies.js
CHANGED
|
@@ -73,7 +73,7 @@ const LAUNCH_FIELDS = {
|
|
|
73
73
|
|
|
74
74
|
graduation: nullable(object({ block: int, timestamp: int, tx: str })),
|
|
75
75
|
|
|
76
|
-
teamSlot: array(object({ wallet: str, place: int })),
|
|
76
|
+
teamSlot: array(object({ wallet: str, place: int, shareBps: optional(nullable(int)), owed: optional(nullable(big)), claimed: optional(nullable(big)), teamBuy: optional(nullable(big)), teamBuyLocked: optional(nullable(big)), unlockAt: optional(nullable(int)) })),
|
|
77
77
|
phase: oneOf("bonding", "stacks", "tail"),
|
|
78
78
|
floorX64: big,
|
|
79
79
|
sqrtF: big,
|
|
@@ -123,16 +123,27 @@ const LISTED_FIELDS = {
|
|
|
123
123
|
volume24hGross: nullable(big),
|
|
124
124
|
holders: int,
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
holdersChange1h: nullable(int),
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
holdersChange24h: nullable(int),
|
|
129
|
+
|
|
130
|
+
volume1h: nullable(big),
|
|
131
|
+
|
|
132
|
+
volumePrev1h: nullable(big),
|
|
129
133
|
|
|
130
134
|
maxLossPpm: optional(nullable(int)),
|
|
131
135
|
|
|
132
136
|
backedPpm: nullable(int),
|
|
133
137
|
volume24hUsd: nullable(decimal),
|
|
138
|
+
|
|
139
|
+
volume1hUsd: nullable(decimal),
|
|
140
|
+
volumePrev1hUsd: nullable(decimal),
|
|
134
141
|
marketCapUsd: nullable(decimal),
|
|
135
142
|
|
|
143
|
+
athPrice: nullable(big),
|
|
144
|
+
|
|
145
|
+
athPriceUsd: nullable(decimal),
|
|
146
|
+
|
|
136
147
|
trendingScore: nullable(big),
|
|
137
148
|
|
|
138
149
|
change24hBps: optional(nullable(int)),
|
|
@@ -176,6 +187,10 @@ const TRADE_FIELDS = {
|
|
|
176
187
|
};
|
|
177
188
|
export const TRADE = object(TRADE_FIELDS);
|
|
178
189
|
|
|
190
|
+
export const TRADE_REFS = object({ tp: optional(str), t: optional(array(str)), cp: optional(str), c: optional(array(str)) });
|
|
191
|
+
|
|
192
|
+
export const STREAM_TRADE = object({ ...TRADE_FIELDS, refs: optional(TRADE_REFS) });
|
|
193
|
+
|
|
179
194
|
export const PAGED_TRADE = object({ id: str, ...TRADE_FIELDS });
|
|
180
195
|
|
|
181
196
|
export const HEAD = object({
|
|
@@ -280,7 +295,7 @@ export const LAUNCH_CLAIM = object({ launch: str, claimer: str, types: int, quot
|
|
|
280
295
|
|
|
281
296
|
export const LAUNCH_CLAIMS = object({ indexed, claims: array(LAUNCH_CLAIM), next: optional(nullable(str)) });
|
|
282
297
|
|
|
283
|
-
export const DEV_BUYS = object({ indexed, teamBuyUnlocked: bool, teamBuyUnlockedTs: nullable(int), devBuys: array(DEV_BUY), next: optional(nullable(str)) });
|
|
298
|
+
export const DEV_BUYS = object({ indexed, teamBuyUnlocked: bool, teamBuyUnlockedTs: nullable(int), devBuys: array(DEV_BUY), next: optional(nullable(str)), totals: object({ count: int, tokens: big, quote: big }), asOf: nullable(str) });
|
|
284
299
|
|
|
285
300
|
export const MEMBER_SOLD_ROW = object({ launch: str, member: str, place: int, amount: big, quoteOut: big, block: int, timestamp: int, tx: str, id: str });
|
|
286
301
|
|
|
@@ -321,6 +336,18 @@ export const CANDLE = object({
|
|
|
321
336
|
floorX64: optional(nullable(big)),
|
|
322
337
|
});
|
|
323
338
|
|
|
339
|
+
export const MCAP_INTERVALS = ["1h", "1d"] ;
|
|
340
|
+
|
|
341
|
+
export const MCAP_PAGE_MAX = 2_000;
|
|
342
|
+
|
|
343
|
+
export const MCAP_POINT = object({ time: int, marketCap: big, supply: big, priceX64: big });
|
|
344
|
+
|
|
345
|
+
export const MCAP = object({ indexed, launch: str, interval: oneOf(...MCAP_INTERVALS), points: array(MCAP_POINT), next: nullable(int) });
|
|
346
|
+
|
|
347
|
+
export const HELD_ROW = object({ at: int, wallets: int, tokens: big });
|
|
348
|
+
|
|
349
|
+
export const HELD = object({ indexed, launch: str, interval: nullable(oneOf(...MCAP_INTERVALS)), rows: array(HELD_ROW), next: nullable(int) });
|
|
350
|
+
|
|
324
351
|
const USD_RATE = object({ centsX64: nullable(big), source: nullable(str), ageS: nullable(int) });
|
|
325
352
|
|
|
326
353
|
export const CANDLES = object({
|
|
@@ -369,6 +396,175 @@ export const DEV_TRADES = object({ indexed, launch: str, creator: str, trades: a
|
|
|
369
396
|
|
|
370
397
|
export const BURNS = object({ indexed, launch: str, burns: array(object({ id: optional(str), amount: big, block: int, timestamp: int })), program: array(object({ ...BURN_FIELDS, id: optional(str) })), wallet: array(object({ ...BURN_FIELDS, id: optional(str) })), next: optional(nullable(str)) });
|
|
371
398
|
|
|
399
|
+
export const RT_POINTS_MAX = 720;
|
|
400
|
+
|
|
401
|
+
export const RAISE_STEPS = [60, 300, 900, 3_600, 14_400, 86_400] ;
|
|
402
|
+
|
|
403
|
+
function checked (d , ok ) {
|
|
404
|
+
return (v, p) => {
|
|
405
|
+
const x = d(v, p);
|
|
406
|
+
const why = ok(x);
|
|
407
|
+
if (why !== null) throw new ShapeError(p, why, v);
|
|
408
|
+
return x;
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
const ascending = (xs , strict ) => xs.every((x, i) => i === 0 || (strict ? x.time > xs[i - 1] .time : x.time >= xs[i - 1] .time));
|
|
412
|
+
|
|
413
|
+
export const RAISE_COUNTS = object({
|
|
414
|
+
buys: int,
|
|
415
|
+
sells: int,
|
|
416
|
+
|
|
417
|
+
last: nullable(int),
|
|
418
|
+
|
|
419
|
+
largest: nullable(object({ time: int, amount: big, id: str })),
|
|
420
|
+
|
|
421
|
+
raised: big,
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
export const RAISE_SERIES = checked(
|
|
425
|
+
object({
|
|
426
|
+
indexed,
|
|
427
|
+
launch: str,
|
|
428
|
+
from: int,
|
|
429
|
+
to: int,
|
|
430
|
+
step: int,
|
|
431
|
+
points: array(object({ time: int, liveTotal: big })),
|
|
432
|
+
pace: array(object({ time: int, bought: big, sold: big })),
|
|
433
|
+
counts: RAISE_COUNTS,
|
|
434
|
+
total: int,
|
|
435
|
+
first: nullable(str),
|
|
436
|
+
asOf: nullable(str),
|
|
437
|
+
}),
|
|
438
|
+
(b) => (b.points.length > RT_POINTS_MAX ? `at most ${RT_POINTS_MAX} points` : !b.points.every((x, i) => i === 0 || x.time === b.points[i - 1] .time + b.step) ? "points on the grid, oldest first" : !ascending(b.pace, true) ? "pace oldest first" : null),
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
export const FLOOR_STEP = object({ id: str, block: int, timestamp: int, floorX64: big, floorMoney: nullable(big) });
|
|
442
|
+
|
|
443
|
+
export const FLOOR_STEPS = checked(
|
|
444
|
+
object({
|
|
445
|
+
indexed,
|
|
446
|
+
launch: str,
|
|
447
|
+
from: int,
|
|
448
|
+
to: int,
|
|
449
|
+
points: int,
|
|
450
|
+
steps: array(FLOOR_STEP),
|
|
451
|
+
totals: object({ steps: int, first: nullable(str), last: nullable(str), firstFloorX64: nullable(big), lastFloorX64: nullable(big) }),
|
|
452
|
+
asOf: nullable(str),
|
|
453
|
+
}),
|
|
454
|
+
(b) => (b.points > RT_POINTS_MAX || b.steps.length > b.points ? `at most ${Math.min(b.points, RT_POINTS_MAX)} steps` : !b.steps.every((x, i) => i === 0 || x.timestamp > b.steps[i - 1] .timestamp) ? "steps oldest first" : b.steps.length > b.totals.steps ? "no more steps than the totals count" : null),
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
export const roundTrip = (v, p) => {
|
|
458
|
+
if (typeof v !== "string") throw new ShapeError(p, "a round-trip number string", v);
|
|
459
|
+
const n = Number(v);
|
|
460
|
+
if (!Number.isFinite(n) || String(n) !== v) throw new ShapeError(p, "a round-trip number string", v);
|
|
461
|
+
return n;
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
export const POSITION_FOLD = object({
|
|
465
|
+
|
|
466
|
+
held: roundTrip,
|
|
467
|
+
|
|
468
|
+
cost: roundTrip,
|
|
469
|
+
|
|
470
|
+
realised: roundTrip,
|
|
471
|
+
|
|
472
|
+
costSold: roundTrip,
|
|
473
|
+
|
|
474
|
+
uncoveredSold: roundTrip,
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
export const POSITION_TOTALS_ROW = object({
|
|
478
|
+
wallet: str,
|
|
479
|
+
launch: str,
|
|
480
|
+
token: str,
|
|
481
|
+
quote: str,
|
|
482
|
+
fills: int,
|
|
483
|
+
buys: int,
|
|
484
|
+
sells: int,
|
|
485
|
+
bought: big,
|
|
486
|
+
sold: big,
|
|
487
|
+
spent: big,
|
|
488
|
+
received: big,
|
|
489
|
+
teamBuy: big,
|
|
490
|
+
firstTs: nullable(int),
|
|
491
|
+
lastTs: nullable(int),
|
|
492
|
+
asOf: nullable(str),
|
|
493
|
+
quoteDecimals: nullable(int),
|
|
494
|
+
fold: nullable(POSITION_FOLD),
|
|
495
|
+
foldReason: nullable(str),
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
export const POSITION_TOTALS = checked(
|
|
499
|
+
object({ indexed, wallet: str, positions: array(POSITION_TOTALS_ROW), next: nullable(str) }),
|
|
500
|
+
(b) => (b.positions.some((r) => (r.fold === null) === (r.foldReason === null)) ? "fold or its reason, one of them" : b.positions.some((r) => r.fills !== r.buys + r.sells) ? "fills = buys + sells" : null),
|
|
501
|
+
);
|
|
502
|
+
|
|
503
|
+
export const STATS_MONEY = object({ byQuote: record(big), usd: decimal, usdMissing: int });
|
|
504
|
+
|
|
505
|
+
export const WALLET_STATS = object({
|
|
506
|
+
indexed: nullable(INDEXED),
|
|
507
|
+
wallet: str,
|
|
508
|
+
trader: object({
|
|
509
|
+
trades: int, buys: int, sells: int, launches: int,
|
|
510
|
+
volume: STATS_MONEY,
|
|
511
|
+
realised: object({ byQuote: record(roundTrip), usd: decimal, usdMissing: int }),
|
|
512
|
+
closed: int, wins: int, winRateBps: nullable(int),
|
|
513
|
+
biggestWin: nullable(object({ usd: decimal, launch: str })),
|
|
514
|
+
biggestLoss: nullable(object({ usd: decimal, launch: str })),
|
|
515
|
+
early: object({ firstBuyers: int, firstMinutes: int, buyersN: int, windowS: int }),
|
|
516
|
+
avgHoldS: nullable(int),
|
|
517
|
+
resaleBps: nullable(int),
|
|
518
|
+
}),
|
|
519
|
+
member: object({
|
|
520
|
+
places: int, launches: int,
|
|
521
|
+
buybacks: object({ count: int, spent: STATS_MONEY, tokens: big, weightedBps: nullable(int), weightedBpsByQuote: record(int), meanBps: nullable(int), firstTs: nullable(int), lastTs: nullable(int) }),
|
|
522
|
+
buybackDays: object({ days: int, streak: int, bestStreak: int, lastDay: nullable(int) }),
|
|
523
|
+
teamShare: object({ withdrawn: STATS_MONEY, boughtBack: STATS_MONEY, owed: nullable(STATS_MONEY), owedShareBoughtTokens: nullable(big) }),
|
|
524
|
+
burns: object({ count: int, tokens: big, supplyBps: int, usd: decimal, usdMissing: int }),
|
|
525
|
+
sold: object({ count: int, tokens: big, quote: STATS_MONEY, boughtTokens: big, soldBps: nullable(int) }),
|
|
526
|
+
teamBuy: object({
|
|
527
|
+
launches: int, tokens: big, burned: big, sold: big, kept: big, locked: big, unsplit: int,
|
|
528
|
+
launchesSold: int, launchesKept: int, firstSoldTs: nullable(int), avgHeldAfterLockS: nullable(int),
|
|
529
|
+
owedTokens: nullable(big), lockedTokens: nullable(big),
|
|
530
|
+
}),
|
|
531
|
+
}),
|
|
532
|
+
creator: object({
|
|
533
|
+
launches: int, graduated: int, graduationBps: nullable(int), medianGraduateS: nullable(int),
|
|
534
|
+
peakMcap: object({ bestUsd: nullable(decimal), bestLaunch: nullable(str), medianUsd: nullable(decimal) }),
|
|
535
|
+
volume: STATS_MONEY, holders: int, activeLaunches: int, activeWindowS: int,
|
|
536
|
+
teamBuy: object({ launches: int, tokens: big, cost: STATS_MONEY, unsplit: int, toOtherPlaces: big }),
|
|
537
|
+
teamSlot: object({ launches: int, members: int, maxMembers: int }),
|
|
538
|
+
refs: object({ takenFromTeamShare: STATS_MONEY }),
|
|
539
|
+
}),
|
|
540
|
+
referrer: object({ referred: int, earned: STATS_MONEY, owed: nullable(STATS_MONEY) }),
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
export const LAUNCH_TRADED = checked(
|
|
544
|
+
object({ indexed, launch: str, traded: array(object({ wallet: str, traded: bool, firstTs: nullable(int) })), asOf: nullable(str) }),
|
|
545
|
+
(b) => (b.traded.some((r) => r.traded === (r.firstTs === null)) ? "firstTs exactly where traded" : null),
|
|
546
|
+
);
|
|
547
|
+
|
|
548
|
+
export const DEAL_PROOF = object({ state: int, hash: nullable(str), windowEnds: nullable(big), objected: bool });
|
|
549
|
+
|
|
550
|
+
export const DEAL_SPLIT = object({ kind: int, kol: str, kolPart: big, agency: nullable(str), agencyPart: big, tiers: array(nullable(str)), refs: array(big), feeRest: big });
|
|
551
|
+
|
|
552
|
+
export const DEAL_UPFRONT = object({ amount: big, fee: big, token: str, timestamp: int, tx: str });
|
|
553
|
+
|
|
554
|
+
export const DEAL = object({
|
|
555
|
+
escrow: str, launcher: str, kol: str, ref32: str, asset: str, isToken: bool, version: int,
|
|
556
|
+
targets: array(big), amounts: array(big), total: big, expiry: big, armedAt: array(big),
|
|
557
|
+
released: array(nullable(object({ amount: big, fee: big, marketCap: big }))),
|
|
558
|
+
|
|
559
|
+
upfront: array(DEAL_UPFRONT),
|
|
560
|
+
refunded: nullable(big), cancelAgreed: int, cancelled: bool,
|
|
561
|
+
kinds: array(int), proofMask: int, agency: nullable(str), agencyBps: int, volAtLock: big,
|
|
562
|
+
proof: array(nullable(DEAL_PROOF)), split: array(nullable(DEAL_SPLIT)),
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
export const SEAT_AGENCY = object({ place: int, key: str, agency: str, agencyBps: int, paid: big });
|
|
566
|
+
export const DEALS = object({ indexed, launch: str, deals: array(DEAL), seatAgencies: array(SEAT_AGENCY) });
|
|
567
|
+
|
|
372
568
|
const LOCK_HOLDER = object({ wallet: str, place: nullable(int) });
|
|
373
569
|
|
|
374
570
|
export const TEAM_BUY_LOCK = object({ kind: oneOf("teamBuy"), tokens: big, createdAt: int, unlocked: bool, unlockedAt: nullable(int), unlockAt: nullable(int), locked: big, claimed: big, holders: array(LOCK_HOLDER) });
|
|
@@ -518,14 +714,101 @@ export const FIRSTS_MANY = object({ indexed, wallets: record(FIRSTS_ROW) });
|
|
|
518
714
|
|
|
519
715
|
const PER_QUOTE = array(object({ quote: str, amount: big }));
|
|
520
716
|
|
|
717
|
+
export const PEOPLE_ROLE = object({ kind: oneOf("trader", "creator"), tier: int, via: nullable(str) });
|
|
718
|
+
|
|
521
719
|
export const PEOPLE = object({
|
|
522
720
|
indexed,
|
|
523
721
|
wallet: str,
|
|
524
|
-
people: array(object({ wallet: str, chain: str,
|
|
722
|
+
people: array(object({ wallet: str, chain: str, boundAt: optional(int), roles: array(PEOPLE_ROLE), earned: PER_QUOTE, teamMilestone: PER_QUOTE, unclaimed: PER_QUOTE })),
|
|
723
|
+
pooled: PER_QUOTE,
|
|
724
|
+
|
|
725
|
+
accountsAt: optional(nullable(int)),
|
|
726
|
+
|
|
727
|
+
og: optional(nullable(object({ from: int, until: int, revoked: bool }))),
|
|
525
728
|
|
|
526
729
|
next: optional(nullable(str)),
|
|
527
730
|
});
|
|
528
731
|
|
|
732
|
+
export const TIE_FIRST_BUY = object({ ts: int, quote: big, usd: nullable(decimal) });
|
|
733
|
+
|
|
734
|
+
const TIE_FLOW = { buys: int, buyQuote: big, buyUsd: decimal, sells: int, sellQuote: big, sellUsd: decimal, usdMissing: int } ;
|
|
735
|
+
|
|
736
|
+
const TIE_EARNED_TIER = object({ quote: big, usd: decimal });
|
|
737
|
+
|
|
738
|
+
export const TIE_EARNED = object({ tier1: TIE_EARNED_TIER, tier2: TIE_EARNED_TIER, tier3: TIE_EARNED_TIER, usdMissing: int });
|
|
739
|
+
|
|
740
|
+
export const REFERRAL_LAUNCH_ROW = object({
|
|
741
|
+
launch: str,
|
|
742
|
+
token: str,
|
|
743
|
+
quote: str,
|
|
744
|
+
createdTs: int,
|
|
745
|
+
self: nullable(TIE_FIRST_BUY),
|
|
746
|
+
creator: bool,
|
|
747
|
+
teamSlot: bool,
|
|
748
|
+
buyers: int,
|
|
749
|
+
before: int,
|
|
750
|
+
after: int,
|
|
751
|
+
medianLeadS: nullable(int),
|
|
752
|
+
medianLagS: nullable(int),
|
|
753
|
+
earned: TIE_EARNED,
|
|
754
|
+
teamMilestone: TIE_EARNED,
|
|
755
|
+
referees: array(object({
|
|
756
|
+
wallet: str,
|
|
757
|
+
linked: array(object({ quote: str, tier: int })),
|
|
758
|
+
credited: array(object({ kind: oneOf("trader", "creator"), tier: int })),
|
|
759
|
+
teamSlot: bool,
|
|
760
|
+
firstBuy: TIE_FIRST_BUY,
|
|
761
|
+
offsetS: nullable(int),
|
|
762
|
+
...TIE_FLOW,
|
|
763
|
+
followed: nullable(object(TIE_FLOW)),
|
|
764
|
+
})),
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
export const REFERRAL_LAUNCHES = object({
|
|
768
|
+
indexed,
|
|
769
|
+
wallet: str,
|
|
770
|
+
membership: oneOf("linkedNowOrEverCredited"),
|
|
771
|
+
|
|
772
|
+
people: int,
|
|
773
|
+
launches: array(REFERRAL_LAUNCH_ROW),
|
|
774
|
+
|
|
775
|
+
next: nullable(str),
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
export const LAUNCH_TIES = object({
|
|
779
|
+
indexed,
|
|
780
|
+
launch: str,
|
|
781
|
+
quote: str,
|
|
782
|
+
at: int,
|
|
783
|
+
from: int,
|
|
784
|
+
to: int,
|
|
785
|
+
activeFrom: int,
|
|
786
|
+
activeTo: int,
|
|
787
|
+
holdingSource: oneOf("trades"),
|
|
788
|
+
wallets: array(object({
|
|
789
|
+
wallet: str,
|
|
790
|
+
active: bool,
|
|
791
|
+
firstFloorTradeAt: nullable(int),
|
|
792
|
+
teamSlot: bool,
|
|
793
|
+
firstBuy: nullable(TIE_FIRST_BUY),
|
|
794
|
+
offsetS: nullable(int),
|
|
795
|
+
inWindow: bool,
|
|
796
|
+
...TIE_FLOW,
|
|
797
|
+
holding: array(object({ days: int, at: int, peak: nullable(big), held: nullable(big) })),
|
|
798
|
+
})),
|
|
799
|
+
base: object({ active: int, bought: int, ratePpm: nullable(int) }),
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
export const COBUYS = object({
|
|
803
|
+
indexed,
|
|
804
|
+
wallet: str,
|
|
805
|
+
windowS: int,
|
|
806
|
+
minLaunches: int,
|
|
807
|
+
launches: int,
|
|
808
|
+
total: int,
|
|
809
|
+
cobuys: array(object({ wallet: str, launches: int, firstTs: int, lastTs: int })),
|
|
810
|
+
});
|
|
811
|
+
|
|
529
812
|
export const ROLES = object({
|
|
530
813
|
indexed,
|
|
531
814
|
wallet: str,
|
package/dist/indexer/client.js
CHANGED
|
@@ -36,10 +36,17 @@ export const routePath = {
|
|
|
36
36
|
quoteChain: (a) => indexerPath.quoteChain(a.launch),
|
|
37
37
|
devTrades: ({ launch, ...q }) => indexerPath.devTrades(launch, q),
|
|
38
38
|
burns: ({ launch, ...q }) => indexerPath.burns(launch, q),
|
|
39
|
+
deals: (a) => indexerPath.deals(a.launch),
|
|
39
40
|
launchLocks: (a) => indexerPath.launchLocks(a.launch),
|
|
40
41
|
marks: ({ launch, ...q }) => indexerPath.marks(launch, q),
|
|
41
42
|
price: (a) => indexerPath.price(a.launch),
|
|
43
|
+
raiseSeries: ({ launch, ...q }) => indexerPath.raiseSeries(launch, q),
|
|
44
|
+
floorSteps: ({ launch, ...q }) => indexerPath.floorSteps(launch, q),
|
|
45
|
+
launchTraded: (a) => indexerPath.launchTraded(a.launch, a.wallets),
|
|
46
|
+
launchTies: ({ launch, ...q }) => indexerPath.launchTies(launch, q),
|
|
42
47
|
highs: ({ launch, ...q }) => indexerPath.highs(launch, q),
|
|
48
|
+
mcap: ({ launch, ...q }) => indexerPath.mcap(launch, q),
|
|
49
|
+
held: ({ launch, ...q }) => indexerPath.held(launch, q),
|
|
43
50
|
candles: (a) => indexerPath.candles(a),
|
|
44
51
|
candlesMany: (a) => indexerPath.candlesMany(a),
|
|
45
52
|
candleBundle: ({ launch, ...q }) => indexerPath.candleBundle(launch, q),
|
|
@@ -47,13 +54,17 @@ export const routePath = {
|
|
|
47
54
|
tonActivity: ({ wallet, ...q }) => indexerPath.tonActivity(wallet, q),
|
|
48
55
|
tonOutcome: (a) => indexerPath.tonOutcome(a.wallet, a.queryId),
|
|
49
56
|
positions: ({ wallet, ...q }) => indexerPath.positions(wallet, q),
|
|
57
|
+
positionTotals: ({ wallet, ...q }) => indexerPath.positionTotals(wallet, q),
|
|
50
58
|
inbox: ({ wallet, ...q }) => indexerPath.inbox(wallet, q),
|
|
51
59
|
walletLocks: ({ wallet, ...q }) => indexerPath.walletLocks(wallet, q),
|
|
52
60
|
claimHistory: ({ wallet, ...q }) => indexerPath.claimHistory(wallet, q),
|
|
53
61
|
firsts: (a) => indexerPath.firsts(a.wallet),
|
|
62
|
+
walletStats: (a) => indexerPath.walletStats(a.wallet),
|
|
63
|
+
cobuys: ({ wallet, ...q }) => indexerPath.cobuys(wallet, q),
|
|
54
64
|
firstsMany: (a) => indexerPath.firstsMany(a.wallets),
|
|
55
65
|
claimView: ({ wallet, ...q }) => indexerPath.claimView(wallet, q),
|
|
56
66
|
people: ({ wallet, ...q }) => indexerPath.people(wallet, q),
|
|
67
|
+
referralLaunches: ({ wallet, ...q }) => indexerPath.referralLaunches(wallet, q),
|
|
57
68
|
roles: ({ wallet, ...q }) => indexerPath.roles(wallet, q),
|
|
58
69
|
handlePlaces: ({ handle, ...q }) => indexerPath.handlePlaces(handle, q),
|
|
59
70
|
traderBoard: (a) => indexerPath.traderBoard(a ?? {}),
|
|
@@ -73,7 +84,7 @@ export const routePath = {
|
|
|
73
84
|
health: () => "/health",
|
|
74
85
|
};
|
|
75
86
|
|
|
76
|
-
export const DRAIN_NAMES = ["trades", "launchClaims", "memberSold", "burns", "walletTrades", "launches", "search", "marks", "inbox", "positions", "walletLocks", "claimHistory", "people", "roles", "tokenHolders", "tonActivity", "cgHistoricalTrades", "floorRouted", "devBuys", "claimView", "handlePlaces"] ;
|
|
87
|
+
export const DRAIN_NAMES = ["trades", "launchClaims", "memberSold", "burns", "walletTrades", "launches", "search", "marks", "inbox", "positions", "walletLocks", "claimHistory", "people", "roles", "tokenHolders", "tonActivity", "cgHistoricalTrades", "floorRouted", "devBuys", "claimView", "handlePlaces", "positionTotals", "referralLaunches", "mcap", "held"] ;
|
|
77
88
|
|
|
78
89
|
export function createIndexerClient(opts ) {
|
|
79
90
|
|
|
@@ -96,6 +107,11 @@ export function createIndexerClient(opts ) {
|
|
|
96
107
|
const lim = routeLimit(name) ;
|
|
97
108
|
let args = { ...a };
|
|
98
109
|
|
|
110
|
+
if (args.person !== undefined) {
|
|
111
|
+
yield await read(name, args);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
99
115
|
if (page.kind === "cursor" && page.optIn !== undefined && args.before === undefined) args = { ...args, before: "" };
|
|
100
116
|
if (page.kind === "keyset" && page.optIn === true && args.limit === undefined && args.cursor === undefined) args = { ...args, limit: lim.default };
|
|
101
117
|
for (let i = 0; i < max; i++) {
|