@pickhooks/sdk 0.0.0-stage → 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.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +418 -3
  3. package/dist/abis/agents.d.ts +2418 -0
  4. package/dist/abis/agents.js +4 -0
  5. package/dist/abis/any3.d.ts +2123 -0
  6. package/dist/abis/any3.js +3 -0
  7. package/dist/abis/anytax.d.ts +1786 -0
  8. package/dist/abis/anytax.js +3 -0
  9. package/dist/abis/calls.d.ts +2515 -0
  10. package/dist/abis/calls.js +4 -0
  11. package/dist/abis/common.d.ts +449 -0
  12. package/dist/abis/common.js +91 -0
  13. package/dist/abis/dips.d.ts +897 -0
  14. package/dist/abis/dips.js +2 -0
  15. package/dist/abis/index.d.ts +14 -0
  16. package/dist/abis/index.js +14 -0
  17. package/dist/abis/infra.d.ts +701 -0
  18. package/dist/abis/infra.js +4 -0
  19. package/dist/abis/lever.d.ts +1710 -0
  20. package/dist/abis/lever.js +5 -0
  21. package/dist/abis/lever2.d.ts +2710 -0
  22. package/dist/abis/lever2.js +5 -0
  23. package/dist/abis/pools.d.ts +1898 -0
  24. package/dist/abis/pools.js +4 -0
  25. package/dist/abis/sticky.d.ts +953 -0
  26. package/dist/abis/sticky.js +4 -0
  27. package/dist/abis/sticky2.d.ts +3750 -0
  28. package/dist/abis/sticky2.js +8 -0
  29. package/dist/abis/v1.d.ts +1627 -0
  30. package/dist/abis/v1.js +5 -0
  31. package/dist/abis/v2.d.ts +3264 -0
  32. package/dist/abis/v2.js +8 -0
  33. package/dist/addresses.d.ts +100 -0
  34. package/dist/addresses.js +71 -0
  35. package/dist/agents-catalog.d.ts +318 -0
  36. package/dist/agents-catalog.js +353 -0
  37. package/dist/agents.d.ts +543 -0
  38. package/dist/agents.js +667 -0
  39. package/dist/any.d.ts +447 -0
  40. package/dist/any.js +729 -0
  41. package/dist/api.d.ts +62 -0
  42. package/dist/api.js +30 -0
  43. package/dist/blocks.d.ts +107 -0
  44. package/dist/blocks.js +126 -0
  45. package/dist/coin-rules-config.d.ts +8 -0
  46. package/dist/coin-rules-config.js +13 -0
  47. package/dist/coin-rules.d.ts +383 -0
  48. package/dist/coin-rules.js +878 -0
  49. package/dist/coins.d.ts +217 -0
  50. package/dist/coins.js +520 -0
  51. package/dist/desks.d.ts +298 -0
  52. package/dist/desks.js +343 -0
  53. package/dist/dips.d.ts +133 -0
  54. package/dist/dips.js +148 -0
  55. package/dist/errors.d.ts +35 -0
  56. package/dist/errors.js +414 -0
  57. package/dist/index.d.ts +104 -0
  58. package/dist/index.js +91 -0
  59. package/dist/infinity.d.ts +63 -0
  60. package/dist/infinity.js +96 -0
  61. package/dist/infra.d.ts +112 -0
  62. package/dist/infra.js +114 -0
  63. package/dist/lever.d.ts +391 -0
  64. package/dist/lever.js +419 -0
  65. package/dist/pools.d.ts +274 -0
  66. package/dist/pools.js +405 -0
  67. package/dist/sticky-rules.d.ts +179 -0
  68. package/dist/sticky-rules.js +580 -0
  69. package/dist/sticky-sim.d.ts +125 -0
  70. package/dist/sticky-sim.js +637 -0
  71. package/dist/sticky.d.ts +286 -0
  72. package/dist/sticky.js +420 -0
  73. package/dist/tlock.d.ts +67 -0
  74. package/dist/tlock.js +185 -0
  75. package/dist/tx.d.ts +72 -0
  76. package/dist/tx.js +78 -0
  77. package/dist/v2.d.ts +106 -0
  78. package/dist/v2.js +61 -0
  79. package/dist/v3.d.ts +42 -0
  80. package/dist/v3.js +98 -0
  81. package/dist/wallet.d.ts +80 -0
  82. package/dist/wallet.js +115 -0
  83. package/dist/watch.d.ts +82 -0
  84. package/dist/watch.js +194 -0
  85. package/package.json +67 -4
