@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.
- package/LICENSE +21 -0
- package/README.md +418 -3
- package/dist/abis/agents.d.ts +2418 -0
- package/dist/abis/agents.js +4 -0
- 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 +14 -0
- package/dist/abis/index.js +14 -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/sticky2.d.ts +3750 -0
- package/dist/abis/sticky2.js +8 -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 +100 -0
- package/dist/addresses.js +71 -0
- package/dist/agents-catalog.d.ts +318 -0
- package/dist/agents-catalog.js +353 -0
- package/dist/agents.d.ts +543 -0
- package/dist/agents.js +667 -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/desks.d.ts +298 -0
- package/dist/desks.js +343 -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 +414 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.js +91 -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-sim.d.ts +125 -0
- package/dist/sticky-sim.js +637 -0
- package/dist/sticky.d.ts +286 -0
- package/dist/sticky.js +420 -0
- package/dist/tlock.d.ts +67 -0
- package/dist/tlock.js +185 -0
- package/dist/tx.d.ts +72 -0
- package/dist/tx.js +78 -0
- package/dist/v2.d.ts +106 -0
- package/dist/v2.js +61 -0
- package/dist/v3.d.ts +42 -0
- package/dist/v3.js +98 -0
- package/dist/wallet.d.ts +80 -0
- package/dist/wallet.js +115 -0
- package/dist/watch.d.ts +82 -0
- package/dist/watch.js +194 -0
- package/package.json +67 -4
package/dist/watch.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
import type { AgentsModule } from "./agents.js";
|
|
3
|
+
import type { AnyModule } from "./any.js";
|
|
4
|
+
import type { CoinsModule } from "./coins.js";
|
|
5
|
+
import type { CallsModule, PoolsModule } from "./pools.js";
|
|
6
|
+
import type { StickyModule } from "./sticky.js";
|
|
7
|
+
import type { Ctx } from "./tx.js";
|
|
8
|
+
/**
|
|
9
|
+
* Live events, for terminals and bots: every launch on the pad, every trade of a coin, everything that happens to an
|
|
10
|
+
* agent coin. Each watcher polls the RPC (HTTP is enough) and returns a function that stops it.
|
|
11
|
+
*
|
|
12
|
+
* const stop = ph.watch.launches((l) => console.log(l.mode, l.symbol, l.token));
|
|
13
|
+
* const stop2 = await ph.watch.trades(token, (t) => console.log(t.buy ? "buy" : "sell", t.bnb, t.coins));
|
|
14
|
+
* const stop3 = await ph.watch.agent(token, (e) => console.log(e.event, e.args));
|
|
15
|
+
*/
|
|
16
|
+
export type WatchMode = "sticky" | "sticky2" | "rules" | "rules-v1" | "pools" | "calls" | "lever" | "agents" | "any";
|
|
17
|
+
export type WatchedLaunch = {
|
|
18
|
+
mode: WatchMode;
|
|
19
|
+
token: Address;
|
|
20
|
+
creator: Address;
|
|
21
|
+
/** read from the token when `details` is on (default) */
|
|
22
|
+
name: string;
|
|
23
|
+
symbol: string;
|
|
24
|
+
/** the V3 pool and V2 pair (sticky, rules), the Infinity pool id (pools, calls, lever, agents, any) */
|
|
25
|
+
pool?: Address;
|
|
26
|
+
pair?: Address;
|
|
27
|
+
poolId?: Hex;
|
|
28
|
+
factory: Address;
|
|
29
|
+
block: bigint;
|
|
30
|
+
tx: Hex;
|
|
31
|
+
/** the raw event as viem decoded it */
|
|
32
|
+
args: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
export type WatchedTrade = {
|
|
35
|
+
token: Address;
|
|
36
|
+
buy: boolean;
|
|
37
|
+
/** the trader where the event names one (the hooks do; V3 and V2 name the router's sender and the recipient) */
|
|
38
|
+
trader: Address | null;
|
|
39
|
+
/** coins moved (18 decimals), BNB moved (wei); the hooks' events carry the fee or the BNB, the pools' Swap both sides */
|
|
40
|
+
coins: bigint;
|
|
41
|
+
bnb: bigint | null;
|
|
42
|
+
/** the hook's fee in BNB (pools, calls, agents) */
|
|
43
|
+
fee: bigint | null;
|
|
44
|
+
/** v3, v2 (PancakeSwap pools of sticky and rules coins), or the hook's event (pools, calls, agents, any) */
|
|
45
|
+
source: "v3" | "v2" | "hook";
|
|
46
|
+
block: bigint;
|
|
47
|
+
tx: Hex;
|
|
48
|
+
};
|
|
49
|
+
export type AgentEvent = {
|
|
50
|
+
token: Address;
|
|
51
|
+
/** Proposed, Cancelled, Activated, Vetoed, VetoBacked, FireBacked, PilotFired, PilotHandedOver, Locked, Withdrawn, TreasuryMoved (desk); Burned, LiquidityAdded, FloorFed, Moved, Given, ProgramSet, JackpotWon, RewardEarned, Traded (hook) */
|
|
52
|
+
event: string;
|
|
53
|
+
args: Record<string, unknown>;
|
|
54
|
+
block: bigint;
|
|
55
|
+
tx: Hex;
|
|
56
|
+
};
|
|
57
|
+
export type WatchOptions = {
|
|
58
|
+
/** ms between polls (default 3000, about one BNB Chain block) */
|
|
59
|
+
pollingInterval?: number;
|
|
60
|
+
/** errors of the poll (an RPC hiccup); default: ignored, the next poll tries again */
|
|
61
|
+
onError?: (e: Error) => void;
|
|
62
|
+
};
|
|
63
|
+
type Mods = {
|
|
64
|
+
sticky: StickyModule;
|
|
65
|
+
sticky2: StickyModule;
|
|
66
|
+
coins: CoinsModule;
|
|
67
|
+
pools: PoolsModule;
|
|
68
|
+
calls: CallsModule;
|
|
69
|
+
agents: AgentsModule;
|
|
70
|
+
any: AnyModule;
|
|
71
|
+
};
|
|
72
|
+
export declare function watchModule(ctx: Ctx, mods: Mods): {
|
|
73
|
+
launches: (cb: (l: WatchedLaunch) => void, o?: WatchOptions & {
|
|
74
|
+
modes?: WatchMode[];
|
|
75
|
+
details?: boolean;
|
|
76
|
+
}) => () => void;
|
|
77
|
+
trades: (token: Address, cb: (t: WatchedTrade) => void, o?: WatchOptions) => Promise<() => void>;
|
|
78
|
+
agent: (token: Address, cb: (e: AgentEvent) => void, o?: WatchOptions) => Promise<() => void>;
|
|
79
|
+
modes: WatchMode[];
|
|
80
|
+
};
|
|
81
|
+
export type WatchModule = ReturnType<typeof watchModule>;
|
|
82
|
+
export {};
|
package/dist/watch.js
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { isAddressEqual, parseAbi } from "viem";
|
|
2
|
+
import { agentsDeskAbi, agentsFactoryAbi, agentsHookAbi } from "./abis/agents.js";
|
|
3
|
+
import { any3FactoryAbi, any3HookAbi } from "./abis/any3.js";
|
|
4
|
+
import { callsFactoryAbi, callsHookAbi } from "./abis/calls.js";
|
|
5
|
+
import { lever2FactoryAbi } from "./abis/lever2.js";
|
|
6
|
+
import { poolsFactoryAbi, poolsHookAbi } from "./abis/pools.js";
|
|
7
|
+
import { stickyFactoryAbi } from "./abis/sticky.js";
|
|
8
|
+
import { sticky2FactoryAbi } from "./abis/sticky2.js";
|
|
9
|
+
import { v1FactoryAbi } from "./abis/v1.js";
|
|
10
|
+
import { v2FactoryAbi } from "./abis/v2.js";
|
|
11
|
+
import { ZERO_ADDRESS } from "./addresses.js";
|
|
12
|
+
import { PickhooksError } from "./errors.js";
|
|
13
|
+
const v3SwapAbi = parseAbi([
|
|
14
|
+
"event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1)",
|
|
15
|
+
]);
|
|
16
|
+
const v2SwapAbi = parseAbi(["event Swap(address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to)"]);
|
|
17
|
+
const PLAIN = parseAbi(["function name() view returns (string)", "function symbol() view returns (string)"]);
|
|
18
|
+
export function watchModule(ctx, mods) {
|
|
19
|
+
const { pub, a } = ctx;
|
|
20
|
+
const abs = (v) => (v < 0n ? -v : v);
|
|
21
|
+
const factories = [
|
|
22
|
+
{ mode: "sticky", address: a.stickyFactory, abi: stickyFactoryAbi, event: "Launched" },
|
|
23
|
+
{ mode: "sticky2", address: a.sticky2Factory, abi: sticky2FactoryAbi, event: "Launched" },
|
|
24
|
+
{ mode: "rules", address: a.coinsV2Factory, abi: v2FactoryAbi, event: "Launched" },
|
|
25
|
+
{ mode: "rules-v1", address: a.coinsV1Factory, abi: v1FactoryAbi, event: "Launched" },
|
|
26
|
+
{ mode: "pools", address: a.poolsFactory, abi: poolsFactoryAbi, event: "Launched" },
|
|
27
|
+
{ mode: "calls", address: a.callsFactory, abi: callsFactoryAbi, event: "Launched" },
|
|
28
|
+
{ mode: "lever", address: a.lever2Factory, abi: lever2FactoryAbi, event: "Launched" },
|
|
29
|
+
{ mode: "agents", address: a.agentsFactory, abi: agentsFactoryAbi, event: "Launched" },
|
|
30
|
+
{ mode: "any", address: a.anyFactory, abi: any3FactoryAbi, event: "Opened" },
|
|
31
|
+
];
|
|
32
|
+
const watch = (p, o) => pub.watchContractEvent({
|
|
33
|
+
address: p.address,
|
|
34
|
+
abi: p.abi,
|
|
35
|
+
eventName: p.eventName,
|
|
36
|
+
args: p.args,
|
|
37
|
+
onLogs: p.onLogs,
|
|
38
|
+
onError: o.onError ?? (() => undefined),
|
|
39
|
+
poll: true,
|
|
40
|
+
pollingInterval: o.pollingInterval ?? 3000,
|
|
41
|
+
strict: false,
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Every new coin on the pad (and every new hook any coin pool), as it is mined. `modes` narrows it; `details` reads
|
|
45
|
+
* name and symbol from the token (one multicall per batch).
|
|
46
|
+
*/
|
|
47
|
+
function launches(cb, o = {}) {
|
|
48
|
+
const wanted = factories.filter((f) => !isAddressEqual(f.address, ZERO_ADDRESS) && (!o.modes || o.modes.includes(f.mode)));
|
|
49
|
+
const stops = wanted.map((f) => watch({
|
|
50
|
+
address: f.address,
|
|
51
|
+
abi: f.abi,
|
|
52
|
+
eventName: f.event,
|
|
53
|
+
onLogs: async (logs) => {
|
|
54
|
+
const rows = logs.map((log) => {
|
|
55
|
+
const args = (log.args ?? {});
|
|
56
|
+
return {
|
|
57
|
+
mode: f.mode,
|
|
58
|
+
token: args.token,
|
|
59
|
+
creator: (args.creator ?? args.opener),
|
|
60
|
+
name: "",
|
|
61
|
+
symbol: "",
|
|
62
|
+
pool: args.pool,
|
|
63
|
+
pair: args.pair,
|
|
64
|
+
poolId: (args.poolId ?? args.id),
|
|
65
|
+
factory: f.address,
|
|
66
|
+
block: log.blockNumber ?? 0n,
|
|
67
|
+
tx: log.transactionHash ?? "0x",
|
|
68
|
+
args,
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
if (o.details !== false && rows.length) {
|
|
72
|
+
const meta = await pub
|
|
73
|
+
.multicall({ contracts: rows.flatMap((r) => [{ address: r.token, abi: PLAIN, functionName: "name" }, { address: r.token, abi: PLAIN, functionName: "symbol" }]), allowFailure: true })
|
|
74
|
+
.catch(() => null);
|
|
75
|
+
if (meta)
|
|
76
|
+
rows.forEach((r, i) => Object.assign(r, { name: meta[i * 2].status === "success" ? String(meta[i * 2].result) : "", symbol: meta[i * 2 + 1].status === "success" ? String(meta[i * 2 + 1].result) : "" }));
|
|
77
|
+
}
|
|
78
|
+
for (const r of rows)
|
|
79
|
+
cb(r);
|
|
80
|
+
},
|
|
81
|
+
}, o));
|
|
82
|
+
return () => stops.forEach((s) => s());
|
|
83
|
+
}
|
|
84
|
+
/** The hooks' Traded(id, trader, buy, tokens, fee|bnb) for a set of pool ids on one hook. */
|
|
85
|
+
const hookTrades = (token, hook, abi, ids, bnbField, cb, o) => watch({
|
|
86
|
+
address: hook,
|
|
87
|
+
abi,
|
|
88
|
+
eventName: "Traded",
|
|
89
|
+
args: { id: ids },
|
|
90
|
+
onLogs: (logs) => {
|
|
91
|
+
for (const log of logs) {
|
|
92
|
+
const g = (log.args ?? {});
|
|
93
|
+
cb({
|
|
94
|
+
token,
|
|
95
|
+
buy: Boolean(g.buy),
|
|
96
|
+
trader: g.trader ?? null,
|
|
97
|
+
coins: g.tokens,
|
|
98
|
+
bnb: bnbField === "bnb" ? g.bnb : null,
|
|
99
|
+
fee: bnbField === "fee" ? g.fee : null,
|
|
100
|
+
source: "hook",
|
|
101
|
+
block: log.blockNumber ?? 0n,
|
|
102
|
+
tx: log.transactionHash ?? "0x",
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
}, o);
|
|
107
|
+
/** A PancakeSwap V3 pool's and V2 pair's Swap events of a coin (sticky and rules coins trade there). */
|
|
108
|
+
const pancakeTrades = (token, pool, pair, cb, o) => {
|
|
109
|
+
// the coin is token0 when its address sorts under WBNB's
|
|
110
|
+
const coinIs0 = token.toLowerCase() < a.wbnb.toLowerCase();
|
|
111
|
+
const stops = [
|
|
112
|
+
watch({
|
|
113
|
+
address: pool,
|
|
114
|
+
abi: v3SwapAbi,
|
|
115
|
+
eventName: "Swap",
|
|
116
|
+
onLogs: (logs) => {
|
|
117
|
+
for (const log of logs) {
|
|
118
|
+
const g = (log.args ?? {});
|
|
119
|
+
const coin = (coinIs0 ? g.amount0 : g.amount1);
|
|
120
|
+
const bnb = (coinIs0 ? g.amount1 : g.amount0);
|
|
121
|
+
// the pool's view: a negative coin amount left the pool, so someone bought
|
|
122
|
+
cb({ token, buy: coin < 0n, trader: g.recipient ?? null, coins: abs(coin), bnb: abs(bnb), fee: null, source: "v3", block: log.blockNumber ?? 0n, tx: log.transactionHash ?? "0x" });
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
}, o),
|
|
126
|
+
];
|
|
127
|
+
if (!isAddressEqual(pair, ZERO_ADDRESS)) {
|
|
128
|
+
stops.push(watch({
|
|
129
|
+
address: pair,
|
|
130
|
+
abi: v2SwapAbi,
|
|
131
|
+
eventName: "Swap",
|
|
132
|
+
onLogs: (logs) => {
|
|
133
|
+
for (const log of logs) {
|
|
134
|
+
const g = (log.args ?? {});
|
|
135
|
+
const coinOut = (coinIs0 ? g.amount0Out : g.amount1Out);
|
|
136
|
+
const coinIn = (coinIs0 ? g.amount0In : g.amount1In);
|
|
137
|
+
const bnbOut = (coinIs0 ? g.amount1Out : g.amount0Out);
|
|
138
|
+
const bnbIn = (coinIs0 ? g.amount1In : g.amount0In);
|
|
139
|
+
const buy = coinOut > 0n;
|
|
140
|
+
cb({ token, buy, trader: g.to ?? null, coins: buy ? coinOut : coinIn, bnb: buy ? bnbIn : bnbOut, fee: null, source: "v2", block: log.blockNumber ?? 0n, tx: log.transactionHash ?? "0x" });
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
}, o));
|
|
144
|
+
}
|
|
145
|
+
return () => stops.forEach((s) => s());
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Every trade of a pickhooks coin, whatever its mode: the hook's Traded events (pools, calls, agents, hook any coin
|
|
149
|
+
* pools next to the coin) or the Swap events of its PancakeSwap V3 pool and V2 pair (sticky, rules).
|
|
150
|
+
*/
|
|
151
|
+
async function trades(token, cb, o = {}) {
|
|
152
|
+
if (await mods.agents.isCoin(token))
|
|
153
|
+
return hookTrades(token, await mods.agents.hook(), agentsHookAbi, [(await mods.agents.coin(token)).id], "fee", cb, o);
|
|
154
|
+
if (await mods.pools.isCoin(token))
|
|
155
|
+
return hookTrades(token, await mods.pools.hook(), poolsHookAbi, [(await mods.pools.coin(token)).id], "fee", cb, o);
|
|
156
|
+
if (await mods.calls.isCoin(token))
|
|
157
|
+
return hookTrades(token, await mods.calls.hook(), callsHookAbi, [(await mods.calls.coin(token)).id], "fee", cb, o);
|
|
158
|
+
for (const s of [mods.sticky, mods.sticky2]) {
|
|
159
|
+
if (await s.isCoin(token).catch(() => false)) {
|
|
160
|
+
const c = (await s.coin(token));
|
|
161
|
+
return pancakeTrades(token, c.pool, c.pair, cb, o);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (await mods.coins.versionOf(token).catch(() => null)) {
|
|
165
|
+
const c = (await mods.coins.coin(token));
|
|
166
|
+
return pancakeTrades(token, c.pool, c.pair, cb, o);
|
|
167
|
+
}
|
|
168
|
+
const pools = await mods.any.poolsOf(token).catch(() => []);
|
|
169
|
+
if (pools.length) {
|
|
170
|
+
const stops = [...new Set(pools.map((p) => p.hook.toLowerCase()))].map((h) => hookTrades(token, h, any3HookAbi, pools.filter((p) => p.hook.toLowerCase() === h).map((p) => p.id), "bnb", cb, o));
|
|
171
|
+
return () => stops.forEach((s) => s());
|
|
172
|
+
}
|
|
173
|
+
throw new PickhooksError("This is not a coin pickhooks knows.", { code: "input" });
|
|
174
|
+
}
|
|
175
|
+
/** Everything that happens to an agent coin: the desk's events (changes, vetoes, firing, treasury moves) and the hook's runs. */
|
|
176
|
+
async function agent(token, cb, o = {}) {
|
|
177
|
+
if (!(await mods.agents.isCoin(token)))
|
|
178
|
+
throw new PickhooksError("This is not an agent coin.", { code: "input" });
|
|
179
|
+
const [hook, desk, c] = await Promise.all([mods.agents.hook(), mods.agents.desk(), mods.agents.coin(token)]);
|
|
180
|
+
const emit = (logs) => {
|
|
181
|
+
for (const log of logs) {
|
|
182
|
+
const l = log;
|
|
183
|
+
cb({ token, event: l.eventName ?? "", args: l.args ?? {}, block: log.blockNumber ?? 0n, tx: log.transactionHash ?? "0x" });
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const stops = [
|
|
187
|
+
watch({ address: desk, abi: agentsDeskAbi, args: { token }, onLogs: emit }, o),
|
|
188
|
+
watch({ address: hook, abi: agentsHookAbi, args: { token }, onLogs: emit }, o),
|
|
189
|
+
watch({ address: hook, abi: agentsHookAbi, eventName: "Traded", args: { id: c.id }, onLogs: emit }, o),
|
|
190
|
+
];
|
|
191
|
+
return () => stops.forEach((s) => s());
|
|
192
|
+
}
|
|
193
|
+
return { launches, trades, agent, modes: factories.filter((f) => !isAddressEqual(f.address, ZERO_ADDRESS)).map((f) => f.mode) };
|
|
194
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pickhooks/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Read, quote, trade and launch on pickhooks (BNB Chain) from a bot, a launchpad or a trading terminal. Built on viem.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./abis": {
|
|
15
|
+
"types": "./dist/abis/index.d.ts",
|
|
16
|
+
"import": "./dist/abis/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./rules": {
|
|
19
|
+
"types": "./dist/sticky-rules.d.ts",
|
|
20
|
+
"import": "./dist/sticky-rules.js"
|
|
21
|
+
},
|
|
22
|
+
"./coin-rules": {
|
|
23
|
+
"types": "./dist/coin-rules.d.ts",
|
|
24
|
+
"import": "./dist/coin-rules.js"
|
|
25
|
+
},
|
|
26
|
+
"./tlock": {
|
|
27
|
+
"types": "./dist/tlock.d.ts",
|
|
28
|
+
"import": "./dist/tlock.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"scripts": {
|
|
37
|
+
"abis": "node scripts/gen-abis.mjs",
|
|
38
|
+
"build": "node scripts/gen-abis.mjs && tsc -p tsconfig.json",
|
|
39
|
+
"check": "node scripts/check-rules-copy.mjs",
|
|
40
|
+
"test": "node --test test/unit.test.mjs",
|
|
41
|
+
"fork-proof": "node test/fork-proof.mjs",
|
|
42
|
+
"fork-proof-2": "node test/fork-proof-2.mjs",
|
|
43
|
+
"fork-proof-infra": "node test/fork-proof-infra.mjs",
|
|
44
|
+
"mainnet-read-agents": "node test/mainnet-read-agents.mjs",
|
|
45
|
+
"release": "node scripts/publish.mjs"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@noble/curves": "^1.9.1",
|
|
49
|
+
"@noble/hashes": "^1.8.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"viem": "^2.0.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"typescript": "^5.9.3",
|
|
56
|
+
"viem": "^2.57.2"
|
|
57
|
+
},
|
|
58
|
+
"keywords": [
|
|
59
|
+
"pickhooks",
|
|
60
|
+
"bnb-chain",
|
|
61
|
+
"pancakeswap",
|
|
62
|
+
"infinity",
|
|
63
|
+
"hooks",
|
|
64
|
+
"viem"
|
|
65
|
+
],
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=20"
|
|
68
|
+
}
|
|
69
|
+
}
|