hookr-sdk 0.2.1 → 1.1.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 +70 -0
- package/LICENSE +21 -0
- package/MIGRATING.md +89 -0
- package/README.md +308 -105
- package/dist/core/abi.d.ts +10930 -0
- package/dist/core/abi.js +455 -0
- package/dist/core/advisories.d.ts +184 -0
- package/dist/core/advisories.js +291 -0
- package/dist/core/client.d.ts +55 -0
- package/dist/core/client.js +107 -0
- package/dist/core/generated.d.ts +14295 -0
- package/dist/core/generated.js +1058 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.js +17 -0
- package/dist/core/launch.d.ts +200 -0
- package/dist/core/launch.js +427 -0
- package/dist/core/pair.d.ts +64 -0
- package/dist/core/pair.js +136 -0
- package/dist/core/params.d.ts +415 -0
- package/dist/core/params.js +1235 -0
- package/dist/core/policies.d.ts +136 -0
- package/dist/core/policies.js +125 -0
- package/dist/core/proofs.d.ts +25 -0
- package/dist/core/proofs.js +118 -0
- package/dist/core/quotes.d.ts +185 -0
- package/dist/core/quotes.js +550 -0
- package/dist/core/referrals.d.ts +32 -0
- package/dist/core/referrals.js +36 -0
- package/dist/core/registry.d.ts +357 -0
- package/dist/core/registry.js +378 -0
- package/dist/core/rules.d.ts +675 -0
- package/dist/core/rules.js +1049 -0
- package/dist/core/schema.d.ts +358 -0
- package/dist/core/schema.js +105 -0
- package/dist/core/stocks.generated.d.ts +11 -0
- package/dist/core/stocks.generated.js +1228 -0
- package/dist/core/vault.d.ts +59 -0
- package/dist/core/vault.js +112 -0
- package/dist/core/wallet.d.ts +142 -0
- package/dist/core/wallet.js +304 -0
- package/dist/deployments.d.ts +8 -0
- package/dist/deployments.js +26 -0
- package/dist/index.d.ts +42 -15
- package/dist/index.js +40 -15
- package/dist/releases.d.ts +219 -0
- package/dist/releases.js +365 -0
- package/dist/wallet-cap.d.ts +159 -0
- package/dist/wallet-cap.js +234 -0
- package/package.json +46 -10
- package/provenance.json +31 -0
- package/dist/abi.d.ts +0 -6404
- package/dist/abi.js +0 -8300
- package/dist/chain.d.ts +0 -87
- package/dist/chain.js +0 -86
- package/dist/claims.d.ts +0 -32
- package/dist/claims.js +0 -31
- package/dist/fees.d.ts +0 -59
- package/dist/fees.js +0 -142
- package/dist/links.d.ts +0 -48
- package/dist/links.js +0 -93
- package/dist/market.d.ts +0 -264
- package/dist/market.js +0 -310
- package/dist/reads.d.ts +0 -136
- package/dist/reads.js +0 -219
- package/dist/rules.d.ts +0 -84
- package/dist/rules.js +0 -296
- package/dist/swap.d.ts +0 -108
- package/dist/swap.js +0 -144
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet Cap: HookrRulesWalletCap (`rulesModule(HOOKR_1, "wallet-cap")`), the whole-pot Rules with a per-wallet buy
|
|
3
|
+
* cap on each launch while its pools' launch guards last.
|
|
4
|
+
*
|
|
5
|
+
* - The cap rides in `RulesConfig.potMinBuyQuote`, in the token's raw units: the most of it one wallet may buy while the
|
|
6
|
+
* pool's guard lasts. These Rules bind only a pool with a cap and a launch guard (`guardEndBlock` within the next
|
|
7
|
+
* 100,000 parent blocks), and `potEveryNBuys` stays zero. Every other Rules refuses a nonzero `potMinBuyQuote`, as the
|
|
8
|
+
* core's `checkRulesConfig` does.
|
|
9
|
+
* - Each guarded buy counts what it delivers (the pool's output less Auto Burn) against its wallet: the payer
|
|
10
|
+
* HookrRouter, the forwarder, the family router or the curated Uniswap router names, or for a swap through a router
|
|
11
|
+
* that names none, the transaction's signer. Counts are per token and per launch: the pools of one launch share
|
|
12
|
+
* `Bound.launchedAt`, the second they bound, and a later launch of the token counts from zero, so every pool of a
|
|
13
|
+
* launch takes the same cap, and arb recapture on every pool or none (`checkWalletCapLaunch`). A sell frees no room.
|
|
14
|
+
* The creator's dev buy and the pool's own arb recapture executor are not counted. A buy past the cap reverts
|
|
15
|
+
* `GuardWalletLimit(wallet, actual, limit)`. After the guard nothing is counted or capped.
|
|
16
|
+
* - The Rules answer `extsload(bytes32)`, one word of their storage, and `readWalletCap` reads through it.
|
|
17
|
+
*/
|
|
18
|
+
import { BaseError, decodeErrorResult, encodeAbiParameters, encodeFunctionData, getAddress, keccak256, numberToHex, parseAbi, } from "viem";
|
|
19
|
+
import { address, assert, checkRulesConfig, encodeRulesData, hash, rulesKnobsOf, rulesPoolTerms, uint, } from "./core/index.js";
|
|
20
|
+
import { HOOKR_1, rulesModule } from "./releases.js";
|
|
21
|
+
/**
|
|
22
|
+
* What HookrRulesWalletCap adds to the release Rules' ABI (`rulesAbi`): `extsload`, one word of its storage as Uniswap
|
|
23
|
+
* v4's Extsload reads it, and the refusal of a buy that would take a wallet past its pool's cap.
|
|
24
|
+
*/
|
|
25
|
+
export const WALLET_CAP_ABI = [
|
|
26
|
+
{
|
|
27
|
+
type: "function",
|
|
28
|
+
name: "extsload",
|
|
29
|
+
stateMutability: "view",
|
|
30
|
+
inputs: [{ name: "slot", type: "bytes32", internalType: "bytes32" }],
|
|
31
|
+
outputs: [{ name: "value", type: "bytes32", internalType: "bytes32" }],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "error",
|
|
35
|
+
name: "GuardWalletLimit",
|
|
36
|
+
inputs: [
|
|
37
|
+
{ name: "wallet", type: "address", internalType: "address" },
|
|
38
|
+
{ name: "actual", type: "uint256", internalType: "uint256" },
|
|
39
|
+
{ name: "limit", type: "uint256", internalType: "uint256" },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
/** erc7201:hookr.rules, every HookrRules' State: keccak256(abi.encode(uint256(keccak256("hookr.rules")) - 1)) & ~0xff. */
|
|
44
|
+
export const RULES_SLOT = 0x762913e4bc0f59f7b08c82f07586fa48932548ab5fab99e6db0b09765b4ff900n;
|
|
45
|
+
/** `State.bought`, the State's fourteenth field: what each wallet bought, per subject and launch. */
|
|
46
|
+
const BOUGHT = RULES_SLOT + 13n;
|
|
47
|
+
/** A slot as `extsload` takes it: 32 bytes, wrapping as the EVM's slot arithmetic does. */
|
|
48
|
+
const word = (n) => numberToHex(n & ((1n << 256n) - 1n), { size: 32 });
|
|
49
|
+
/** The slot of `key` in the mapping at `slot`: keccak256(abi.encode(key, slot)). */
|
|
50
|
+
const mapping = (keyType, key, slot) => BigInt(keccak256(encodeAbiParameters([{ type: keyType }, { type: "uint256" }], [key, slot])));
|
|
51
|
+
/**
|
|
52
|
+
* The slot of a pool's first Bound word, `State.pools[poolId]`: keccak256(abi.encode(poolId, RULES_SLOT)). Its launch
|
|
53
|
+
* guard's end is in the next slot (`uint40` of the word) and its cap two slots on (the top 128 bits).
|
|
54
|
+
*/
|
|
55
|
+
export function walletCapPoolSlot(poolId) {
|
|
56
|
+
return word(mapping("bytes32", hash(poolId), RULES_SLOT));
|
|
57
|
+
}
|
|
58
|
+
/** The slot of `wallet`'s count of `subject` on launch `launch`, `State.bought[subject][launch][wallet]`. */
|
|
59
|
+
export function walletCapBoughtSlot(subject, launch, wallet) {
|
|
60
|
+
const bySubject = mapping("address", address(subject), BOUGHT);
|
|
61
|
+
return word(mapping("address", address(wallet), mapping("uint256", uint(BigInt(launch), 32), bySubject)));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The launch in a pool's first Bound word: its top 32 bits, `Bound.launchedAt`. The word packs, low to high,
|
|
65
|
+
* baseFeePips (24 bits), tickSpacing (16), bound (8), quoteIsCurrency0 (8), terms (8), liquidityOwner (160) and
|
|
66
|
+
* launchedAt (32). Null for anything but 32 bytes of hex with the bound flag set: a pool these Rules never bound.
|
|
67
|
+
*/
|
|
68
|
+
export function walletCapLaunch(value) {
|
|
69
|
+
if (typeof value !== "string" || !/^0x[0-9a-fA-F]{64}$/.test(value))
|
|
70
|
+
return null;
|
|
71
|
+
const w = BigInt(value);
|
|
72
|
+
return ((w >> 40n) & 0xffn) === 1n ? Number(w >> 224n) : null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A pool's cap, in the token's raw units, for a share of `supply` (raw units) in basis points: the floor of
|
|
76
|
+
* supply × bps / 10,000, so 200 bps of a supply of 10^27 is 2 × 10^25. It goes in the pool's `rules.potMinBuyQuote`.
|
|
77
|
+
* Refuses a share outside 1 to 10,000 bps and a cap that rounds to zero. hookr.fun offers 0.1% to 10%, 2% by default.
|
|
78
|
+
*/
|
|
79
|
+
export function walletCapAmount(supply, bps) {
|
|
80
|
+
assert(typeof supply === "bigint" && supply > 0n, "Wallet Cap needs the token's supply in raw units");
|
|
81
|
+
const share = BigInt(bps);
|
|
82
|
+
assert(share >= 1n && share <= 10000n, `Wallet Cap share ${share} bps outside 1 to 10,000`);
|
|
83
|
+
const cap = (supply * share) / 10000n;
|
|
84
|
+
assert(cap > 0n, "Wallet Cap's share of this supply rounds to zero tokens");
|
|
85
|
+
return uint(cap, 128);
|
|
86
|
+
}
|
|
87
|
+
/** What a wallet may still buy while the guard lasts: the cap less what it bought, never below zero. */
|
|
88
|
+
export function walletCapRoom(cap, bought) {
|
|
89
|
+
return bought >= cap ? 0n : cap - bought;
|
|
90
|
+
}
|
|
91
|
+
/** The terms only the Wallet Cap Rules hold a pool to, and the parent block to check its guard against. */
|
|
92
|
+
function walletCapTerms(c, blockNumber) {
|
|
93
|
+
assert(typeof c.potMinBuyQuote === "bigint" && c.potMinBuyQuote > 0n, "Wallet Cap needs its cap in potMinBuyQuote: the most of the token, in raw units, one wallet may buy during the guard");
|
|
94
|
+
uint(c.potMinBuyQuote, 128);
|
|
95
|
+
assert(c.guardEndBlock !== 0, "Wallet Cap lasts as long as the launch guard: set guardEndBlock");
|
|
96
|
+
assert(blockNumber !== undefined, "Wallet Cap needs blockNumber, the parent block the launch lands in (readParentBlockNumber), to check its guard");
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Refuses a RulesConfig HookrRulesWalletCap's bind would refuse and returns its fee ceilings: `checkRulesConfig` with
|
|
100
|
+
* the cap set aside, plus the Wallet Cap Rules' own terms: a cap above zero in `potMinBuyQuote` (below 2^128), and a
|
|
101
|
+
* launch guard, with its liquidity owner, ending within 100,000 parent blocks after `ctx.blockNumber`, which is required
|
|
102
|
+
* here. `potEveryNBuys` stays zero. Every other Rules refuses a cap: check those with `checkRulesConfig`.
|
|
103
|
+
*/
|
|
104
|
+
export function checkWalletCapRulesConfig(c, ctx) {
|
|
105
|
+
walletCapTerms(c, ctx.blockNumber);
|
|
106
|
+
return checkRulesConfig({ ...c, potMinBuyQuote: 0n }, ctx);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* `rulesPoolTerms` for a launch member on the Wallet Cap Rules: every check `checkWalletCapRulesConfig` makes, the
|
|
110
|
+
* pool's caps and gas limits from the Rules' admission (`admission(HookrRoot, rulesModule(HOOKR_1, "wallet-cap").rules)`
|
|
111
|
+
* on the registry), and its `rulesData` with the cap. Refuses the admission of any other Rules. The member binds these
|
|
112
|
+
* Rules as `config.rules` and `l.rules`, cap included, as `rules`; every pool of the launch takes the same cap.
|
|
113
|
+
*/
|
|
114
|
+
export function walletCapPoolTerms(l, ctx, rulesAdmission, advisory, release = HOOKR_1) {
|
|
115
|
+
const m = rulesModule(release, "wallet-cap");
|
|
116
|
+
assert(address(rulesAdmission.implementation, true) === address(m.rules) && hash(rulesAdmission.codeHash) === hash(m.rulesRuntimeHash), `Not the admission of ${release.releaseId}'s Wallet Cap Rules ${m.rules}`);
|
|
117
|
+
walletCapTerms(l.rules, ctx.blockNumber);
|
|
118
|
+
const terms = rulesPoolTerms({ ...l, rules: { ...l.rules, potMinBuyQuote: 0n } }, ctx, rulesAdmission, advisory);
|
|
119
|
+
return { ...terms, rulesData: encodeRulesData(l.rules, rulesKnobsOf(l)) };
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Refuses a launch whose members (`buildLaunch`'s) Wallet Cap would leave a way round, or turn against traders, though
|
|
123
|
+
* the Rules bind each pool alone: some pools on the Wallet Cap Rules and some not, capped pools with different caps (a
|
|
124
|
+
* wallet could then buy the largest), or capped pools some with arb recapture and some without (on a capped pool
|
|
125
|
+
* without the lane, the executor's legs count against the trader whose swap set them off). Passes a launch without it.
|
|
126
|
+
*/
|
|
127
|
+
export function checkWalletCapLaunch(members, release = HOOKR_1) {
|
|
128
|
+
const pin = release.rulesModules["wallet-cap"];
|
|
129
|
+
const field = (member, part, key) => member[part]?.[key];
|
|
130
|
+
const capped = (member) => {
|
|
131
|
+
const rules = field(member, "config", "rules");
|
|
132
|
+
return pin !== undefined && typeof rules === "string" && rules.toLowerCase() === pin.rules.toLowerCase();
|
|
133
|
+
};
|
|
134
|
+
if (!members.some(capped))
|
|
135
|
+
return;
|
|
136
|
+
assert(members.every(capped), "Wallet Cap counts a wallet's buys across the launch's pools: every pool binds its Rules, or none does");
|
|
137
|
+
const caps = new Set(members.map((m) => field(m, "rules", "potMinBuyQuote")));
|
|
138
|
+
const [cap] = caps;
|
|
139
|
+
assert(caps.size === 1 && typeof cap === "bigint" && cap > 0n, "Every pool of a Wallet Cap launch takes the same cap, above zero");
|
|
140
|
+
assert(new Set(members.map((m) => field(m, "recapture", "on") === true)).size === 1, "In a Wallet Cap launch every pool takes arb recapture, or none does");
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Reads a pool on the Wallet Cap Rules through their `extsload`: its launch, guard end and cap from its Bound
|
|
144
|
+
* (`walletCapPoolSlot` and the two slots after it), then, with a wallet, that wallet's count on the launch
|
|
145
|
+
* (`walletCapBoughtSlot`) and its room. Null for a pool these Rules have not bound: a pool on any other Rules has no
|
|
146
|
+
* wallet cap. A count and its room hold while the guard lasts; after it nothing is counted or capped.
|
|
147
|
+
*/
|
|
148
|
+
export async function readWalletCap(client, query, release = HOOKR_1) {
|
|
149
|
+
assert((query.wallet === undefined) === (query.subject === undefined), "A wallet's count needs the pool's subject");
|
|
150
|
+
const rules = rulesModule(release, "wallet-cap").rules;
|
|
151
|
+
const at = query.blockNumber === undefined ? {} : { blockNumber: query.blockNumber };
|
|
152
|
+
const read = async (slot) => {
|
|
153
|
+
const data = encodeFunctionData({ abi: WALLET_CAP_ABI, functionName: "extsload", args: [word(slot)] });
|
|
154
|
+
const answer = (await client.call({ to: rules, data, ...at })).data;
|
|
155
|
+
assert(typeof answer === "string" && /^0x[0-9a-fA-F]{64}$/.test(answer), `The Wallet Cap Rules ${rules} answered extsload with ${answer}`);
|
|
156
|
+
return answer;
|
|
157
|
+
};
|
|
158
|
+
const pool = BigInt(walletCapPoolSlot(query.poolId));
|
|
159
|
+
const [first, second, third] = await Promise.all([read(pool), read(pool + 1n), read(pool + 2n)]);
|
|
160
|
+
const launch = walletCapLaunch(first);
|
|
161
|
+
if (launch === null)
|
|
162
|
+
return null;
|
|
163
|
+
const cap = BigInt(third) >> 128n;
|
|
164
|
+
assert(cap > 0n, `The Wallet Cap Rules ${rules} hold no cap for pool ${query.poolId}`);
|
|
165
|
+
const guardEndBlock = BigInt(second) & ((1n << 40n) - 1n);
|
|
166
|
+
if (query.wallet === undefined)
|
|
167
|
+
return { launch, guardEndBlock, cap, bought: null, room: null };
|
|
168
|
+
const bought = BigInt(await read(BigInt(walletCapBoughtSlot(query.subject, launch, query.wallet))));
|
|
169
|
+
return { launch, guardEndBlock, cap, bought, room: walletCapRoom(cap, bought) };
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The errors a refusal can reach a caller inside: the root's and the lane's (a module's own revert), the PoolManager's
|
|
173
|
+
* (a hook's revert in a swap) and the quoter's (a quoted swap's revert).
|
|
174
|
+
*/
|
|
175
|
+
const REFUSAL_ABI = [
|
|
176
|
+
...WALLET_CAP_ABI,
|
|
177
|
+
...parseAbi([
|
|
178
|
+
"error ModuleCallReverted(address module, bytes4 callSelector, bytes reason)",
|
|
179
|
+
"error WrappedError(address target, bytes4 selector, bytes reason, bytes details)",
|
|
180
|
+
"error SimulationFailed(bytes reason)",
|
|
181
|
+
]),
|
|
182
|
+
];
|
|
183
|
+
/** The most wrappers stripped from one revert, so a malformed one cannot recurse without end. */
|
|
184
|
+
const MAX_WRAPS = 4;
|
|
185
|
+
const hex = (value) => typeof value === "string" && /^0x([0-9a-fA-F]{2})+$/.test(value) ? value : null;
|
|
186
|
+
/** Revert data: a hex string as given, or the data a viem error carries anywhere in its cause chain. */
|
|
187
|
+
function revertData(error) {
|
|
188
|
+
if (typeof error === "string")
|
|
189
|
+
return hex(error);
|
|
190
|
+
for (let e = error, depth = 0; e !== null && typeof e === "object" && depth < 16; depth++) {
|
|
191
|
+
const { raw, data, cause } = e;
|
|
192
|
+
const found = hex(raw) ?? hex(data) ?? hex(data?.data);
|
|
193
|
+
if (found)
|
|
194
|
+
return found;
|
|
195
|
+
e = cause;
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The GuardWalletLimit inside a failed quote, swap or launch, however the root, the lane, the PoolManager and the quoter
|
|
201
|
+
* wrapped it, or null. Takes the revert data, or the viem error that carries it.
|
|
202
|
+
*/
|
|
203
|
+
export function walletCapRefusal(error) {
|
|
204
|
+
let data = revertData(error);
|
|
205
|
+
for (let wraps = 0; data !== null && wraps <= MAX_WRAPS; wraps++) {
|
|
206
|
+
let e;
|
|
207
|
+
try {
|
|
208
|
+
e = decodeErrorResult({ abi: REFUSAL_ABI, data });
|
|
209
|
+
}
|
|
210
|
+
catch (caught) {
|
|
211
|
+
if (!(caught instanceof BaseError))
|
|
212
|
+
throw caught;
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
if (e.errorName === "GuardWalletLimit") {
|
|
216
|
+
const [wallet, actual, limit] = e.args;
|
|
217
|
+
return { wallet: getAddress(wallet), actual, limit };
|
|
218
|
+
}
|
|
219
|
+
if (e.errorName === "ModuleCallReverted" || e.errorName === "WrappedError")
|
|
220
|
+
data = hex(e.args[2]);
|
|
221
|
+
else if (e.errorName === "SimulationFailed")
|
|
222
|
+
data = hex(e.args[0]);
|
|
223
|
+
else
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
/** Names Wallet Cap's refusal in `error` (revert data, or the viem error that carries it), or null. */
|
|
229
|
+
export function walletCapRevert(error) {
|
|
230
|
+
const r = walletCapRefusal(error);
|
|
231
|
+
return r
|
|
232
|
+
? `The buy would bring ${r.wallet}'s buys of the subject during the launch guard to ${r.actual}, above the pool's wallet cap ${r.limit}`
|
|
233
|
+
: null;
|
|
234
|
+
}
|
package/package.json
CHANGED
|
@@ -1,29 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hookr-sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Build
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Build on Hookr, the Uniswap v4 hook on Robinhood Chain: launch tokens with Hook Blocks, open pools, quote and swap.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
7
|
+
"homepage": "https://hookr.fun/docs",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"hookr",
|
|
10
|
+
"uniswap",
|
|
11
|
+
"uniswap-v4",
|
|
12
|
+
"v4-hooks",
|
|
13
|
+
"hooks",
|
|
14
|
+
"hook-blocks",
|
|
15
|
+
"token-launch",
|
|
16
|
+
"robinhood-chain",
|
|
17
|
+
"viem",
|
|
18
|
+
"sdk"
|
|
19
|
+
],
|
|
11
20
|
"exports": {
|
|
12
21
|
".": {
|
|
13
22
|
"types": "./dist/index.d.ts",
|
|
14
23
|
"import": "./dist/index.js"
|
|
15
|
-
}
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
16
26
|
},
|
|
17
27
|
"main": "./dist/index.js",
|
|
18
28
|
"types": "./dist/index.d.ts",
|
|
19
29
|
"files": [
|
|
20
30
|
"dist",
|
|
21
|
-
"
|
|
31
|
+
"provenance.json",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md",
|
|
34
|
+
"MIGRATING.md",
|
|
35
|
+
"LICENSE"
|
|
22
36
|
],
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18.16"
|
|
40
|
+
},
|
|
41
|
+
"devEngines": {
|
|
42
|
+
"runtime": {
|
|
43
|
+
"name": "node",
|
|
44
|
+
"version": ">=22.18",
|
|
45
|
+
"onFail": "error"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
23
48
|
"peerDependencies": {
|
|
24
|
-
"viem": "^2"
|
|
49
|
+
"viem": "^2.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "24.3.0",
|
|
53
|
+
"typescript": "5.9.3",
|
|
54
|
+
"viem": "2.55.10"
|
|
25
55
|
},
|
|
26
56
|
"scripts": {
|
|
27
|
-
"build": "tsc -p tsconfig.json"
|
|
57
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/declarations.mjs",
|
|
58
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
59
|
+
"test": "node --test test/*.test.ts",
|
|
60
|
+
"sync": "node scripts/sync-core.mjs",
|
|
61
|
+
"deployment": "node scripts/release-deployment.mjs",
|
|
62
|
+
"prepack": "npm run build",
|
|
63
|
+
"prepublishOnly": "node scripts/release-deployment.mjs --require hookr-1"
|
|
28
64
|
}
|
|
29
65
|
}
|
package/provenance.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "hookr-sdk.provenance.v1",
|
|
3
|
+
"algorithm": "sha256",
|
|
4
|
+
"source": {
|
|
5
|
+
"commit": "412960b37a631ce145d49fb4a1887f04a4d1fa74",
|
|
6
|
+
"path": "labs/hooks/hookr-phase-one/sdk/src",
|
|
7
|
+
"package": "@hookr/phase-one-sdk@0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"packetDigest": "83962c12ff55df431612ffae8bfc66a30041eb310035cfc30eab1bb9bdc0e031",
|
|
10
|
+
"contractSources": "Verified on RobinScan at each contract's address: https://robin.etherscan.io",
|
|
11
|
+
"files": {
|
|
12
|
+
"abi.ts": "615359c9865eaa8b12ddde68f3e115bcf4cc922c2ba9578cd4c4ba9c0836d416",
|
|
13
|
+
"advisories.ts": "2fd12057ddb8c8527c19438574366ca9b15a48183b841d56d44e38506b823ded",
|
|
14
|
+
"client.ts": "78c386458e747e9c520926e3c22c33292a4ef0ae26dfcf4b671ccd7302e19328",
|
|
15
|
+
"generated.ts": "2fa220f53b64b85cb8fd7b34e06dd3a346027b6d8aa4e93835f69f92697a0fe7",
|
|
16
|
+
"index.ts": "5789edae589547442a6529111dd8c2e02d6a8791784f6da45c96e189567b3059",
|
|
17
|
+
"launch.ts": "dffb0d1321a30f68d4510dc30523599ae28b9a30f6df9880366e149974555268",
|
|
18
|
+
"pair.ts": "1b3f3f2d3dbf6a3e69655c9d35324e5f656ab64b2d7b846c7621dd6a4ca4e43d",
|
|
19
|
+
"params.ts": "5fa75b9ede3bbb20d4b48f2b907220f9b832b05977c3aeefa5b69d0169f85521",
|
|
20
|
+
"policies.ts": "07411d29d46f7175ff77624242cabcf4d3a235a287507f3d83a0df4a06985410",
|
|
21
|
+
"proofs.ts": "81f1f4a0f2c267b8a2b7897ecd4847fb8791f512f8babc51f1c8976d9d047bb8",
|
|
22
|
+
"quotes.ts": "c3483a97ca247533cc5ef9d5648b43df591d47db3c434e8f8ff6b634b44359c3",
|
|
23
|
+
"referrals.ts": "9426b5a128ddff1c9f7b54e483a81a30458dea04c7d40adff8d1e4084f048987",
|
|
24
|
+
"registry.ts": "fec429bc5b7bd91a83124d46055171269ded20678c185ad3e40d7d5e1153cee8",
|
|
25
|
+
"rules.ts": "d34b23187424756293b06815c6ee31dc772c87f2ae1cbba63f966148ece64543",
|
|
26
|
+
"schema.ts": "caa6caa9f15ae9a597bf8b2a2d098ef40780b8b6410a3a72a4f2be62b84c98e5",
|
|
27
|
+
"stocks.generated.ts": "8809cd3b82612bbc6e96bca23b756ee0bb7b99d391d991415f6ffb9d2aa705fd",
|
|
28
|
+
"vault.ts": "e01d26ed5517547bfc29dc89ca58836c762d665e88a5db58523475248f5de387",
|
|
29
|
+
"wallet.ts": "25fd97be3dde9755414f0eeacae2a9cfc14358951f98d6573af1025403895dba"
|
|
30
|
+
}
|
|
31
|
+
}
|