@hyperbridge/simplex 0.16.8 → 0.16.12
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 +31 -14
- package/dist/bin/simplex.js +23880 -2112
- package/dist/bin/simplex.js.map +1 -1
- package/dist/config-storage.cjs +186 -0
- package/dist/config-storage.cjs.map +1 -0
- package/dist/config-storage.d.cts +28 -0
- package/dist/config-storage.d.ts +28 -0
- package/dist/config-storage.js +163 -0
- package/dist/config-storage.js.map +1 -0
- package/dist/index.cjs +704 -295
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +246 -100
- package/dist/index.d.ts +246 -100
- package/dist/index.js +579 -175
- package/dist/index.js.map +1 -1
- package/dist/sqlite.cjs +12 -0
- package/dist/sqlite.cjs.map +1 -1
- package/dist/sqlite.d.cts +2 -1
- package/dist/sqlite.d.ts +2 -1
- package/dist/sqlite.js +12 -0
- package/dist/sqlite.js.map +1 -1
- package/dist/{types-C7rnnKWn.d.cts → types-B5zkFhxR.d.cts} +11 -1
- package/dist/{types-C7rnnKWn.d.ts → types-B5zkFhxR.d.ts} +11 -1
- package/dist/ui/assets/{index-BQu6BMxc.js → index-QU1Ik7IX.js} +35 -35
- package/dist/ui/assets/{index-C3T-gubp.css → index-XKHMOpY2.css} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -55,19 +55,29 @@ simplex.on("order:filled", ({ orderId, profitUsd }) => {
|
|
|
55
55
|
})
|
|
56
56
|
|
|
57
57
|
// Every runtime control the dashboard offers is a method — nothing needs a restart.
|
|
58
|
-
|
|
58
|
+
// Prices come from limit orders posted to the HyperFX orderbook: 10,000 USDC in for
|
|
59
|
+
// 13,900,000 CNGN out, filled on Base, for swaps from Ethereum or Base.
|
|
60
|
+
await simplex.limitOrders.create({
|
|
61
|
+
fillChain: "EVM-8453",
|
|
62
|
+
tokenIn: "USDC",
|
|
63
|
+
amountIn: "10000",
|
|
64
|
+
tokenOut: "CNGN",
|
|
65
|
+
amountOut: "13900000",
|
|
66
|
+
acceptedSources: ["EVM-1", "EVM-8453"],
|
|
67
|
+
})
|
|
59
68
|
await simplex.chains.setRpcUrls(8453, ["https://base-new.example"])
|
|
60
69
|
|
|
61
70
|
await simplex.stop()
|
|
62
71
|
```
|
|
63
72
|
|
|
64
73
|
`Simplex.start` takes a plain config object — no TOML file required — and returns once the solver is
|
|
65
|
-
running.
|
|
74
|
+
running. The config must name an `orderbook`; it carries no prices, and the solver fills only against
|
|
75
|
+
the limit orders you create while it runs. It logs nothing until you point `logger` at a sink, so importing the package never writes to
|
|
66
76
|
your stdout.
|
|
67
77
|
|
|
68
78
|
Signing is an interface, not a setting. `Signer` is an identity and three operations — sign this
|
|
69
79
|
typed data, this EIP-7702 authorization, this transaction — with no viem types on it, so satisfying
|
|
70
|
-
it never means matching this package's viem version. `privateKeySigner`,
|
|
80
|
+
it never means matching this package's viem version. `privateKeySigner`, `secretPhraseSigner`,
|
|
71
81
|
`turnkeySigner` and `mpcVaultSigner` ship with the package, `viemSigner` adapts any viem account (a
|
|
72
82
|
`toAccount` wrapper around an HSM or a remote signing service included), and your own implementation
|
|
73
83
|
is a first-class citizen. Persistence is pluggable the same way: the default
|
|
@@ -90,7 +100,7 @@ still `simplex`. Prefer a container? The same binary ships as
|
|
|
90
100
|
Hub page.
|
|
91
101
|
|
|
92
102
|
With no config present, `simplex` opens a local browser wizard that walks through the minimum setup
|
|
93
|
-
(chains, RPCs, bundlers, signer, Hyperbridge account
|
|
103
|
+
(chains, RPCs, bundlers, signer, Hyperbridge account), validates every endpoint live,
|
|
94
104
|
writes a commented `filler-config.toml` (mode 600) and starts the solver in the same process.
|
|
95
105
|
`simplex init` is the equivalent terminal wizard.
|
|
96
106
|
|
|
@@ -101,12 +111,11 @@ With a config present (`./filler-config.toml`, `$SIMPLEX_HOME/config.toml`, or `
|
|
|
101
111
|
|
|
102
112
|
The solver serves a local web UI at `127.0.0.1:8686` by default:
|
|
103
113
|
|
|
104
|
-
- setup wizard (when no config exists) — private key, MPCVault or Turnkey signer,
|
|
114
|
+
- setup wizard (when no config exists) — private key, secret phrase, MPCVault or Turnkey signer, chains and endpoints
|
|
105
115
|
- status, pause/resume (persists across restarts), graceful stop, balances per chain
|
|
106
116
|
- live activity feed (orders detected/filled/skipped, bids, rebalances) streamed over SSE
|
|
117
|
+
- limit orders: post, inspect with the fills that drew them down, and cancel
|
|
107
118
|
- operations: manual vault sweep/redeem, runtime allowlist editing, log level switch, rebalancing trigger view, masked config view
|
|
108
|
-
- inflight FX price curve updates without a restart, persisted back to the config file
|
|
109
|
-
- overfill-protection self-halts surfaced with an operator reset
|
|
110
119
|
|
|
111
120
|
Flags:
|
|
112
121
|
|
|
@@ -124,18 +133,26 @@ every line simplex writes to stdout one JSON object, with no ANSI escapes, which
|
|
|
124
133
|
file needs. (One caveat: `@polkadot/api` prints a plain-text line to stdout if the Hyperbridge runtime
|
|
125
134
|
upgrades while the solver is running, so parse defensively.)
|
|
126
135
|
|
|
127
|
-
The
|
|
136
|
+
The limit-order API:
|
|
128
137
|
|
|
129
138
|
```bash
|
|
130
|
-
curl http://127.0.0.1:8686/api/
|
|
131
|
-
curl
|
|
139
|
+
curl http://127.0.0.1:8686/api/orderbook/books # books, dust floors, tokens per chain
|
|
140
|
+
curl http://127.0.0.1:8686/api/limit-orders?status=open # also ?chain= and ?book=
|
|
141
|
+
curl -X POST http://127.0.0.1:8686/api/limit-orders \
|
|
132
142
|
-H "Content-Type: application/json" -H "X-Simplex-UI: 1" \
|
|
133
|
-
-d '{"
|
|
143
|
+
-d '{"fillChain": "EVM-8453", "tokenIn": "USDC", "amountIn": "10000",
|
|
144
|
+
"tokenOut": "CNGN", "amountOut": "13900000", "acceptedSources": ["EVM-1", "EVM-8453"]}'
|
|
145
|
+
curl http://127.0.0.1:8686/api/limit-orders/<id> # { order, fills, bids }
|
|
146
|
+
curl -X DELETE http://127.0.0.1:8686/api/limit-orders/<id> -H "X-Simplex-UI: 1"
|
|
134
147
|
```
|
|
135
148
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
149
|
+
Amounts are whole tokens as decimal strings. `acceptedSources` must name at least one source chain,
|
|
150
|
+
and `ttlSecs` is optional (default `[orderbook] defaultTtlSecs`, or 365 days). Orders live in
|
|
151
|
+
`bids.db`, not the config file: a fill draws an order down and reposts the rest, and it lapses when
|
|
152
|
+
its TTL runs out. See the
|
|
153
|
+
[limit orders guide](https://docs.hyperbridge.network/developers/evm/simplex/limit-orders/).
|
|
154
|
+
|
|
155
|
+
The server is unauthenticated — mutating requests need the `X-Simplex-UI: 1` header (CSRF
|
|
139
156
|
hygiene), and both the wizard and the operator UI bind loopback unless told otherwise. Only bind
|
|
140
157
|
another interface (e.g. `--ui 0.0.0.0:8686`, which the docker image does inside its own network
|
|
141
158
|
namespace) on a trusted network.
|