@black-market/sdk 0.7.1 → 0.8.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/README.md +58 -22
- package/dist/launch.d.ts +31 -5
- package/dist/launch.d.ts.map +1 -1
- package/dist/launch.js +71 -11
- package/dist/launch.js.map +1 -1
- package/dist/lifecycle/abi.d.ts +18 -0
- package/dist/lifecycle/abi.d.ts.map +1 -1
- package/dist/lifecycle/abi.js +4 -0
- package/dist/lifecycle/abi.js.map +1 -1
- package/dist/lifecycle/index.d.ts +2 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +2 -0
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle/planner.d.ts +1 -1
- package/dist/lifecycle/planner.d.ts.map +1 -1
- package/dist/lifecycle/planner.js +58 -10
- package/dist/lifecycle/planner.js.map +1 -1
- package/dist/lifecycle/progress.js +35 -35
- package/dist/lifecycle/progress.js.map +1 -1
- package/dist/lifecycle/rpc.d.ts +10 -4
- package/dist/lifecycle/rpc.d.ts.map +1 -1
- package/dist/lifecycle/rpc.js +137 -16
- package/dist/lifecycle/rpc.js.map +1 -1
- package/dist/lifecycle/types.d.ts +20 -1
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/lifecycle/types.js.map +1 -1
- package/docs/launch-lifecycle.md +396 -64
- package/examples/.env.example +22 -2
- package/examples/README.md +315 -87
- package/examples/{launch-erc20-abyss.mjs → launch-erc20-abyss.ts} +1 -1
- package/examples/{launch-erc20-burn-mixed.mjs → launch-erc20-burn-mixed.ts} +1 -1
- package/examples/launch-erc20-depth-v4.ts +7 -0
- package/examples/{launch-erc20-dividends-abyss.mjs → launch-erc20-dividends-abyss.ts} +1 -1
- package/examples/launch-erc20-dividends-multiquote-mixed.ts +8 -0
- package/examples/launch-erc20-multi-quote.ts +8 -0
- package/examples/{launch-erc20-staking-v4.mjs → launch-erc20-staking-v4.ts} +1 -1
- package/examples/{launch-erc20-v4.mjs → launch-erc20-v4.ts} +1 -1
- package/examples/{launch-erc404-abyss.mjs → launch-erc404-abyss.ts} +1 -1
- package/examples/{launch-erc404-dividends-mixed.mjs → launch-erc404-dividends-mixed.ts} +1 -1
- package/examples/{launch-erc404-v4.mjs → launch-erc404-v4.ts} +1 -1
- package/examples/launch-example-kyber.ts +204 -0
- package/examples/launch-example-support.ts +876 -0
- package/examples/launch-example.ts +1163 -0
- package/examples/{launch-lifecycle-smoke.mjs → launch-lifecycle-smoke.ts} +1 -1
- package/examples/{launch.mjs → launch.ts} +1 -1
- package/package.json +2 -2
- package/src/launch.ts +81 -14
- package/src/lifecycle/abi.ts +4 -0
- package/src/lifecycle/index.ts +2 -0
- package/src/lifecycle/planner.ts +61 -12
- package/src/lifecycle/progress.ts +35 -35
- package/src/lifecycle/rpc.ts +140 -17
- package/src/lifecycle/types.ts +19 -1
- package/examples/launch-example-support.mjs +0 -393
- package/examples/launch-example.mjs +0 -633
- /package/examples/{generate-lifecycle-commitment-fixture.mjs → generate-lifecycle-commitment-fixture.ts} +0 -0
- /package/examples/{quickstart.mjs → quickstart.ts} +0 -0
package/docs/launch-lifecycle.md
CHANGED
|
@@ -7,7 +7,17 @@ The canonical authorities are the registry/certification/adapter/config contract
|
|
|
7
7
|
in the protocol repository. Plan identity is `LaunchPlanV1`. Pool-bound V4 uses **config 6**,
|
|
8
8
|
canonical Abyss uses **config 1**, and generic current shared-V4 support uses **config 4**.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 0.8.0 release
|
|
11
|
+
|
|
12
|
+
This release adds unstarted-launch topology validation, boundary tails enabled by
|
|
13
|
+
default, and the generalized `positionGaps` option replacing `staircaseBoundaries`.
|
|
14
|
+
The TypeScript examples default to an unsigned dry run; `--broadcast` explicitly
|
|
15
|
+
authorizes execution without an interactive hash prompt. `--resume` retains the
|
|
16
|
+
original plan, receipt evidence, and metadata session instead of relaunching.
|
|
17
|
+
The opt-in `LifecycleSessionCache` below reuses only the allowlisted static reads
|
|
18
|
+
at the same canonical chain/block; execution proof and financial state stay live.
|
|
19
|
+
|
|
20
|
+
## 0.7.1 transaction-first construction
|
|
11
21
|
|
|
12
22
|
Known chain/core/profile identities use frozen release construction metadata.
|
|
13
23
|
`getKnownLifecycleDeployment`, `getKnownLifecycleProfile` and
|
|
@@ -61,17 +71,21 @@ Staircase inserts three-step gaps only between new inventory shelves; Smooth Ram
|
|
|
61
71
|
keeps gently narrowing bands contiguous. The SDK defaults to five positions and
|
|
62
72
|
supports counts from 2 through 16. Arbitrary equal-tick fractions of the distance
|
|
63
73
|
to a protocol boundary are not these presets.
|
|
64
|
-
For Staircase, `
|
|
65
|
-
|
|
66
|
-
`"source-gaps"` preserves
|
|
67
|
-
|
|
74
|
+
For Staircase and Early Scarcity, `positionGaps: "adjacent"` removes the empty
|
|
75
|
+
intervals while retaining the source inventory weights and finite-band widths.
|
|
76
|
+
The default `"source-gaps"` preserves their original topology. Smooth Ramp is
|
|
77
|
+
always contiguous: omit `positionGaps` or use `"adjacent"`; explicitly supplying
|
|
78
|
+
`"source-gaps"` is an error. Adjacent positions share an exact spacing-aligned tick;
|
|
79
|
+
overlap is also valid for continuous price coverage.
|
|
68
80
|
An empty gap can move the pool price without exchanging tokens in that interval.
|
|
69
81
|
|
|
70
82
|
|
|
71
|
-
`extendFinalRangeToBoundary` defaults to `
|
|
72
|
-
only the final band's far endpoint with the usable spacing-aligned
|
|
73
|
-
boundary, preserving every earlier band and the final band's near endpoint.
|
|
74
|
-
|
|
83
|
+
**Breaking default:** `extendFinalRangeToBoundary` now defaults to `true`.
|
|
84
|
+
It replaces only the final band's far endpoint with the usable spacing-aligned
|
|
85
|
+
protocol boundary, preserving every earlier band and the final band's near endpoint.
|
|
86
|
+
Explicit `false` retains a finite final band, which does not satisfy default planner
|
|
87
|
+
admission unless another funded position supplies the permanent tail.
|
|
88
|
+
The complete finite preset must fit before this extension is applied.
|
|
75
89
|
`boundaryTick` and `boundarySqrtPriceX96` always describe that finite protocol
|
|
76
90
|
boundary; endpoint sqrt ratios are not exclusive swap-price guards.
|
|
77
91
|
|
|
@@ -100,11 +114,64 @@ crosses the opening upper endpoint. `buySideLiquidity` is only the first
|
|
|
100
114
|
reachable band's liquidity, never the sum of all disjoint bands. Each position
|
|
101
115
|
also exposes exact endpoint sqrt ratios for display valuation.
|
|
102
116
|
|
|
103
|
-
|
|
117
|
+
### Launch position-topology safety
|
|
118
|
+
|
|
119
|
+
Every launch-created market must retain a **nonzero permanent tail** and continuous
|
|
120
|
+
buy-side coverage from its opening price to that tail. A tail in another pool,
|
|
121
|
+
including an optional Abyss allocation, cannot substitute for this market's tail.
|
|
122
|
+
The tail ends at the furthest usable spacing-aligned protocol tick: the maximum
|
|
123
|
+
tick when `launchedTokenIsQuote` is `true` (launch token0), otherwise the minimum.
|
|
124
|
+
V4 uses the config's `tickSpacing`; Abyss config1 uses its canonical fee-tier spacing
|
|
125
|
+
from `ABYSS_FEE_TIERS`, without changing the encoded config.
|
|
126
|
+
|
|
127
|
+
`assertLaunchTopologyCoverage` is a pure validator exported by both
|
|
128
|
+
`@black-market/sdk` and `@black-market/sdk/lifecycle`. It accepts
|
|
129
|
+
`{ positions, openingTick, tickSpacing, launchedTokenIsQuote, allowInteriorGaps? }`.
|
|
130
|
+
Positions carry `tickLower`, `tickUpper` and `maxTokenAmount` (or the Abyss config's
|
|
131
|
+
`tokenAmountMaximum`). Derive the opening tick with exported
|
|
132
|
+
`getTickAtSqrtRatio(marketSqrtPriceX96)`, not by rounding it to the spacing grid.
|
|
133
|
+
The validator never changes the positions:
|
|
134
|
+
|
|
135
|
+
- `TOPOLOGY_OPENING_GAP`: no band contains the opening tick on the buy side.
|
|
136
|
+
Token0 containment is `[lower, upper)`; token1 is `(lower, upper]`, including
|
|
137
|
+
the opening upper endpoint crossed by the first downward buy.
|
|
138
|
+
- `TOPOLOGY_INTERIOR_GAP`: the sorted interval union leaves an uncovered interval
|
|
139
|
+
between opening and the permanent tail. Exact adjacency and overlapping
|
|
140
|
+
Orbit-style horizons both pass.
|
|
141
|
+
- `MISSING_PERMANENT_TAIL`: no boundary-reaching band has a positive token cap.
|
|
142
|
+
A finite final band or zero-allocation tail is not permanent liquidity.
|
|
143
|
+
- `TOPOLOGY_OFF_GRID_TICK`: a band endpoint is not aligned to this market's spacing.
|
|
144
|
+
|
|
145
|
+
The pure validator's `allowInteriorGaps: true` waives **only** interior gaps.
|
|
146
|
+
`planLaunch` and `prepareAndPlanLifecycleLaunch` enforce the same checks for every
|
|
147
|
+
market of an **unstarted launch**, using the pinned predicted token's ordering
|
|
148
|
+
against that market's quote. Progress is read first: waiting/in-flight account or
|
|
149
|
+
receipt state returns waiting without applying this creation policy. Started
|
|
150
|
+
`Preparing`/`Ready` and terminal `Active`/`Cancelled` plans skip the topology gate.
|
|
151
|
+
Their onchain commitments are immutable, so recovery must not retroactively
|
|
152
|
+
refuse them for historical topology. Budget/supply, identity, confirmation,
|
|
153
|
+
receipt and stateful execution checks still apply.
|
|
154
|
+
|
|
155
|
+
| Local planning option | Effect |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `allowTopologyGaps: true` | Allows interior gaps only; the funded permanent tail stays mandatory. |
|
|
158
|
+
| `allowMissingPermanentTail: true` | Waives only the boundary-reaching, positive-allocation tail requirement. |
|
|
159
|
+
|
|
160
|
+
Both options default to `false`. Even together they **never** waive opening
|
|
161
|
+
containment or tick alignment. Staircase and Early Scarcity source gaps therefore
|
|
162
|
+
require an explicit gap opt-out; choose `positionGaps: "adjacent"` for continuous
|
|
163
|
+
admitted launches instead. These are validation choices, not an execution-proof
|
|
164
|
+
bypass. They are retained on `PlannedLaunch` for fresh `simulateLaunchPlan` and
|
|
165
|
+
`buildNextTransaction` admission while the launch remains unstarted. Started and
|
|
166
|
+
terminal recovery does not require either opt-out. Persist explicit choices
|
|
167
|
+
separately when restoring an unstarted saved plan. Budget/supply equalities, ABI
|
|
168
|
+
encoding, hashes, calldata and stateful proof requirements are unchanged.
|
|
169
|
+
|
|
170
|
+
No cross-review execution cache, caller certificate or execution-proof skip exists.
|
|
104
171
|
Recovery and `buildNextTransaction` acquire fresh authority and retain separate
|
|
105
172
|
immediate-submission-provider preflight. Construction/proof is not submission.
|
|
106
173
|
|
|
107
|
-
##
|
|
174
|
+
## Reviewed next envelopes
|
|
108
175
|
|
|
109
176
|
`BuildNextTransactionOptions.reviewedTransaction` optionally supplies an untrusted
|
|
110
177
|
previously reviewed immediate transaction. Omit it to construct a new envelope
|
|
@@ -139,6 +206,119 @@ exact simulated `gas` and `gasPrice`.
|
|
|
139
206
|
|
|
140
207
|
|
|
141
208
|
|
|
209
|
+
## Opt-in static session fast path
|
|
210
|
+
|
|
211
|
+
`createLifecycleSessionCache()` creates a caller-owned `LifecycleSessionCache`.
|
|
212
|
+
Pass it as `LifecycleRpcClient.sessionCache` to retain the SDK's **explicit static
|
|
213
|
+
read class** across `prepareAndPlanLifecycleLaunch`, `planLaunch`,
|
|
214
|
+
`simulateLaunchPlan` and `buildNextTransaction`. Omit the option to preserve the
|
|
215
|
+
default: only existing invocation-local fixed-state reuse, with no session events
|
|
216
|
+
or cross-invocation observations. The SDK neither creates a global cache nor
|
|
217
|
+
changes transport batching, selected mode or execution admission.
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
import { createLifecycleSessionCache, planLaunch } from "@black-market/sdk/lifecycle";
|
|
221
|
+
|
|
222
|
+
const sessionCache = createLifecycleSessionCache();
|
|
223
|
+
const client = {
|
|
224
|
+
...publicClient,
|
|
225
|
+
sessionCache,
|
|
226
|
+
supportsReadBatching: true, // Only when this transport actually batches.
|
|
227
|
+
onDiagnostic: (event) => { console.debug("[launch-sdk]", event); },
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const first = await planLaunch({ client, plan, account, mode: "staged" });
|
|
231
|
+
const second = await planLaunch({ client, plan, account, mode: "staged" });
|
|
232
|
+
// At the same canonical head, the second call reuses matching static reads only.
|
|
233
|
+
// Execution simulation, funding and canonical checks still run independently.
|
|
234
|
+
|
|
235
|
+
sessionCache.block; // readonly { number: bigint, hash } or undefined
|
|
236
|
+
sessionCache.invalidate(); // Wallet/chain switch, or each confirmed transaction.
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
The retained class is deliberately narrow:
|
|
240
|
+
|
|
241
|
+
| Static observations eligible for session reuse | Scope |
|
|
242
|
+
| --- | --- |
|
|
243
|
+
| Nitro capability getters and compute ceilings | Pinned `ArbSys.arbOSVersion`, `ArbGasInfo.getMaxTxGasLimit` / `getMaxBlockGasLimit` |
|
|
244
|
+
| Nitro poster quotes | Pinned NodeInterface `gasEstimateL1Component`, including the exact payer, destination, calldata and value |
|
|
245
|
+
| Frozen-profile registry certification | Profile/adapter registration (including dependency digest), topology, reviewed envelope, developer terms/cap and exact `requireEligible` request |
|
|
246
|
+
| Reviewed immutable certification graph | Adapter metadata/dependency getters, graph runtime-code checks, locker/collector authorities and shared-hook constructor/runtime provenance |
|
|
247
|
+
| Oracle configuration and factory presence | Pinned `oracleConfigs(configId)`, certified oracle-factory code and token-factory code-presence checks |
|
|
248
|
+
| Hook deployer creation/constructor/runtime evidence | Creation-code hash, both chunk addresses/bytes, exact constructor metadata, initcode/CREATE2 comparisons and deployer-recorded runtime digests |
|
|
249
|
+
|
|
250
|
+
Known construction presets continue to avoid discovery/getter mirrors they already
|
|
251
|
+
omit; enabling a cache does not introduce extra certification reads. Unlisted
|
|
252
|
+
profiles still use their normal frozen-envelope certification. Session hits retain
|
|
253
|
+
private wire hex, not mutable public profile/deployment DTOs. Each consumer still
|
|
254
|
+
decodes and checks its exact registration, graph, constructor and market bindings.
|
|
255
|
+
|
|
256
|
+
**Never retained across invocations:** native/ERC20 balances, allowances,
|
|
257
|
+
progress/market and core domain/prediction/binding reads, receipts/transactions,
|
|
258
|
+
chain identity, head/latest/pending observations, account code/nonces,
|
|
259
|
+
`eth_estimateGas`, `eth_simulateV1`, gas-price recommendations, funding-target
|
|
260
|
+
admission, non-view calls, submission preflight and all write-adjacent calls.
|
|
261
|
+
In particular the **native Nitro metering simulation probe is not cached**:
|
|
262
|
+
its `eth_simulateV1` request remains separate from the static ArbSys/ArbGasInfo
|
|
263
|
+
getters, and permissive measurement plus exact validated replay stay live.
|
|
264
|
+
Existing invocation-local reuse for eligible fixed reads is unchanged.
|
|
265
|
+
|
|
266
|
+
Each entry group owns one pinned block **number and hash**. Before session
|
|
267
|
+
observations can be consumed, the invocation must read a fresh canonical head and
|
|
268
|
+
chain identity. A changed head hash (including a same-height reorg), number or
|
|
269
|
+
chain identity clears the old group before use. Exact
|
|
270
|
+
wire parameters also participate in identity; changed caller, target, calldata,
|
|
271
|
+
value, gas or constructor economics cannot hit another request's entry.
|
|
272
|
+
Externally supplied pins without a fresh invocation-owned head bypass the session.
|
|
273
|
+
Only successfully settled wire reads are shared; rejected requests, in-flight
|
|
274
|
+
promises and obsolete completions after closure/invalidation are not retained.
|
|
275
|
+
Final canonical/reorg and chain checks remain live and clear the session on
|
|
276
|
+
identity failure.
|
|
277
|
+
|
|
278
|
+
The caller-owned session is the cross-invocation identity boundary, not the
|
|
279
|
+
reader object or `request` function. Recreated per-operation readers may share
|
|
280
|
+
it while keeping their own transport cancellation signal. They still acquire
|
|
281
|
+
fresh head/chain observations and run their own live requests; in-flight work
|
|
282
|
+
and cancellation state are never shared. Do not route concurrent operation
|
|
283
|
+
signals through one mutable global reader.
|
|
284
|
+
|
|
285
|
+
The caller **must call `invalidate()` on wallet/chain switches and after every
|
|
286
|
+
confirmed transaction**. It discards the pin and all memoized values immediately,
|
|
287
|
+
including preventing older pending reads from repopulating the discarded group.
|
|
288
|
+
It does not cancel an operation, freeze the chain or grant permission to submit
|
|
289
|
+
a saved transaction. A new block causes fresh static reads; the cache is a
|
|
290
|
+
same-snapshot acceleration, not a TTL or an assumption that facts never change.
|
|
291
|
+
|
|
292
|
+
With `onDiagnostic`, each opted-in invocation emits a `session-cache` start and
|
|
293
|
+
success/failure summary. `hits` counts static reads resolved from the session,
|
|
294
|
+
`misses` counts new static reads, and `reuses` counts existing invocation-local
|
|
295
|
+
static reuse. Summaries contain counts only: no cache keys, pins, RPC URLs,
|
|
296
|
+
parameters, addresses, calldata, results or errors. Nested continuations share one
|
|
297
|
+
summary, and listener failures remain isolated from financial behavior.
|
|
298
|
+
|
|
299
|
+
Correctness follows from deterministic static observations at the **same exact
|
|
300
|
+
canonical snapshot**, complete request identity and preserved live proof. The
|
|
301
|
+
session never stores an admission certificate or replaces balances, receipt/nonce
|
|
302
|
+
continuity, native capability simulation, execution replay or submission checks.
|
|
303
|
+
Offline RPC-count regressions compare two sequential complete `planLaunch`
|
|
304
|
+
operations with and without the option; they prove fewer repeated static reads,
|
|
305
|
+
not a live end-to-end latency guarantee.
|
|
306
|
+
|
|
307
|
+
Deterministic offline measurements (RPC messages, not HTTP batches):
|
|
308
|
+
|
|
309
|
+
| Fixture, two sequential `planLaunch` calls at the same pin | Cache off: first / second | Cache on: first / second |
|
|
310
|
+
| --- | --- | --- |
|
|
311
|
+
| Admitted Nitro/Abyss staged plan, serial or batching transport | 33 / 33 | 33 / 22 |
|
|
312
|
+
| Two-bound-market, two-creation-chunk V4 certification/constructor fixture | 64 / 64 | 64 / 19 |
|
|
313
|
+
|
|
314
|
+
The first fixture performs the native Nitro probe, measurement and validated
|
|
315
|
+
replay on **both** calls (three `eth_simulateV1` requests per call). The bound
|
|
316
|
+
fixture deliberately refuses a smart account after completing read-only metadata;
|
|
317
|
+
its savings prove static-read reuse, not economic execution. Both compare the
|
|
318
|
+
complete returned plans for equality. Reproduce after `pnpm build` with
|
|
319
|
+
`node --test test/lifecycle-read-pipeline.test.mjs test/lifecycle-execution.test.mjs`;
|
|
320
|
+
the tests print the per-call counts and assert unchanged counts with the cache off.
|
|
321
|
+
|
|
142
322
|
## 0.6.3 certification and dependency-round reductions
|
|
143
323
|
|
|
144
324
|
The public API, deployment authority and protocol admission rules are unchanged. With an
|
|
@@ -262,7 +442,7 @@ and swap-funding checks remain conditional on the actual committed plan. There i
|
|
|
262
442
|
weakened single-pool mode: adapter eligibility, live code hashes, authority/dependency
|
|
263
443
|
bindings, schema/topology and applicable frozen terms remain mandatory.
|
|
264
444
|
|
|
265
|
-
|
|
445
|
+
Without the optional static session fast path above, identical fixed-state reads share observations only within one planning invocation.
|
|
266
446
|
Identity includes the original source client, pinned block number/hash and complete
|
|
267
447
|
request parameters, including caller, target, calldata, value and gas context. Rejected
|
|
268
448
|
reads are not retained. State changes, another caller/source/block or a subsequent public
|
|
@@ -393,10 +573,10 @@ Validation uses `validateV4LifecycleMarket`; the collector factory getter is
|
|
|
393
573
|
| --- | --- |
|
|
394
574
|
| `readLifecycleProfiles({client, orchestrator, profileIds?, offset?, limit?})` | Bounded registry discovery, schema/topology dispatch, reviewed graph/terms certification and current registry admission. Default offset/limit is 0/100; explicit IDs can select a reviewed deployment's identities. |
|
|
395
575
|
| `predictLifecycleToken({client, plan})` | Exact prediction from the explicit core. |
|
|
396
|
-
| `prepareAndPlanLifecycleLaunch({client, account, plan, mode, limits?, fork?, receipts?, confirmations?, signal?, onProgress?})` | Mines config6/V2 salts offchain, verifies exact final deployment bindings and returns complete selected-mode admission under one SDK-owned fresh post-mining snapshot. No source-chain deployment or broadcast. |
|
|
576
|
+
| `prepareAndPlanLifecycleLaunch({client, account, plan, mode, allowTopologyGaps?, allowMissingPermanentTail?, limits?, fork?, receipts?, confirmations?, signal?, onProgress?})` | Mines config6/V2 salts offchain, verifies per-market launch topology and exact final deployment bindings, and returns complete selected-mode admission under one SDK-owned fresh post-mining snapshot. No source-chain deployment or broadcast. |
|
|
397
577
|
| `readPoolBoundHookDeployment({client, plan, marketIndex})` | Verifies typed factory, code chunks, constructor, normalized economics, initcode, salt, CREATE2 prediction and recorded provenance of existing code. Works with draft salts; permission bits are additionally required for executable predeployment. |
|
|
398
578
|
| `buildPoolBoundHookDeploymentTransaction({client, plan, marketIndex})` | Optional permissionless typed `deploy(parameters,salt)` calldata. Does not create a token, register/initialize a pool, bind a collector or activate a launch. |
|
|
399
|
-
| `planLaunch({client, account, plan, mode, limits?, fork?, receipts?, confirmations?, signal?})` | Independently fresh domain/funding/profile/progress/execution admission of the already-finalized commitment, simulating only the explicitly selected mode. |
|
|
579
|
+
| `planLaunch({client, account, plan, mode, allowTopologyGaps?, allowMissingPermanentTail?, limits?, fork?, receipts?, confirmations?, signal?})` | Independently fresh per-market topology/domain/funding/profile/progress/execution admission of the already-finalized commitment, simulating only the explicitly selected mode. |
|
|
400
580
|
| `simulateLaunchPlan({client, planned, limits?, fork?, receipts?, confirmations?})` | Rereads canonical state and proves remaining work. Preserves receipt evidence, economics and selected mode. |
|
|
401
581
|
| `readLaunchProgress({client, planned, receipts?, confirmations?})` | Confirmation-bound canonical state, latest head, receipt/replacement/reorg status, account-nonce safety and actual prepared market/live state. |
|
|
402
582
|
| `buildNextTransaction({client, planned, reviewedTransaction?, submissionClient?, limits?, fork?, receipts?, confirmations?, action?})` | Rereads progress, constraints and complete stateful proof before returning one admitted transaction. Optional untrusted `reviewedTransaction` must match the current canonical next step and freshly prove its exact gas/price. Optional `submissionClient` adds read-only immediate exact-envelope preflight. `action: "cancel"` uses the stored commitment without requiring fresh adapter/profile admission. Terminal launches return `undefined`. |
|
|
@@ -450,7 +630,7 @@ Registry `authorizationDigest`, `beneficiaryNonces` and `registerProfile` ABIs e
|
|
|
450
630
|
|
|
451
631
|
### Pool-bound V4, version 6
|
|
452
632
|
|
|
453
|
-
`encodePoolBoundV4LifecycleMarketConfig` / `decodePoolBoundV4LifecycleMarketConfig`
|
|
633
|
+
`encodePoolBoundV4LifecycleMarketConfig` / `decodePoolBoundV4LifecycleMarketConfig` support explicit inner versions 5 and 6. The current October8 graph requires version 6 and matching market `configVersion`; historical version 5 requires its own graph and V1 constructor. Version 6 schema:
|
|
454
634
|
|
|
455
635
|
```text
|
|
456
636
|
(uint16,uint24,int24,uint160,uint24,uint24,uint32,uint8,uint8,address,bool,bytes32,bytes32,bytes32,bytes32,address,uint16,(int24,int24,uint128,bytes32,uint256)[])
|
|
@@ -461,13 +641,13 @@ Both preserve LP/hook fees, tick spacing, opening price, fee mode/denominator/tr
|
|
|
461
641
|
All three hook fee settings are independently chosen per pool and frozen at launch.
|
|
462
642
|
One million pips is 100%, and 10,000 pips is 1%. `validatePoolBoundHookFees` validates
|
|
463
643
|
integer `0 <= minimum <= maximum <= 1,000,000` and sensitivity `0..4,294,967,295`.
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
644
|
+
The current reviewed `FixedFeePoolHookV1` uses a **fixed maximum-pips schedule**:
|
|
645
|
+
each applicable hook fee is `floor(amount * hookFeePips / 1,000,000)`.
|
|
646
|
+
Its base stores and exposes `minimumHookFeePips` and
|
|
647
|
+
`feeSensitivityPipsSecondsPerTick`, but this concrete hook does not use them in fee
|
|
648
|
+
calculation. Sensitivity's encoded units are fee-pips × seconds/tick; they do not
|
|
649
|
+
imply an active oracle-driven fee formula. Registered oracle configuration still
|
|
650
|
+
governs the pool's oracle behavior, not this hook's fixed fee rate.
|
|
471
651
|
|
|
472
652
|
```ts
|
|
473
653
|
const profile = profiles.find((row) => row.id === selectedProfileId);
|
|
@@ -521,7 +701,7 @@ Mining is cancellable/nonblocking; `abort()` raises `AbortError` and does not ca
|
|
|
521
701
|
Every planning call requires `mode: "atomic" | "staged"`. Only that requested mode receives economic simulation; staged does not compute or expose an unused atomic attempt.
|
|
522
702
|
|
|
523
703
|
- Atomic: after funding prerequisites, token creation, empty infrastructure, all mint/lock/buys/public activation are one transaction.
|
|
524
|
-
- Staged: prerequisites, `beginLaunch(Staged)`, contiguous empty `prepareMarkets` batches, then one `activateLaunch`.
|
|
704
|
+
- Staged: prerequisites, `beginLaunch(Staged)`, contiguous empty `prepareMarkets` batches, then one `activateLaunch`. Only a stateful preparation refusal classified as capacity with a compute or gas-envelope constraint can partition into smaller empty batches. Opaque `DeploymentFailed`, unclassified/source/provider-clamp errors, byte-cap refusals and near-cap consumption do not authorize that search. Core/validator/registry/hook invariant errors stop planning.
|
|
525
705
|
- Activation cannot split. If mint/lock/all buys/opening cannot fit, staged is also refused. No position/buy/minimum is omitted to manufacture success.
|
|
526
706
|
|
|
527
707
|
No automatic atomic-to-staged fallback exists. Obtain separate consent to review the same commitment as staged. Both venues use token transfer restrictions plus activation-time canonical opening-state checks, not a pool gate. Manipulated opening price or preactivation liquidity fails verification; the token stays inactive and the launch remains Ready/cancellable. Failed activation rolls back every mint, seal, buy and opening together.
|
|
@@ -735,7 +915,7 @@ Lifecycle dividend tokens retain independent current-owner dividend bounty up to
|
|
|
735
915
|
`test/fixtures/launch-lifecycle-v1.json` is a portable **offline wire vector**, not a deployed launch. Its independent generator owns the literal canonical ABI tuple:
|
|
736
916
|
|
|
737
917
|
```sh
|
|
738
|
-
node examples/generate-lifecycle-commitment-fixture.
|
|
918
|
+
node examples/generate-lifecycle-commitment-fixture.ts test/fixtures/launch-lifecycle-v1.json
|
|
739
919
|
```
|
|
740
920
|
|
|
741
921
|
Build and run the offline unit suite with `pnpm test`, and deployed read-only discovery with
|
|
@@ -744,11 +924,11 @@ reviewed terms/rate/bounds, salt normalization/mining, receipt recovery, and aut
|
|
|
744
924
|
authentication/routing/page outcomes. Wire vectors remain
|
|
745
925
|
offline schema references; they are not a mainnet launch or an admitted deployment graph.
|
|
746
926
|
|
|
747
|
-
`examples/launch.
|
|
927
|
+
`examples/launch.ts` reviews a saved plan without signatures or source-chain writes:
|
|
748
928
|
|
|
749
929
|
```sh
|
|
750
930
|
pnpm build
|
|
751
|
-
node examples/launch.
|
|
931
|
+
node examples/launch.ts --plan plan.json --rpc https://rpc.mainnet.chain.robinhood.com/ --mode staged --mine
|
|
752
932
|
```
|
|
753
933
|
|
|
754
934
|
The saved plan must use that RPC's chain and current deployment. `--mine` finalizes bound
|
|
@@ -757,7 +937,7 @@ supply explicit execution/recovery evidence. The command never invents provider/
|
|
|
757
937
|
Without a sequential simulation backend and matching execution-limit provenance, its review
|
|
758
938
|
can be provisional and cannot produce an admitted next transaction.
|
|
759
939
|
|
|
760
|
-
`examples/launch-lifecycle-smoke.
|
|
940
|
+
`examples/launch-lifecycle-smoke.ts manifest.json sdk-plans.json` executes Solidity-exported
|
|
761
941
|
plans only on explicitly authorized owned loopback fixtures. It exercises atomic/staged
|
|
762
942
|
modes, typed predeployment, ordered buys, permanent custody, canonical recovery, no-argument
|
|
763
943
|
V3 harvest, and authenticated author claims. `test/lifecycle-chain.test.mjs` exercises
|
|
@@ -767,28 +947,135 @@ local-execution opt-in and required files.
|
|
|
767
947
|
|
|
768
948
|
## Individual token creation examples
|
|
769
949
|
|
|
770
|
-
|
|
771
|
-
the shared `runLaunchExample(caseObject)` using
|
|
772
|
-
fixture files.
|
|
773
|
-
|
|
950
|
+
Eleven independent `examples/launch-erc20-*.ts` / `launch-erc404-*.ts` files invoke
|
|
951
|
+
the shared `runLaunchExample(caseObject)` using valuation-driven economics with no
|
|
952
|
+
required CLI parameters or fixture files. **No mode flag means a dry run**:
|
|
953
|
+
the first output is `DRY RUN — no transactions signed or broadcast.`, followed by
|
|
954
|
+
the full economic review and retained planning artifacts. Successful planning exits
|
|
955
|
+
`0` without constructing a wallet signer, signing, broadcasting, uploading or publishing.
|
|
956
|
+
The final output line is the same case command with `--broadcast` appended:
|
|
957
|
+
|
|
958
|
+
```sh
|
|
959
|
+
node examples/launch-erc20-v4.ts
|
|
960
|
+
node examples/launch-erc20-v4.ts --broadcast
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
**`--broadcast` authorizes full execution and intentionally skips manual
|
|
964
|
+
economic-review admission.** It prints/saves the same review and computed hash,
|
|
965
|
+
plans afresh against current state, then performs guarded signing, broadcast,
|
|
966
|
+
chain verification, image upload and publication. It does not execute the dry run's
|
|
967
|
+
saved plan. Unknown, duplicate or mixed flags fail fast with usage text.
|
|
968
|
+
Optional `--resume <recovery-dir>` continues the original committed launch unchanged,
|
|
969
|
+
without needing `--broadcast`. CLI dry-run/broadcast selection is independent of
|
|
970
|
+
the case's atomic/staged execution mode. The eight original cases remain; the three additions
|
|
971
|
+
(`launch-erc20-multi-quote.ts`, `launch-erc20-depth-v4.ts`, and
|
|
972
|
+
`launch-erc20-dividends-multiquote-mixed.ts`) await user live-run validation before
|
|
973
|
+
any replacement decision. See the [example guide](../examples/README.md#individual-token-creation)
|
|
974
|
+
for all one-line commands and setup-once working-directory `.env`.
|
|
774
975
|
Node 24+ loads `.env` once, with existing process environment taking precedence.
|
|
775
|
-
`
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
976
|
+
`LAUNCH_API_URL` and **exactly one** signer source are required before RPC/signing/API
|
|
977
|
+
work: `PRIVATE_KEY`, or `EXAMPLE_KEYSTORE_PATH` for an owner-only local V3
|
|
978
|
+
scrypt/AES-128-CTR JSON keystore. `EXAMPLE_KEYSTORE_PASSWORD` defaults to the empty
|
|
979
|
+
string; both/neither sources reject. The bounded keystore loader authenticates the
|
|
980
|
+
MAC and declared address before deriving the creator. There is no default key,
|
|
981
|
+
guessed metadata API or API-omission mode. Dry runs derive only the public creator
|
|
982
|
+
address (keystore decryption is allowed for this); local signing methods are constructed
|
|
983
|
+
only for broadcast or nonterminal resume execution. Broadcast mainnet writes are
|
|
984
|
+
irreversible. The official chain-4663 RPC is the default.
|
|
779
985
|
|
|
780
986
|
The implementation imports public `@black-market/sdk`, resolves `getAddresses(4663)`,
|
|
781
|
-
derives the creator from the
|
|
782
|
-
bound topology/config `6` on a
|
|
783
|
-
`1`.
|
|
784
|
-
|
|
987
|
+
derives the creator from the selected signer and discovers actual admitted profiles.
|
|
988
|
+
V4 requires bound topology/config `6` on a V2-constructor graph; Abyss requires exact
|
|
989
|
+
adapter `profileId(3)` QUOTE_ORACLE/config `1`. WETH verifies wrapped-native
|
|
990
|
+
binding/18 decimals and registered P1 oracle `(1,4096)`. USDG uses 6 decimals,
|
|
991
|
+
the reviewed `usdPeg` USD-X18 seed `1e18`, and a compatible registered oracle
|
|
992
|
+
discovered from pinned factory history/mapping, not an invented WETH oracle ID.
|
|
993
|
+
The eight original cases retain their token/reward/market/position/mode choices:
|
|
785
994
|
ERC20 `1_000_000e18` supply; ERC404 `10_000e18` supply / `100e18` NFT unit; selected
|
|
786
|
-
staking/dividends and token-only burn; one through five
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
995
|
+
staking/dividends and token-only burn; one through five positions and ordered buys.
|
|
996
|
+
All cases now fund those buys through native-ETH Kyber conversion. Identity,
|
|
997
|
+
finalized salts and exact plans are saved before execution; refusal never changes
|
|
998
|
+
mode, drops positions/buys or overrides failed admission.
|
|
999
|
+
Pricing uses a USD 5000 target (optional exact `EXAMPLE_TARGET_MARKET_CAP_USD`),
|
|
1000
|
+
actual total minted supply, predicted token order and each market's integer budget.
|
|
1001
|
+
`deriveLaunchPoolRecipe` owns one-position pricing/liquidity; multi-position markets
|
|
1002
|
+
use `deriveLaunchPositionRanges` with exact counts, `positionGaps: "adjacent"` and a
|
|
1003
|
+
boundary final tail. Staircase remains the original multi-position default; the
|
|
1004
|
+
four-position progressive Depth case uses Early Scarcity with adjacent bands and
|
|
1005
|
+
increasing inventory allocations, not the separate historical eight-position
|
|
1006
|
+
catalogue. Both venues use spacing 60/LP fee 3000. There is no 1:1 price,
|
|
1007
|
+
fixed-liquidity reserve or arbitrary absolute range. All intended supply funds LP
|
|
1008
|
+
except explicitly computed rounded-up mint-debit dust, which burns.
|
|
1009
|
+
|
|
1010
|
+
Every opening buy defaults to **0.00001 native ETH** (`10000000000000` wei).
|
|
1011
|
+
`EXAMPLE_BUY_AMOUNT_WEI` overrides the ETH input per buy, not the eventual quote
|
|
1012
|
+
amount. The runner aggregates inputs by quote and obtains one fresh
|
|
1013
|
+
`POST /api/v1/quote/kyber/build?chainId=4663` build per quote, using native
|
|
1014
|
+
zero-address `tokenIn`, exact input, actual escrow sender/recipient, **50 bps**
|
|
1015
|
+
conversion slippage and the same fixed **300-second launch-purpose deadline**
|
|
1016
|
+
as the plan. `EXAMPLE_KYBER_API_URL` defaults to `LAUNCH_API_URL`; the app's public
|
|
1017
|
+
trade default is `https://api.abyss.trading`, so a different service must be chosen
|
|
1018
|
+
explicitly. The API owns route preview; preview GET bytes are not executable funding.
|
|
1019
|
+
|
|
1020
|
+
Each row is `LifecycleFundingKind.Swap`, with native zero-address `inputAsset`,
|
|
1021
|
+
the reviewed router target and original built calldata. The runner decodes the
|
|
1022
|
+
reviewed `swap` entry point and binds currencies, escrow recipient, exact input,
|
|
1023
|
+
minimum output, executor payload and flags. The API floor
|
|
1024
|
+
`amountOutMinimum = floor(amountOut * 9950 / 10000)` becomes the quote budget;
|
|
1025
|
+
ordered buys sharing a quote divide that budget, assigning the integer remainder
|
|
1026
|
+
to the last buy. The creator needs native ETH for conversion **plus gas**, not
|
|
1027
|
+
WETH/USDG wallet balances or ERC20 approvals. Registry target/spender/code-hash
|
|
1028
|
+
admission is checked and rechecked before signatures. Any refusal stops unsigned
|
|
1029
|
+
with retained evidence, never a native-wrap/direct-ERC20/separate-wallet-swap
|
|
1030
|
+
fallback, route retry or rewritten deadline.
|
|
1031
|
+
|
|
1032
|
+
Optional `EXAMPLE_TOKEN_NAME`, `EXAMPLE_TOKEN_SYMBOL` and
|
|
1033
|
+
`EXAMPLE_TOKEN_DESCRIPTION` override each case's defaults while retaining the
|
|
1034
|
+
existing normalized text and API/lifecycle length limits. Optional
|
|
1035
|
+
`EXAMPLE_IMAGE_PATH` supplies actual PNG/JPEG/WebP artwork, bounded to 1 byte
|
|
1036
|
+
through 5 MiB. Its exact SHA-256/content-type/length is part of the reviewed,
|
|
1037
|
+
signed attribution; the runner follows the API-issued upload and completion flow.
|
|
1038
|
+
Without that option, metadata-only sessions still require `image: null`.
|
|
1039
|
+
|
|
1040
|
+
The indicative WETH USD seed comes only from the configured `LAUNCH_API_URL` token-prices
|
|
1041
|
+
API: one uncached GET `/api/v1/token-prices?chainId=4663&limit=100`, with a 30-second
|
|
1042
|
+
timeout, 1 MiB streamed body limit and no pagination, redirects or retries. The
|
|
1043
|
+
reviewed WETH row must have chain 4663, ready metadata, 18 decimals, `priced: true`,
|
|
1044
|
+
anchor source and direct WETH/Chainlink provenance with aggregator
|
|
1045
|
+
`0x78F3556b67E17Df817D51Ef5a990cDaF09E8d3A9`. Price parsing requires an exact positive
|
|
1046
|
+
uint256 decimal `priceUsdX18`. Missing, unpriced, mismatched or unavailable data
|
|
1047
|
+
rejects without a manual or alternate-source fallback. API publication supplies
|
|
1048
|
+
an indicative launch valuation, not executable swap, receipt or chain authority.
|
|
1049
|
+
API origin, index/graph blocks, upstream timestamp/age and local retrieval time are
|
|
1050
|
+
preserved and displayed; retrieval does not refresh the upstream observation.
|
|
1051
|
+
There is no 15-minute contract-round gate or API-block canonicality requirement.
|
|
1052
|
+
Public `economic-review.json` and exact private recovery precede the first signature.
|
|
1053
|
+
Review includes quote/source/time, target, actual minted supply, exact price
|
|
1054
|
+
orientation, all allocations/liquidity/fees,
|
|
1055
|
+
expected retained supply and aligned opening valuations. The final admitted
|
|
1056
|
+
activation simulation supplies each ordered buy's quote spent/token output,
|
|
1057
|
+
all-in average USD/token and fee-plus-price-impact premium. This is not a claim
|
|
1058
|
+
of simulated final marginal spot. Alignment and buys mean the eventual valuation
|
|
1059
|
+
need not equal USD 5000; use actual retained supply and observed post-buy price.
|
|
1060
|
+
|
|
1061
|
+
The computed review hash is provenance evidence, never an authorization input:
|
|
1062
|
+
there is no interactive prompt or environment hash gate. `--broadcast` alone is
|
|
1063
|
+
the explicit mode authorization, recorded in `economic-admission.json` as
|
|
1064
|
+
`authorization: "--broadcast"` with the computed hash; this artifact is not another gate.
|
|
1065
|
+
Before each attribution/transaction signature, the immutable review hash, saved
|
|
1066
|
+
plan/supply/order/target and fresh RPC token prediction are rechecked, then the same
|
|
1067
|
+
API source is reread. A changed exact price, API origin, chain, WETH/decimals or
|
|
1068
|
+
direct-anchor identity/kind/source rejects without rewriting intent. Failed or
|
|
1069
|
+
unpriced reads reject. Index/graph and observation/retrieval times may advance for
|
|
1070
|
+
an unchanged exact price and source, without replacing the original review.
|
|
1071
|
+
RPC still owns provider chain, balances, nonce, deadlines and native execution
|
|
1072
|
+
proof. The saved deadline is checked again after asynchronous quote/authority
|
|
1073
|
+
reads and before signatures/staging; expiry stops without extending it.
|
|
1074
|
+
Partial execution never grants permission to replay or silently adopt different economics.
|
|
1075
|
+
The current 0.7.1 V4 examples require the config6/V2 profile, freezing max `10000`,
|
|
1076
|
+
min `1000` pips and sensitivity `7654321` fee-pips × seconds/tick. Its reviewed
|
|
1077
|
+
`FixedFeePoolHookV1` charges the fixed maximum `10000` pips (1%) on applicable amounts;
|
|
1078
|
+
minimum and sensitivity are stored constructor evidence, not a dynamic fee schedule.
|
|
792
1079
|
Optional `NFT_BASE_URI` provides an ERC404 base URI you actually host; its default is
|
|
793
1080
|
empty, with real NFT units/mirror behavior but no claim of hosted NFT metadata.
|
|
794
1081
|
|
|
@@ -808,31 +1095,76 @@ Actual verification covers Active state, factory/token runtime/name/symbol/kind/
|
|
|
808
1095
|
ERC404 unit/URI/mirror, opened markets, sealed V4 custody/permanent Abyss lock terms,
|
|
809
1096
|
fee policies and ordered activation buys.
|
|
810
1097
|
|
|
811
|
-
Actual SDK API metadata staging uses locally signed full-domain attribution.
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
1098
|
+
Actual SDK API metadata staging uses locally signed full-domain attribution.
|
|
1099
|
+
Before **every** publication attempt and before final success, a fresh canonical
|
|
1100
|
+
RPC barrier binds the original activation hash/receipt to the saved commitment
|
|
1101
|
+
and Active state; a different later activation observation cannot replace it.
|
|
1102
|
+
Only that original hash is published. Genuine pending-indexer HTTP `202` is
|
|
1103
|
+
polled within 90 seconds respecting `Retry-After`; other failures are not retried.
|
|
1104
|
+
Success requires an optimistic/final session and real indexed
|
|
1105
|
+
`/api/v1/launches/<token>?chainId=4663` DTO with matching creator/token/hash/metadata.
|
|
1106
|
+
Missing/incompatible indexing fails without manufacturing projections, skipping
|
|
1107
|
+
API or launching another token.
|
|
1108
|
+
|
|
1109
|
+
When `EXAMPLE_IMAGE_PATH` is set, metadata staging alone is insufficient:
|
|
1110
|
+
|
|
1111
|
+
1. The completed session must show the exact signed SHA-256/content-type/length
|
|
1112
|
+
and a ready image.
|
|
1113
|
+
2. Publication must retain that descriptor and reference a ready public image.
|
|
1114
|
+
3. The indexed token must carry a non-null matching `imageUrl`, with matching
|
|
1115
|
+
metadata type/length and a token-bound `imageKey`.
|
|
1116
|
+
4. One bounded, no-redirect GET of that URL must return **HTTP 200**, an image
|
|
1117
|
+
content-type family and nonempty bytes. Byte-identical output must match the
|
|
1118
|
+
upload's exact SHA-256/type/length. Different served bytes are recorded as an
|
|
1119
|
+
inferred API/CDN transformation, proving only the image-family/nonempty-body
|
|
1120
|
+
check, not byte identity. The canonical RPC barrier runs again after this GET.
|
|
1121
|
+
|
|
1122
|
+
Any failed binding, HTTP/type/size/body check exits nonzero with retained evidence;
|
|
1123
|
+
there is no image retry or metadata-only fallback. Without an image path, the
|
|
1124
|
+
metadata-only null-image behavior remains.
|
|
1125
|
+
|
|
1126
|
+
Every dry run or broadcast automatically creates fresh `launch-results/<timestamp-case-random>/`;
|
|
1127
|
+
`--resume` appends recovery evidence in the original directory. Dry runs retain
|
|
1128
|
+
all planning/review/recovery artifacts, but no admission, signed bytes, API session
|
|
1129
|
+
or publication artifacts:
|
|
819
1130
|
|
|
820
1131
|
| Artifact | Evidence |
|
|
821
1132
|
| --- | --- |
|
|
822
1133
|
| `events.jsonl` | Timestamped case/stage events, RPC/API errors, admission/simulation and actual chain observations. |
|
|
823
|
-
| `plan.json` |
|
|
824
|
-
| `
|
|
825
|
-
| `
|
|
1134
|
+
| `plan.json` | Redacted finalized plan for public inspection, not exact recovery authority. |
|
|
1135
|
+
| `economic-review.json` | Public exact quotes, native Kyber inputs/calldata/minima/deadline, metadata/image descriptors, target, aligned minted/retained valuation, position budgets/debits/dust, fees, protected buys and simulated all-in execution prices; redacted, not recovery authority. |
|
|
1136
|
+
| `economic-admission.json` | Broadcast-only mode authorization (`authorization: "--broadcast"`) and computed review hash as provenance, not supplied-hash admission. |
|
|
1137
|
+
| `receipts.json` | Empty for a dry run; execution retains exact signed-envelope hashes pre-broadcast, followed by real receipts/references. |
|
|
1138
|
+
| `result.json` | `black-market.launch-example-result.v1`, runMode, scope, status, failure stage and causal evidence. A successful dry run has `scope: "planning"` and `execution: "dry-run"`; it does not claim chain/API completion. |
|
|
826
1139
|
| `published-token.json` | Actual indexed API representation. |
|
|
827
|
-
| `
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
1140
|
+
| `published-image.json` | Optional bounded public-image HTTP/type/length/SHA-256 verification, transformation qualification or failure evidence. |
|
|
1141
|
+
| `private-recovery.json` | Mode `0600`; complete exact finalized `plan`, original `mode`/`confirmations` and immutable economic review/hash saved during planning. Broadcast adds immutable mode authorization/hash provenance, signed raw bytes, API signature and one-time capability retained across updates. Never share/commit. |
|
|
1142
|
+
|
|
1143
|
+
Public artifacts preserve structured field names and redact sensitive values:
|
|
1144
|
+
known keys/signatures/raw bytes/capabilities/auth values and endpoint secrets,
|
|
1145
|
+
while retaining public calldata/hashes/revert bytes. `node examples/<case>.ts
|
|
1146
|
+
--resume <recovery-dir>` reloads the owner-only exact plan, retained economic authorization
|
|
1147
|
+
provenance, original mode/confirmations/restrictions and typed original inclusion references.
|
|
1148
|
+
Fresh `planLaunch` (never preparation/mining) re-admits that commitment.
|
|
1149
|
+
Canonical Preparing/Ready runs only the remaining build-next sequence; canonical
|
|
1150
|
+
Active recovers the retained activation receipt and performs verification and
|
|
1151
|
+
publication only. Missing/unconfirmed, moved/reorged or replaced receipt evidence
|
|
1152
|
+
and unresolved signed hashes stop for read-only reconciliation, never replay.
|
|
1153
|
+
The API session is refreshed while retaining its one-time capability. A pending
|
|
1154
|
+
image requires the original `EXAMPLE_IMAGE_PATH` bytes and signed SHA-256/type/length;
|
|
1155
|
+
only expired PUT responses (403/410/412) permit one upload-URL renewal/retry.
|
|
1156
|
+
Existing chain verification and every publication canonicality barrier remain required.
|
|
1157
|
+
Never reload redacted `plan.json` as the commitment. See
|
|
1158
|
+
[recovery instructions](../examples/README.md#evidence-and-failure-recovery).
|
|
1159
|
+
Configuration, admission, broadcast, publication and interruption failures exit
|
|
1160
|
+
nonzero and preserve evidence. No source rollback, cancellation, broadcast retry or
|
|
1161
|
+
relaunch occurs.
|
|
833
1162
|
Inspect retained transaction hashes before deciding to run a new case after an
|
|
834
|
-
ambiguous send. `test/launch-example.test.mjs`
|
|
835
|
-
|
|
1163
|
+
ambiguous send. `test/launch-example.test.mjs`, `test/launch-example-matrix.test.mjs`,
|
|
1164
|
+
`test/launch-example-mode.test.mjs` and `test/launch-example-resume.test.mjs` cover offline
|
|
1165
|
+
financial bounds, funding/rounding, quote/admission, signing/retention/config, default
|
|
1166
|
+
dry-run/no-signing/banner/command, broadcast routing and resume boundaries,
|
|
1167
|
+
not actual chain/API proof. The older independent whole-graph local
|
|
836
1168
|
Solidity-exported proof remains separate.
|
|
837
1169
|
|
|
838
1170
|
## Real HTTP API integration
|
package/examples/.env.example
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
# Copy to .env in the directory from which you run node (Node 24+).
|
|
2
|
-
#
|
|
1
|
+
# Copy to .env in the directory from which you run node examples/<case>.ts (Node 24+).
|
|
2
|
+
# Step 1: node examples/<case>.ts plans/reviews and saves artifacts; no signing or writes.
|
|
3
|
+
# Step 2: node examples/<case>.ts --broadcast signs, spends native ETH and publishes.
|
|
4
|
+
# --broadcast is authorization by design: no economic-review hash prompt/input.
|
|
5
|
+
# The computed review hash remains printed and saved as provenance.
|
|
6
|
+
# --resume <original-run-dir> continues an existing launch/publication unchanged.
|
|
7
|
+
# Configure exactly one creator/signer source; leave PRIVATE_KEY blank with a keystore.
|
|
8
|
+
# Dry runs derive only its public address; no wallet signer is constructed.
|
|
3
9
|
PRIVATE_KEY=
|
|
10
|
+
# EXAMPLE_KEYSTORE_PATH=/absolute/path/to/owner-only-v3-scrypt-keystore
|
|
11
|
+
# EXAMPLE_KEYSTORE_PASSWORD=
|
|
12
|
+
# Required API service root, for quote reads in dry-run and staging/publication in broadcast.
|
|
4
13
|
LAUNCH_API_URL=
|
|
5
14
|
|
|
6
15
|
# Optional: blank uses the SDK official Robinhood chain-4663 mainnet RPC.
|
|
@@ -8,6 +17,17 @@ RPC_URL=
|
|
|
8
17
|
# Optional ERC404 NFT metadata base URI that you actually host; blank means empty URI.
|
|
9
18
|
NFT_BASE_URI=
|
|
10
19
|
|
|
20
|
+
# Optional native ETH conversion input PER BUY (Kyber Swap funding for WETH/USDG).
|
|
21
|
+
# EXAMPLE_BUY_AMOUNT_WEI=10000000000000
|
|
22
|
+
# Optional Kyber API origin; unset uses LAUNCH_API_URL. No route/funding fallback.
|
|
23
|
+
# EXAMPLE_KYBER_API_URL=
|
|
24
|
+
# Optional exact USD target, token identity and actual PNG/JPEG/WebP artwork.
|
|
25
|
+
# EXAMPLE_TARGET_MARKET_CAP_USD=5000
|
|
26
|
+
# EXAMPLE_TOKEN_NAME=
|
|
27
|
+
# EXAMPLE_TOKEN_SYMBOL=
|
|
28
|
+
# EXAMPLE_TOKEN_DESCRIPTION=
|
|
29
|
+
# EXAMPLE_IMAGE_PATH=/absolute/path/to/image.png
|
|
30
|
+
|
|
11
31
|
# Optional local tightening restrictions. Blank/unset means unknown, not refused.
|
|
12
32
|
# Nitro protocol compute caps and poster budgeting are read natively at the pinned block.
|
|
13
33
|
# EXAMPLE_CHAIN_GAS_CAP=
|