@black-market/sdk 0.5.1 → 0.5.2
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 +18 -135
- package/assets/abyss-social.webp +0 -0
- package/package.json +2 -2
- package/assets/splash.png +0 -0
package/README.md
CHANGED
|
@@ -1,83 +1,29 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Abyss TypeScript SDK
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[Robinhood Chain](https://robinhoodchain.blockscout.com). Built on
|
|
7
|
-
[viem](https://viem.sh): ESM, Node.js 20+, bigint amounts.
|
|
5
|
+
Token launches, swaps, and lending with [viem](https://viem.sh).
|
|
8
6
|
|
|
9
7
|
## Install
|
|
10
8
|
|
|
11
9
|
```sh
|
|
12
|
-
|
|
13
|
-
# or: pnpm add @black-market/sdk viem
|
|
10
|
+
pnpm add @black-market/sdk viem
|
|
14
11
|
```
|
|
15
12
|
|
|
16
|
-
##
|
|
13
|
+
## Examples
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
no wallet, private key, or transaction is needed.
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
import {
|
|
23
|
-
createProtocolPublicClient, getAddresses, readLifecycleProfiles,
|
|
24
|
-
} from "@black-market/sdk";
|
|
25
|
-
|
|
26
|
-
const client = createProtocolPublicClient({ chainId: 4663 });
|
|
27
|
-
const { launchOrchestrator } = getAddresses(4663);
|
|
28
|
-
const profiles = await readLifecycleProfiles({ client, orchestrator: launchOrchestrator });
|
|
29
|
-
console.table(profiles.map(({ id, venueKind, topology, admitted, reason }) => ({
|
|
30
|
-
profile: id, venue: venueKind, config: topology.configVersion, admitted, reason,
|
|
31
|
-
})));
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
The mined deployment has **pool-bound V4 config 5** and **Abyss config 1**:
|
|
35
|
-
two adapters and five profiles. Discovery checks registry binding, runtime and
|
|
36
|
-
dependency commitments, and current admission—not a hard-coded template list.
|
|
37
|
-
|
|
38
|
-
From this repository, the same read-only example is available with:
|
|
15
|
+
Clone this repository to run the examples. Requires Node 24+.
|
|
39
16
|
|
|
40
17
|
```sh
|
|
41
|
-
pnpm install
|
|
42
|
-
|
|
43
|
-
# Optional RPC override: RPC_URL=https://your-robinhood-rpc pnpm examples
|
|
18
|
+
pnpm install && pnpm build
|
|
19
|
+
node examples/quickstart.mjs
|
|
44
20
|
```
|
|
45
21
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
1. Discover an admitted profile and copy its exact schema, bounds, and author terms.
|
|
49
|
-
2. Build an explicit `LaunchPlanV1`: creator, token, sorted funding/fee policies,
|
|
50
|
-
market budgets/configs, ordered buys, deadline, and selected developer rate.
|
|
51
|
-
3. For V4 config 5, finalize its hook salt with `preparePoolBoundLifecyclePlan`.
|
|
52
|
-
Save `serializeLaunchPlan(result.plan)`; do not submit a draft commitment.
|
|
53
|
-
4. Review `planLaunch` with an explicit `"atomic"` or `"staged"` mode and current
|
|
54
|
-
execution limits. Use `readLaunchProgress` and `buildNextTransaction` for recovery.
|
|
55
|
-
5. Your application authenticates the wallet chain, signs the exact admitted
|
|
56
|
-
transaction, and stores receipt references. SDK planning/builders never sign.
|
|
57
|
-
|
|
58
|
-
Staged preparation does **not** split activation: minting, permanent locking,
|
|
59
|
-
every initial buy, and public opening remain one transaction. Unavailable
|
|
60
|
-
stateful simulation or execution-limit evidence prevents executable admission.
|
|
22
|
+
The quickstart reads available launch profiles without a wallet.
|
|
61
23
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
also includes read-only discovery and unsigned saved-plan review. `LaunchApiClient`
|
|
66
|
-
handles signed metadata sessions and publication; it does not broadcast a chain launch.
|
|
67
|
-
|
|
68
|
-
## Launch examples: one command per case
|
|
69
|
-
|
|
70
|
-
**Running any command below deliberately signs, spends funds, launches a token,
|
|
71
|
-
and publishes through your configured API. Mainnet execution is irreversible.**
|
|
72
|
-
No flags, parameters, fixture files, default private keys or API skips are used.
|
|
73
|
-
|
|
74
|
-
Setup once with **Node 24+**: install dependencies (`pnpm install` in this repository,
|
|
75
|
-
or `pnpm add @black-market/sdk viem` in a consumer), copy
|
|
76
|
-
[`examples/.env.example`](https://github.com/abysshopper/black-market-node-sdk/blob/main/examples/.env.example)
|
|
77
|
-
to `.env` in your working directory, and set your funded wallet's `PRIVATE_KEY`
|
|
78
|
-
and actual `LAUNCH_API_URL`. Existing process environment wins over `.env`.
|
|
79
|
-
Consumer projects may copy the example files plus both shared helpers into `examples/`;
|
|
80
|
-
the implementation imports the installed public `@black-market/sdk` package.
|
|
24
|
+
For token launches, set `PRIVATE_KEY` and `LAUNCH_API_URL` in your working
|
|
25
|
+
folder's `.env`. An optional `RPC_URL` overrides the default endpoint.
|
|
26
|
+
Run one example for the token you want to create:
|
|
81
27
|
|
|
82
28
|
```sh
|
|
83
29
|
node examples/launch-erc20-v4.mjs
|
|
@@ -90,73 +36,10 @@ node examples/launch-erc20-burn-mixed.mjs
|
|
|
90
36
|
node examples/launch-erc404-dividends-mixed.mjs
|
|
91
37
|
```
|
|
92
38
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
support is required. Admission failures do not change mode or economics.
|
|
97
|
-
Gas/calldata defaults are **EXAMPLE ceilings, not verified provider/account limits**.
|
|
98
|
-
Full setup, exact case economics, optional environment caps, and recovery are in the
|
|
99
|
-
[example guide](https://github.com/abysshopper/black-market-node-sdk/blob/main/examples/README.md#individual-token-creation).
|
|
100
|
-
|
|
101
|
-
Every run creates a fresh `launch-results/<timestamp-case-random>/` and retains
|
|
102
|
-
redacted logs, plans, signed transaction hashes **before broadcast**, and real receipts
|
|
103
|
-
even on failure. Only `private-recovery.json` (mode `0600`) stores raw signed bytes,
|
|
104
|
-
API signatures and capabilities. **Do not blindly rerun after an ambiguous broadcast**;
|
|
105
|
-
inspect the retained hash first. There is no broadcast retry, relaunch or source rollback.
|
|
106
|
-
|
|
107
|
-
## Networks and configuration
|
|
108
|
-
|
|
109
|
-
| Chain | Use | Launch defaults |
|
|
110
|
-
| --- | --- | --- |
|
|
111
|
-
| `4663` | Robinhood mainnet | Current mined deployment |
|
|
112
|
-
| `46631` | Robinhood fork workbench | Explicit environment configuration |
|
|
113
|
-
| `31337` | Local Anvil | Explicit environment configuration |
|
|
114
|
-
|
|
115
|
-
Pass a chain ID explicitly: `getAddresses()` otherwise selects `46631`, while
|
|
116
|
-
client factories otherwise select local `31337`. Mainnet lending addresses come
|
|
117
|
-
from the replacement infrastructure; canonical Abyss DEX utilities remain available.
|
|
118
|
-
|
|
119
|
-
| Mainnet launch contract | Address |
|
|
120
|
-
| --- | --- |
|
|
121
|
-
| Orchestrator | `0xb75CBD17b9aecb7305B4DFcDa69595F783341c0E` |
|
|
122
|
-
| Implementation registry | `0xaa8a410709B79cBA6F118F1be1FF568877A3B8Ee` |
|
|
123
|
-
| Fee-owner registry | `0x15778Aad08e12D458B2848F035860e2a8c2a0725` |
|
|
124
|
-
|
|
125
|
-
Launch address overrides are evaluated on import: bare `LAUNCH_ORCHESTRATOR`,
|
|
126
|
-
`LAUNCH_IMPLEMENTATION_REGISTRY`, and `LAUNCH_FEE_OWNER_REGISTRY` take precedence
|
|
127
|
-
over their `VITE_` and `NEXT_PUBLIC_` forms. Configure the whole matching graph.
|
|
128
|
-
Client RPC precedence is explicit `rpcUrl`, then `RPC_URL`, then the selected
|
|
129
|
-
chain's default endpoint. See the guide for DEX/lending override details.
|
|
130
|
-
The browser-safe `@black-market/sdk/lifecycle` entrypoint contains launch codecs,
|
|
131
|
-
ABIs, planning, recovery, and author APIs without selecting a deployed address.
|
|
132
|
-
|
|
133
|
-
## Tests
|
|
134
|
-
|
|
135
|
-
```sh
|
|
136
|
-
pnpm test # Build and run the offline node:test unit suite
|
|
137
|
-
pnpm typecheck # TypeScript public surface
|
|
138
|
-
LAUNCH_API_TEST_URL=http://127.0.0.1:18763 pnpm test:api
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
`test:api` uses actual HTTP session reads and capability boundaries, without a key
|
|
142
|
-
or writes. It requires a running abyss-api service with launch-session routes and
|
|
143
|
-
real application storage. Missing configuration/storage or an unreachable service
|
|
144
|
-
fails the explicitly selected suite; integration tests are not part of `pnpm test`.
|
|
145
|
-
|
|
146
|
-
For signed metadata-only create/read/replay/conflict/authorization tests, use an
|
|
147
|
-
**owned disposable loopback service and database**, with an explicit disposable key:
|
|
148
|
-
|
|
149
|
-
```sh
|
|
150
|
-
LAUNCH_API_TEST_URL=http://127.0.0.1:18763 \
|
|
151
|
-
LAUNCH_API_TEST_PRIVATE_KEY="$DISPOSABLE_TEST_PRIVATE_KEY" pnpm test:api:write
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
`LAUNCH_API_TEST_CHAIN_ID` defaults to `4663`; `LAUNCH_API_TEST_ORCHESTRATOR`
|
|
155
|
-
defaults to the mainnet orchestrator above and must match the service signing domain.
|
|
156
|
-
No image store, indexed launch, funded wallet, or chain write is required. These
|
|
157
|
-
sessions prove HTTP metadata behavior, not image publication or a chain launch.
|
|
158
|
-
Service requirements are in the [API integration section](https://github.com/abysshopper/black-market-node-sdk/blob/main/docs/launch-lifecycle.md#real-http-api-integration).
|
|
159
|
-
|
|
160
|
-
## License
|
|
39
|
+
Launch examples spend real funds and publish to your configured API.
|
|
40
|
+
Plans, transaction hashes, receipts, and errors are saved in `launch-results/`.
|
|
41
|
+
Keep `.env` and private recovery files out of Git.
|
|
161
42
|
|
|
162
|
-
|
|
43
|
+
[Example setup](https://github.com/abysshopper/black-market-node-sdk/tree/main/examples)
|
|
44
|
+
· [API guide](https://github.com/abysshopper/black-market-node-sdk/blob/main/docs/launch-lifecycle.md)
|
|
45
|
+
· [MIT license](https://github.com/abysshopper/black-market-node-sdk/blob/main/LICENSE)
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@black-market/sdk",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "TypeScript SDK for Abyss token launches, swaps, and lending.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
package/assets/splash.png
DELETED
|
Binary file
|