@pickhooks/sdk 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +309 -3
- package/dist/abis/any3.d.ts +2123 -0
- package/dist/abis/any3.js +3 -0
- package/dist/abis/anytax.d.ts +1786 -0
- package/dist/abis/anytax.js +3 -0
- package/dist/abis/calls.d.ts +2515 -0
- package/dist/abis/calls.js +4 -0
- package/dist/abis/common.d.ts +449 -0
- package/dist/abis/common.js +91 -0
- package/dist/abis/dips.d.ts +897 -0
- package/dist/abis/dips.js +2 -0
- package/dist/abis/index.d.ts +12 -0
- package/dist/abis/index.js +12 -0
- package/dist/abis/infra.d.ts +701 -0
- package/dist/abis/infra.js +4 -0
- package/dist/abis/lever.d.ts +1710 -0
- package/dist/abis/lever.js +5 -0
- package/dist/abis/lever2.d.ts +2710 -0
- package/dist/abis/lever2.js +5 -0
- package/dist/abis/pools.d.ts +1898 -0
- package/dist/abis/pools.js +4 -0
- package/dist/abis/sticky.d.ts +953 -0
- package/dist/abis/sticky.js +4 -0
- package/dist/abis/v1.d.ts +1627 -0
- package/dist/abis/v1.js +5 -0
- package/dist/abis/v2.d.ts +3264 -0
- package/dist/abis/v2.js +8 -0
- package/dist/addresses.d.ts +87 -0
- package/dist/addresses.js +62 -0
- package/dist/any.d.ts +447 -0
- package/dist/any.js +729 -0
- package/dist/api.d.ts +62 -0
- package/dist/api.js +30 -0
- package/dist/blocks.d.ts +107 -0
- package/dist/blocks.js +126 -0
- package/dist/coin-rules-config.d.ts +8 -0
- package/dist/coin-rules-config.js +13 -0
- package/dist/coin-rules.d.ts +383 -0
- package/dist/coin-rules.js +878 -0
- package/dist/coins.d.ts +217 -0
- package/dist/coins.js +520 -0
- package/dist/dips.d.ts +133 -0
- package/dist/dips.js +148 -0
- package/dist/errors.d.ts +35 -0
- package/dist/errors.js +347 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +58 -0
- package/dist/infinity.d.ts +63 -0
- package/dist/infinity.js +96 -0
- package/dist/infra.d.ts +112 -0
- package/dist/infra.js +114 -0
- package/dist/lever.d.ts +391 -0
- package/dist/lever.js +419 -0
- package/dist/pools.d.ts +274 -0
- package/dist/pools.js +405 -0
- package/dist/sticky-rules.d.ts +179 -0
- package/dist/sticky-rules.js +580 -0
- package/dist/sticky.d.ts +216 -0
- package/dist/sticky.js +292 -0
- package/dist/tx.d.ts +70 -0
- package/dist/tx.js +69 -0
- package/dist/v3.d.ts +42 -0
- package/dist/v3.js +98 -0
- package/package.json +58 -4
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
import type { BlocksCatalog } from "./blocks.js";
|
|
3
|
+
import type { Ctx } from "./tx.js";
|
|
4
|
+
/**
|
|
5
|
+
* pickhooks.com's public JSON API (GET only, no key, CORS open; documented at /docs/api). Each address has a limit per
|
|
6
|
+
* minute (launches 240, coins and activity 120, official 60); a few calls per second is plenty. Answers are typed loosely:
|
|
7
|
+
* the site adds fields over time, the SDK only names the ones it promises.
|
|
8
|
+
*/
|
|
9
|
+
/** One coin of the launch feed (a row of /api/launches). */
|
|
10
|
+
export type Launch = {
|
|
11
|
+
token: Address;
|
|
12
|
+
factory: Address;
|
|
13
|
+
launcher: Address;
|
|
14
|
+
/** rules, pools, calls, lever, flap, sticky, ... */
|
|
15
|
+
mode: string;
|
|
16
|
+
creator: Address;
|
|
17
|
+
createdAt: number;
|
|
18
|
+
block?: number;
|
|
19
|
+
tx?: Hex;
|
|
20
|
+
name: string;
|
|
21
|
+
symbol: string;
|
|
22
|
+
image?: string;
|
|
23
|
+
pool?: string;
|
|
24
|
+
pair?: Address;
|
|
25
|
+
rules?: {
|
|
26
|
+
kind: number;
|
|
27
|
+
name: string;
|
|
28
|
+
text: string;
|
|
29
|
+
}[];
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
export type LaunchFeed = {
|
|
33
|
+
launches: Launch[];
|
|
34
|
+
factories?: unknown[];
|
|
35
|
+
[k: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
export declare function apiModule(ctx: Ctx): {
|
|
38
|
+
get: <T>(path: string, query?: Record<string, string | number | undefined>) => Promise<T>;
|
|
39
|
+
/** every coin, newest first; poll with since = the newest createdAt you have, page back with before */
|
|
40
|
+
launches: (o?: {
|
|
41
|
+
since?: number;
|
|
42
|
+
before?: number;
|
|
43
|
+
limit?: number;
|
|
44
|
+
}) => Promise<LaunchFeed>;
|
|
45
|
+
/** one coin by any of its addresses (token, pool, pair) */
|
|
46
|
+
launch: (address: Address) => Promise<Launch>;
|
|
47
|
+
/** the board's coins; board: 1 adds lever, calls and find the dev coins */
|
|
48
|
+
coins: (o?: {
|
|
49
|
+
board?: 1;
|
|
50
|
+
}) => Promise<unknown>;
|
|
51
|
+
/** buybacks, burns, jackpots and launches, newest first */
|
|
52
|
+
activity: (o?: {
|
|
53
|
+
kind?: string;
|
|
54
|
+
limit?: number;
|
|
55
|
+
}) => Promise<unknown>;
|
|
56
|
+
/** $hooks: buybacks and burns of the pad's fees */
|
|
57
|
+
official: () => Promise<unknown>;
|
|
58
|
+
burners: () => Promise<unknown>;
|
|
59
|
+
/** the building blocks catalog as the site serves it (the same object as ph.blocks.catalog(), offline) */
|
|
60
|
+
blocks: () => Promise<BlocksCatalog>;
|
|
61
|
+
};
|
|
62
|
+
export type ApiModule = ReturnType<typeof apiModule>;
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PickhooksError } from "./errors.js";
|
|
2
|
+
export function apiModule(ctx) {
|
|
3
|
+
async function get(path, query = {}) {
|
|
4
|
+
const q = Object.entries(query)
|
|
5
|
+
.filter(([, v]) => v !== undefined && v !== "")
|
|
6
|
+
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
|
|
7
|
+
.join("&");
|
|
8
|
+
const res = await fetch(`${ctx.site}${path}${q ? `?${q}` : ""}`, { headers: { accept: "application/json" } });
|
|
9
|
+
const j = (await res.json().catch(() => null));
|
|
10
|
+
if (!res.ok || j === null)
|
|
11
|
+
throw new PickhooksError(j?.error ?? `${path} answered ${res.status}.`, { code: res.status === 429 ? "rate" : "site" });
|
|
12
|
+
return j;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
get,
|
|
16
|
+
/** every coin, newest first; poll with since = the newest createdAt you have, page back with before */
|
|
17
|
+
launches: (o = {}) => get("/api/launches", o),
|
|
18
|
+
/** one coin by any of its addresses (token, pool, pair) */
|
|
19
|
+
launch: (address) => get(`/api/launches/${address}`),
|
|
20
|
+
/** the board's coins; board: 1 adds lever, calls and find the dev coins */
|
|
21
|
+
coins: (o = {}) => get("/api/coins", o),
|
|
22
|
+
/** buybacks, burns, jackpots and launches, newest first */
|
|
23
|
+
activity: (o = {}) => get("/api/activity", o),
|
|
24
|
+
/** $hooks: buybacks and burns of the pad's fees */
|
|
25
|
+
official: () => get("/api/official"),
|
|
26
|
+
burners: () => get("/api/burners"),
|
|
27
|
+
/** the building blocks catalog as the site serves it (the same object as ph.blocks.catalog(), offline) */
|
|
28
|
+
blocks: () => get("/api/blocks"),
|
|
29
|
+
};
|
|
30
|
+
}
|
package/dist/blocks.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { STICKY_LIMITS } from "./sticky-rules.js";
|
|
2
|
+
export declare const BLOCKS_VERSION = 1;
|
|
3
|
+
export type BlockParam = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
unit: string;
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
step: number;
|
|
10
|
+
default: number;
|
|
11
|
+
hint: string;
|
|
12
|
+
};
|
|
13
|
+
export type Block = {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
/** the block in a sentence, its numbers as {key} */
|
|
17
|
+
line: string;
|
|
18
|
+
/** the same sentence with the default numbers */
|
|
19
|
+
example: string;
|
|
20
|
+
/** the rule moves with the coins to every wallet */
|
|
21
|
+
sticky: boolean;
|
|
22
|
+
/** the block gives buyers something (the pot blocks) */
|
|
23
|
+
gives: boolean;
|
|
24
|
+
/** what token scanners show: green nothing, yellow a warning, red a refused test sell at times */
|
|
25
|
+
scanner: "green" | "yellow" | "red";
|
|
26
|
+
scannerNote: string;
|
|
27
|
+
params: BlockParam[];
|
|
28
|
+
/** the rows it adds to a coin's table at the default numbers, as the coin page reads them */
|
|
29
|
+
rows: string[];
|
|
30
|
+
};
|
|
31
|
+
export type GrammarItem = {
|
|
32
|
+
id: number;
|
|
33
|
+
name: string;
|
|
34
|
+
text: string;
|
|
35
|
+
};
|
|
36
|
+
export type BlockAction = GrammarItem & {
|
|
37
|
+
buysOnly: boolean;
|
|
38
|
+
arg: string;
|
|
39
|
+
};
|
|
40
|
+
export type BlockVariable = {
|
|
41
|
+
id: number;
|
|
42
|
+
name: string;
|
|
43
|
+
unit: string;
|
|
44
|
+
lotOnly: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type CoinRuleField = {
|
|
47
|
+
id: string;
|
|
48
|
+
label: string;
|
|
49
|
+
kind: string;
|
|
50
|
+
min?: number;
|
|
51
|
+
max?: number;
|
|
52
|
+
default?: number | boolean;
|
|
53
|
+
hint?: string;
|
|
54
|
+
options?: {
|
|
55
|
+
value: number;
|
|
56
|
+
label: string;
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
59
|
+
export type CoinRuleBlock = {
|
|
60
|
+
kind: number;
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
alias?: string;
|
|
64
|
+
group: string;
|
|
65
|
+
line: string;
|
|
66
|
+
scanner: "green" | "yellow" | "red";
|
|
67
|
+
scannerNote: string;
|
|
68
|
+
fields: CoinRuleField[];
|
|
69
|
+
};
|
|
70
|
+
export type BlocksCatalog = {
|
|
71
|
+
version: number;
|
|
72
|
+
sticky: {
|
|
73
|
+
about: string;
|
|
74
|
+
promises: string[];
|
|
75
|
+
limits: Record<keyof typeof STICKY_LIMITS, number>;
|
|
76
|
+
blocks: Block[];
|
|
77
|
+
script: {
|
|
78
|
+
about: string;
|
|
79
|
+
triggers: GrammarItem[];
|
|
80
|
+
actions: BlockAction[];
|
|
81
|
+
marks: GrammarItem[];
|
|
82
|
+
variables: BlockVariable[];
|
|
83
|
+
operators: GrammarItem[];
|
|
84
|
+
checks: string[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
coinRules: {
|
|
88
|
+
about: string;
|
|
89
|
+
perCoin: number;
|
|
90
|
+
groups: {
|
|
91
|
+
id: string;
|
|
92
|
+
title: string;
|
|
93
|
+
blurb: string;
|
|
94
|
+
}[];
|
|
95
|
+
rules: CoinRuleBlock[];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
/** A block's numbers for its sentence. Drip's {big} is a phrase, like in the launcher; pass the site's t() to translate it. */
|
|
99
|
+
export declare function blockLineVars(id: string, p: Record<string, number>, phrase?: (s: string, v: Record<string, number>) => string): Record<string, string | number>;
|
|
100
|
+
export declare const BLOCK_TRIGGERS: GrammarItem[];
|
|
101
|
+
export declare const BLOCK_ACTIONS: BlockAction[];
|
|
102
|
+
export declare const BLOCK_MARKS: GrammarItem[];
|
|
103
|
+
export declare const BLOCK_OPERATORS: GrammarItem[];
|
|
104
|
+
/** the editor's own sentences (sticky-rules rowProblems / tableProblems, the launcher), so the site's translations apply */
|
|
105
|
+
export declare const BLOCK_CHECKS: string[];
|
|
106
|
+
/** The whole catalog. Plain data: JSON for the API, the same object in the SDK. */
|
|
107
|
+
export declare function blocksCatalog(): BlocksCatalog;
|
package/dist/blocks.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Copied from web/src/lib/blocks.ts (the building blocks catalog the site serves at /api/blocks), with its two imports pointed
|
|
2
|
+
// at the SDK's copies. Keep the two in step: node scripts/check-rules-copy.mjs compares them.
|
|
3
|
+
// The pickhooks building blocks as data, for /api/blocks, the /blocks page and @pickhooks/sdk (a copy: sdk/src/blocks.ts,
|
|
4
|
+
// checked by sdk/scripts/check-rules-copy.mjs). Built from the sources the launchers use, so it cannot drift: the ready
|
|
5
|
+
// blocks of sticky rules (TEMPLATES), the hook script grammar for your own rows (triggers, actions, marks, variables,
|
|
6
|
+
// operators, the checks the editor and the validator on chain run), and the rule book of coins with rules.
|
|
7
|
+
import { GROUPS_SHOWN, MAX_RULES, RULES_SHOWN } from "./coin-rules.js";
|
|
8
|
+
import { ACT, FLAG, ON, OP, STICKY_LIMITS, TEMPLATES, VARS, defaults, rowText } from "./sticky-rules.js";
|
|
9
|
+
export const BLOCKS_VERSION = 1;
|
|
10
|
+
const fill = (line, p) => line.replace(/\{(\w+)\}/g, (all, k) => (k in p ? String(p[k]) : all));
|
|
11
|
+
/** A block's numbers for its sentence. Drip's {big} is a phrase, like in the launcher; pass the site's t() to translate it. */
|
|
12
|
+
export function blockLineVars(id, p, phrase = fill) {
|
|
13
|
+
if (id !== "drip")
|
|
14
|
+
return p;
|
|
15
|
+
return { ...p, big: p.big > 0 ? phrase(" of {pct} % of the supply or more", { pct: p.big }) : "" };
|
|
16
|
+
}
|
|
17
|
+
function fieldOf(f) {
|
|
18
|
+
const out = { id: f.id, label: f.label, kind: f.kind };
|
|
19
|
+
if ("min" in f && f.min !== undefined)
|
|
20
|
+
out.min = f.min;
|
|
21
|
+
if ("max" in f && f.max !== undefined)
|
|
22
|
+
out.max = f.max;
|
|
23
|
+
if ("def" in f)
|
|
24
|
+
out.default = f.def;
|
|
25
|
+
if (f.hint)
|
|
26
|
+
out.hint = f.hint;
|
|
27
|
+
if (f.kind === "choice")
|
|
28
|
+
out.options = f.options;
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
export const BLOCK_TRIGGERS = [
|
|
32
|
+
{ id: ON.BUY, name: "buy", text: "Coins leave one of the coin's pools to a wallet." },
|
|
33
|
+
{ id: ON.SELL, name: "sell", text: "Coins go into one of the coin's pools." },
|
|
34
|
+
{ id: ON.SEND, name: "send", text: "Coins move from one wallet to another. A row can watch several: buy, sell and send add up (3 = buy or sell)." },
|
|
35
|
+
];
|
|
36
|
+
export const BLOCK_ACTIONS = [
|
|
37
|
+
{ id: ACT.DENY, name: "deny", text: "Refuses the trade.", buysOnly: false, arg: "none" },
|
|
38
|
+
{ id: ACT.FLAG, name: "mark", text: "Marks the coins the buy brings. The mark travels with the coins to every wallet.", buysOnly: true, arg: "the mark: 1 sniper, 2 marked, 3 both" },
|
|
39
|
+
{ id: ACT.LOCK, name: "lock", text: "A share of the buy unlocks over the coin's release time.", buysOnly: true, arg: "0.01 to 100 % of the buy, in basis points" },
|
|
40
|
+
{ id: ACT.BURN, name: "burn", text: "Burns a share of the buy.", buysOnly: true, arg: "0.01 to 10 % of the buy, in basis points" },
|
|
41
|
+
{ id: ACT.POT, name: "pot", text: "Puts a share of the buy into the coin's pot.", buysOnly: true, arg: "0.01 to 10 % of the buy, in basis points" },
|
|
42
|
+
{ id: ACT.DROP, name: "drop", text: "Pays the buyer a share of the pot, up to as many coins as it buys. Never the creator's buys.", buysOnly: true, arg: "0.01 to 100 % of the pot, in basis points" },
|
|
43
|
+
];
|
|
44
|
+
export const BLOCK_MARKS = [
|
|
45
|
+
{ id: FLAG.SNIPER, name: "sniper", text: "Set by a mark row, usually on buys in the first blocks." },
|
|
46
|
+
{ id: FLAG.MARK, name: "marked", text: "Set by a mark row, for any condition you pick." },
|
|
47
|
+
{ id: FLAG.DEV, name: "the creator's", text: "Set by the coin on the creator's coins. Rows can ask for it or exclude it." },
|
|
48
|
+
];
|
|
49
|
+
export const BLOCK_OPERATORS = [
|
|
50
|
+
{ id: OP.LT, name: "under", text: "The variable is under the number." },
|
|
51
|
+
{ id: OP.GE, name: "at least", text: "The variable is the number or more." },
|
|
52
|
+
{ id: OP.HAS, name: "has", text: "The coins carry the mark." },
|
|
53
|
+
{ id: OP.NOT, name: "not", text: "The coins do not carry the mark (only with the creator's mark)." },
|
|
54
|
+
{ id: OP.MODLT, name: "inside a window", text: "A clock that repeats: inside the first part of every period (time since launch, a period of at most a day), or every n-th buy (buys)." },
|
|
55
|
+
{ id: OP.MODGE, name: "outside a window", text: "The rest of each period, or the buys between." },
|
|
56
|
+
];
|
|
57
|
+
/** the editor's own sentences (sticky-rules rowProblems / tableProblems, the launcher), so the site's translations apply */
|
|
58
|
+
export const BLOCK_CHECKS = [
|
|
59
|
+
`At most ${STICKY_LIMITS.maxRows} rows per coin, fixed at launch.`,
|
|
60
|
+
"Mark, lock, burn, pot and drop work on buys only.",
|
|
61
|
+
`Burn and pot: at most ${STICKY_LIMITS.maxTakePct} % of a buy together.`,
|
|
62
|
+
"A pot needs a drop row that pays it out.",
|
|
63
|
+
"A row that stops sells or sends must let go by itself: the coins' age or the time since launch up to 7 days, blocks since launch up to 1,000,000, a size from 0.05 % of the supply on, the creator's coins only, or a clock (one window, hours, weekdays).",
|
|
64
|
+
"One sell window at most, and not next to rows on hours or weekdays.",
|
|
65
|
+
"The rows on hours close every hour of the day: leave one open.",
|
|
66
|
+
"The rows on weekdays close every day: leave one open.",
|
|
67
|
+
`Locked shares: unlock over ${STICKY_LIMITS.minReleaseMinutes} minutes to ${STICKY_LIMITS.maxReleaseDays} days.`,
|
|
68
|
+
"The validator on chain runs the same checks on every table at launch.",
|
|
69
|
+
];
|
|
70
|
+
/** The whole catalog. Plain data: JSON for the API, the same object in the SDK. */
|
|
71
|
+
export function blocksCatalog() {
|
|
72
|
+
const blocks = TEMPLATES.map((t) => {
|
|
73
|
+
const p = defaults(t);
|
|
74
|
+
const release = t.release?.(p) ?? 0;
|
|
75
|
+
return {
|
|
76
|
+
id: t.id,
|
|
77
|
+
name: t.name,
|
|
78
|
+
line: t.line,
|
|
79
|
+
example: fill(t.line, blockLineVars(t.id, p)),
|
|
80
|
+
sticky: t.sticky,
|
|
81
|
+
gives: !!t.gives,
|
|
82
|
+
scanner: t.scanner,
|
|
83
|
+
scannerNote: t.scannerNote ?? "",
|
|
84
|
+
params: t.params.map((q) => ({ key: q.key, label: q.label, unit: q.unit, min: q.min, max: q.max, step: q.step, default: q.def, hint: q.hint })),
|
|
85
|
+
rows: t.rows(p).map((r) => rowText(r, release)),
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
return {
|
|
89
|
+
version: BLOCKS_VERSION,
|
|
90
|
+
sticky: {
|
|
91
|
+
about: "Sticky rules: rows a coin checks on every buy, sell and send. They look at each lot of coins, not at the wallet, so a rule moves with the coins to every wallet. Ready blocks set the rows from a few numbers; hook script writes your own.",
|
|
92
|
+
promises: [
|
|
93
|
+
`Every lot can be sold once it is ${STICKY_LIMITS.exitDays} days old, whatever the rows say.`,
|
|
94
|
+
"Sells and sends are never taxed.",
|
|
95
|
+
"After launch the creator can lift a row for good, never add one.",
|
|
96
|
+
],
|
|
97
|
+
limits: { ...STICKY_LIMITS },
|
|
98
|
+
blocks,
|
|
99
|
+
script: {
|
|
100
|
+
about: "A row is a trigger, an action with its number, and up to 4 conditions that must all hold. The coin goes through its rows in order on every transfer; the first row that refuses stops it.",
|
|
101
|
+
triggers: BLOCK_TRIGGERS,
|
|
102
|
+
actions: BLOCK_ACTIONS,
|
|
103
|
+
marks: BLOCK_MARKS,
|
|
104
|
+
variables: VARS.map((v) => ({ id: v.v, name: v.label, unit: v.unit, lotOnly: !!v.lotOnly })),
|
|
105
|
+
operators: BLOCK_OPERATORS,
|
|
106
|
+
checks: BLOCK_CHECKS,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
coinRules: {
|
|
110
|
+
about: "Coins with rules: up to eight rules from the rule book live in the coin and apply to every transfer with its pool.",
|
|
111
|
+
perCoin: MAX_RULES,
|
|
112
|
+
groups: GROUPS_SHOWN.map((g) => ({ id: g.id, title: g.title, blurb: g.blurb })),
|
|
113
|
+
rules: RULES_SHOWN.map((r) => ({
|
|
114
|
+
kind: r.kind,
|
|
115
|
+
id: r.id,
|
|
116
|
+
name: r.name,
|
|
117
|
+
...(r.alias ? { alias: r.alias } : {}),
|
|
118
|
+
group: r.group,
|
|
119
|
+
line: r.line,
|
|
120
|
+
scanner: r.scanner.level,
|
|
121
|
+
scannerNote: r.scanner.note,
|
|
122
|
+
fields: r.fields.map(fieldOf),
|
|
123
|
+
})),
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the copied rule catalog (coin-rules.ts) reads from the site's config: the v2 factory (the catalog shows the eight
|
|
3
|
+
* v2 rules when it is set) and the Chainlink USD feeds the v2 validator accepts for "sells at" (8 decimals).
|
|
4
|
+
*/
|
|
5
|
+
export declare const V2: {
|
|
6
|
+
readonly factory: `0x${string}`;
|
|
7
|
+
readonly feeds: Record<string, `0x${string}`>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the copied rule catalog (coin-rules.ts) reads from the site's config: the v2 factory (the catalog shows the eight
|
|
3
|
+
* v2 rules when it is set) and the Chainlink USD feeds the v2 validator accepts for "sells at" (8 decimals).
|
|
4
|
+
*/
|
|
5
|
+
export const V2 = {
|
|
6
|
+
factory: "0x23cC366e1DDBc41CFD70011C4AaC14B79998B24F",
|
|
7
|
+
feeds: {
|
|
8
|
+
BNB: "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
|
|
9
|
+
BTC: "0x264990fbd0A4796A3E3d8E37C4d5F87a3aCa5Ebf",
|
|
10
|
+
ETH: "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e",
|
|
11
|
+
DOGE: "0x3AB0A0d137D4F946fBB19eecc6e92E64660231C8",
|
|
12
|
+
},
|
|
13
|
+
};
|