@@ -0,0 +1,383 @@
1
+ /**
2
+ * The rule catalog for hooks on BNB: one entry per rule of HooksToken (src/HooksToken.sol).
3
+ * The launcher builds its form from `fields` and turns the values into the token's `Rules` struct
4
+ * with `apply`; the coin page explains a live rule with `describe` and `live`.
5
+ * Every rule says what a scanner (GoPlus, honeypot.is) will make of it: `scanner`.
6
+ * Shared by client and server.
7
+ */
8
+ export declare const SUPPLY = 1000000000;
9
+ export declare const MAX_RULES = 8;
10
+ export declare const DAY = 86400;
11
+ /** Binance Account Bound Token: the soulbound token of identity-verified Binance users, one per account, balanceOf is 0 or 1. */
12
+ export declare const BABT: "0x2B09d47D550061f995A3b5C6F0Fd58005215D7c8";
13
+ /** The pickhooks token on BNB Chain (flap, migrated to PancakeSwap). Gate for the set "$hooks holders only". */
14
+ export declare const HOOKS_TOKEN: "0x07bcB8E8226f671300e135b4A61Dc157359b7777";
15
+ export type Group = "hold" | "buy" | "sell" | "time" | "move" | "pay" | "games" | "linked" | "hooks" | "trust";
16
+ export declare const GROUPS: {
17
+ id: Group;
18
+ title: string;
19
+ blurb: string;
20
+ }[];
21
+ /** What scanners will show. green: nothing. yellow: a hint, or a test buy fails at some moments. red: looks like a honeypot. */
22
+ export type Scanner = {
23
+ level: "green" | "yellow" | "red";
24
+ note: string;
25
+ };
26
+ export type Field = {
27
+ id: string;
28
+ label: string;
29
+ kind: "pct";
30
+ min?: number;
31
+ max?: number;
32
+ def: number;
33
+ zeroOk?: boolean;
34
+ hint?: string;
35
+ } | {
36
+ id: string;
37
+ label: string;
38
+ kind: "dur";
39
+ max: number;
40
+ def: number;
41
+ zeroOk?: boolean;
42
+ min?: number;
43
+ hint?: string;
44
+ } | {
45
+ id: string;
46
+ label: string;
47
+ kind: "int";
48
+ min: number;
49
+ max: number;
50
+ def: number;
51
+ hint?: string;
52
+ } | {
53
+ id: string;
54
+ label: string;
55
+ kind: "bnb";
56
+ max: number;
57
+ def: number;
58
+ zeroOk?: boolean;
59
+ min?: number;
60
+ hint?: string;
61
+ } | {
62
+ id: string;
63
+ label: string;
64
+ kind: "gwei";
65
+ max: number;
66
+ def: number;
67
+ hint?: string;
68
+ } | {
69
+ id: string;
70
+ label: string;
71
+ kind: "address";
72
+ hint?: string;
73
+ optional?: boolean;
74
+ } | {
75
+ id: string;
76
+ label: string;
77
+ kind: "bool";
78
+ def: boolean;
79
+ hint?: string;
80
+ } | {
81
+ id: string;
82
+ label: string;
83
+ kind: "hour";
84
+ def: number;
85
+ hint?: string;
86
+ } | {
87
+ id: string;
88
+ label: string;
89
+ kind: "days";
90
+ def: number;
91
+ hint?: string;
92
+ } | {
93
+ id: string;
94
+ label: string;
95
+ kind: "usd";
96
+ min: number;
97
+ max: number;
98
+ def: number;
99
+ hint?: string;
100
+ }
101
+ /** one of a few fixed values */
102
+ | {
103
+ id: string;
104
+ label: string;
105
+ kind: "choice";
106
+ options: {
107
+ value: number;
108
+ label: string;
109
+ }[];
110
+ def: number;
111
+ hint?: string;
112
+ }
113
+ /** a comma list of rule kinds picked for this launch (buyout, vote) */
114
+ | {
115
+ id: string;
116
+ label: string;
117
+ kind: "rules";
118
+ hint?: string;
119
+ };
120
+ export type Values = Record<string, number | boolean | string>;
121
+ /** The token's Rules struct, as viem reads and writes it. */
122
+ export type R = {
123
+ mask: bigint;
124
+ maxWalletBps: number;
125
+ riseStartBps: number;
126
+ riseStepBps: number;
127
+ riseSeconds: number;
128
+ chapterStartBps: number;
129
+ chapterVolume: bigint;
130
+ clubMax: number;
131
+ gateToken: `0x${string}`;
132
+ gateMin: bigint;
133
+ maxTradeBps: number;
134
+ buysPerBlock: number;
135
+ maxGasPrice: bigint;
136
+ raiseBps: number;
137
+ raiseReset: number;
138
+ minBuy: bigint;
139
+ slowSeconds: number;
140
+ buyLimit: number;
141
+ dumpBuyBps: number;
142
+ dumpSellBps: number;
143
+ curveSmallBps: number;
144
+ curveFloorBps: number;
145
+ curveBigBagBps: number;
146
+ taperStartBps: number;
147
+ taperEndBps: number;
148
+ taperSoldBps: number;
149
+ unlockBuys: number;
150
+ devLockSeconds: number;
151
+ devCapBps: number;
152
+ devGapSeconds: number;
153
+ diamondSeconds: number;
154
+ cooldownSeconds: number;
155
+ jailWindow: number;
156
+ jailSeconds: number;
157
+ openHour: number;
158
+ closeHour: number;
159
+ weekdays: number;
160
+ sellsOpen: boolean;
161
+ sellWindow: number;
162
+ sellPeriod: number;
163
+ tickSeconds: number;
164
+ bellSeconds: number;
165
+ bellSoldBps: number;
166
+ rewardPerBuy: bigint;
167
+ rewardMinBuy: bigint;
168
+ rewardEveryN: number;
169
+ jackpotSilence: number;
170
+ jackpotShareBps: number;
171
+ jackpotMinBuy: bigint;
172
+ jackpotFeeBps: number;
173
+ dipBps: number;
174
+ beacon: `0x${string}`;
175
+ beaconTargetBps: number;
176
+ partner: `0x${string}`;
177
+ reactBaseBps: number;
178
+ reactSensitivity: number;
179
+ };
180
+ export declare function emptyRules(): R;
181
+ /** The v2 factory's Extras struct: everything the eight v2 rules need beyond `Rules`, as viem reads and writes it. */
182
+ export type X = {
183
+ buyoutMask: bigint;
184
+ buyoutPrice: readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint];
185
+ votable: bigint;
186
+ quorumBps: number;
187
+ voteSeconds: number;
188
+ duelOpponent: `0x${string}`;
189
+ duelStake: bigint;
190
+ feed: `0x${string}`;
191
+ target: bigint;
192
+ sellsAtSeconds: number;
193
+ deadManSeconds: number;
194
+ floorDeposit: bigint;
195
+ floorBps: number;
196
+ shiftSeconds: number;
197
+ payrollMin: bigint;
198
+ payrollDeposit: bigint;
199
+ /** share of the creator's fee part the creator keeps; the rest buys $hooks back and burns it */
200
+ creatorKeepBps: number;
201
+ };
202
+ export declare function emptyExtras(): X;
203
+ /** Live state the eight v2 rules add, in display units. */
204
+ export type V2Live = {
205
+ /** rule kinds that were lifted (bought off, voted off, or sells at reached its target) */
206
+ off: number[];
207
+ /** $hooks burned at launch */
208
+ hooksBurned: number;
209
+ /** dead man: last sign of life of the creator */
210
+ devAlive: number;
211
+ /** milestone: share of the creator's peak bag that may leave, in percent, and what left so far */
212
+ milestonePct: number;
213
+ devPeakTokens: number;
214
+ devOutTokens: number;
215
+ /** bought minus sold through both pools since launch, in tokens */
216
+ flowTokens: number;
217
+ /** sells at: the feed's price now, in USD */
218
+ feedPrice: number | null;
219
+ duel: {
220
+ id: number;
221
+ opponent: string | null;
222
+ stake: number;
223
+ openedAt: number;
224
+ startedAt: number;
225
+ closed: boolean;
226
+ settled: boolean;
227
+ winner: string | null;
228
+ flowA: number;
229
+ flowB: number;
230
+ mine: "a" | "b";
231
+ } | null;
232
+ floor: {
233
+ deposit: number;
234
+ left: number;
235
+ peakPct: number | null;
236
+ lastDefend: number;
237
+ belowFloor: boolean;
238
+ } | null;
239
+ payroll: {
240
+ pot: number;
241
+ total: number;
242
+ lastShift: number;
243
+ shiftNo: number;
244
+ shiftSeconds: number;
245
+ mine: {
246
+ wages: number;
247
+ earning: number;
248
+ waiting: number;
249
+ } | null;
250
+ } | null;
251
+ votes: {
252
+ kind: number;
253
+ round: number;
254
+ end: number;
255
+ done: boolean;
256
+ yes: number;
257
+ no: number;
258
+ yesVoters: number;
259
+ quorum: number;
260
+ retryAt: number;
261
+ mine: {
262
+ deposit: number;
263
+ side: 0 | 1 | 2;
264
+ } | null;
265
+ }[];
266
+ /** the connected wallet's coins in the vote box */
267
+ inBoxTokens: number;
268
+ };
269
+ /** Live state of a coin, already in display units (tokens, BNB, seconds). */
270
+ export type LiveState = {
271
+ creator: string;
272
+ start: number;
273
+ holders: number;
274
+ buys: number;
275
+ sells: number;
276
+ buysSinceSell: number;
277
+ lastBuyTime: number;
278
+ lastBuyer: string | null;
279
+ lastBuyTokens: number;
280
+ volumeTokens: number;
281
+ soldBps: number;
282
+ peakBps: number;
283
+ devLastSend: number;
284
+ qualifyingBuys: number;
285
+ jackpotPot: number;
286
+ jackpotLast: string | null;
287
+ jackpotTime: number;
288
+ rewardsPot: number;
289
+ owedTotal: number;
290
+ entangledOpen: boolean;
291
+ maxWalletTokens: number | null;
292
+ /** clean coins: what the creator paid into the rewards pot and may take back */
293
+ creatorFunded?: number;
294
+ /** v2 coins only */
295
+ v2?: V2Live;
296
+ };
297
+ export type RuleDef = {
298
+ kind: number;
299
+ id: string;
300
+ name: string;
301
+ /** Hooked's name for the same idea, if they have one. */
302
+ alias?: string;
303
+ group: Group;
304
+ line: string;
305
+ scanner: Scanner;
306
+ fields: Field[];
307
+ apply: (v: Values) => Partial<R>;
308
+ describe: (r: R, x?: X) => string;
309
+ /** One line about the rule right now, from the live counters. */
310
+ live?: (r: R, s: LiveState, now: number, x?: X) => string | null;
311
+ /** v2 rules: the Extras fields this rule fills. `picked` is the whole selection (buyout and vote list other rules). */
312
+ extras?: (v: Values, picked: Picked[]) => Partial<X>;
313
+ /** v2 hooks rules: the launch burns $hooks for this rule */
314
+ burns?: boolean;
315
+ };
316
+ export declare function pct(bps: number): string;
317
+ export declare function dur(s: number): string;
318
+ export declare const bnb: (v: number) => string;
319
+ export declare const short: (a: string | null | undefined) => string;
320
+ export declare const tokens: (t: number) => string;
321
+ export declare const fromRaw: (x: bigint) => number;
322
+ /** rule kinds of the v1 catalog (the v2 factory takes them all as well) */
323
+ export declare const V1_KINDS: readonly number[];
324
+ /** rules that only restrict trading: the only ones a buyout or a vote can lift (never trust rules, games, pots or linked coins) */
325
+ export declare const LIFTABLE: readonly number[];
326
+ /** rules that cannot have an end time on the v2 factory: trust rules, pots, games and the v2 machinery */
327
+ export declare const NO_UNTIL: readonly number[];
328
+ export declare const FEED_NAMES: readonly ["BNB", "BTC", "ETH", "DOGE"];
329
+ export declare const RULES: RuleDef[];
330
+ /** the catalog the site shows: the eight v2 rules only once the v2 factory is set */
331
+ export declare const RULES_SHOWN: readonly RuleDef[];
332
+ export declare const GROUPS_SHOWN: {
333
+ id: Group;
334
+ title: string;
335
+ blurb: string;
336
+ }[];
337
+ export declare const RULE_BY_KIND: Map<number, RuleDef>;
338
+ export declare const RULE_BY_ID: Map<string, RuleDef>;
339
+ export declare function defaults(def: RuleDef): Values;
340
+ /** Checks the values against the same limits the factory enforces. Returns a sentence or null. */
341
+ export declare function fieldProblem(def: RuleDef, v: Values): string | null;
342
+ export type Picked = {
343
+ id: string;
344
+ values: Values;
345
+ endsAfter?: number;
346
+ };
347
+ /** Checks a whole selection the way the factory does. */
348
+ export declare function selectionProblem(picked: Picked[]): string | null;
349
+ /** The launch arguments for the factory: the Rules struct, the end times, and for the v2 factory the Extras. */
350
+ export declare function buildRules(picked: Picked[], nowSec: number, creatorKeepBps?: number): {
351
+ rules: R;
352
+ untilIds: number[];
353
+ untilTimes: number[];
354
+ extras: X;
355
+ };
356
+ /** v2: how many hooks rules a selection carries (each burns $hooks at launch), and the BNB the launch deposits besides the seed. */
357
+ export declare function v2Costs(picked: Picked[]): {
358
+ hooksRules: number;
359
+ stakeBnb: number;
360
+ floorBnb: number;
361
+ payrollBnb: number;
362
+ v2: boolean;
363
+ };
364
+ /** BNB the launcher sends into pots right after the launch. */
365
+ export declare function launchPots(picked: Picked[]): {
366
+ jackpot: number;
367
+ rewards: number;
368
+ };
369
+ /** The worst scanner level in a selection. */
370
+ export declare function worstScanner(kinds: number[]): Scanner["level"];
371
+ /** Rule kinds that are on in a mask. */
372
+ export declare const kindsOf: (mask: bigint) => number[];
373
+ /** The rule's current sentence, or that it ended. */
374
+ export declare function ruleNow(kind: number, r: R, s: LiveState, until: number, now: number, x?: X): {
375
+ name: string;
376
+ text: string;
377
+ live: string | null;
378
+ ended: boolean;
379
+ lifted: boolean;
380
+ scanner: Scanner;
381
+ };
382
+ /** Names of the rules a token error refers to, for "rule: max wallet" messages. */
383
+ export declare function refusal(kind: number, r: R | null): string;