@arkade-os/swap 0.1.0-rc.2 → 0.1.0-rc.4
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 +24 -0
- package/dist/advanced.cjs +7622 -0
- package/dist/advanced.d.cts +657 -0
- package/dist/advanced.d.ts +657 -0
- package/dist/advanced.js +431 -0
- package/dist/chunk-2QQYOW46.js +3827 -0
- package/dist/{chunk-EOYGUCDM.js → chunk-4L2CNVXB.js} +14 -8
- package/dist/{chunk-LYCMM3VB.js → chunk-6HIU2LNP.js} +8 -8
- package/dist/errors-C-jdh0_4.d.ts +2210 -0
- package/dist/errors-DwF4nDkm.d.cts +2210 -0
- package/dist/index.cjs +2811 -2831
- package/dist/index.d.cts +17 -2643
- package/dist/index.d.ts +17 -2643
- package/dist/index.js +68 -3689
- package/dist/lockupContract-BvfhGH62.d.cts +108 -0
- package/dist/lockupContract-BvfhGH62.d.ts +108 -0
- package/dist/node/index.d.cts +8 -2
- package/dist/node/index.d.ts +8 -2
- package/dist/nostr.d.cts +1 -1
- package/dist/nostr.d.ts +1 -1
- package/dist/nostr.js +1 -1
- package/dist/protocol.cjs +20 -18
- package/dist/protocol.d.cts +24 -118
- package/dist/protocol.d.ts +24 -118
- package/dist/protocol.js +2 -5
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/{repository-_zU9_pM3.d.cts → repository-C7wOrIpV.d.cts} +36 -10
- package/dist/{repository-kO95noyv.d.ts → repository-CToRX7Gj.d.ts} +36 -10
- package/dist/{rfq-DdBV4JO5.d.cts → rfq-RONK76D7.d.cts} +21 -10
- package/dist/{rfq-DdBV4JO5.d.ts → rfq-RONK76D7.d.ts} +21 -10
- package/dist/{watch-wMbmfN4p.d.ts → watch-C3hv5rOW.d.cts} +1 -1
- package/dist/{watch-CQqvwgwY.d.cts → watch-mIKau97G.d.ts} +1 -1
- package/package.json +13 -3
package/README.md
CHANGED
|
@@ -15,6 +15,12 @@ const client = createSwapClient({ wallet, repository: new IndexedDbAssetSwapRepo
|
|
|
15
15
|
Construction is synchronous and inert: no network, no wallet read, no repository open. The first
|
|
16
16
|
call that needs one does it.
|
|
17
17
|
|
|
18
|
+
Market discovery needs no configuration either: the client defaults to the reference solver
|
|
19
|
+
registry's index for the wallet's network (`REGISTRY_URL[network]`, exported). Follow your own
|
|
20
|
+
registry instead with `discovery: { registryUrl }`, or opt out of registries entirely with
|
|
21
|
+
`discovery: { registryUrl: null }` — `discovery: { snapshot }` resolves against a fixed market
|
|
22
|
+
list without touching the network.
|
|
23
|
+
|
|
18
24
|
## The four routes
|
|
19
25
|
|
|
20
26
|
Each is one `quote` → `accept` chain. `quote` returns binding, verified terms and touches nothing
|
|
@@ -51,6 +57,17 @@ ordering from the caller.
|
|
|
51
57
|
`onchain -> arkade` is not in the union. It resolves and quotes to `UnsupportedRoute` until the
|
|
52
58
|
client owns the trader's L1 refund path end to end.
|
|
53
59
|
|
|
60
|
+
An `arkade -> onchain` withdrawal claims the solver's L1 HTLC itself, and that claim's miner fee
|
|
61
|
+
comes out of the HTLC output — so the client grosses the take leg up by the claim's cost and the
|
|
62
|
+
recipient nets exactly the `amount` written, with the estimate folded into the reported `fee`. The
|
|
63
|
+
claim is built and broadcast by the client itself once the fill is claimable, signed by the
|
|
64
|
+
wallet's payout key and priced off a per-network fee-rate floor
|
|
65
|
+
(`discovery`/corridor overrides aside, that floor is the only environment-specific input). A
|
|
66
|
+
routing UI should raise it in congestion — the claim has a consensus deadline — via
|
|
67
|
+
`corridors: { onchain: { claimFeeRateSatVb } }`; set it to `null` to take the claim over manually
|
|
68
|
+
(the drive then reports the L1 half as your job rather than blocking it). Wire your own builder
|
|
69
|
+
with `corridors: { onchain: { claim } }` and it wins over the default.
|
|
70
|
+
|
|
54
71
|
### One call instead of two
|
|
55
72
|
|
|
56
73
|
`pay`, `receive` and `exchange` are `quote` → fee ceiling → `accept`, and add no capability the
|
|
@@ -177,11 +194,18 @@ from the wallet, which is the single place that knows which operator it speaks t
|
|
|
177
194
|
| Subpath | What it is |
|
|
178
195
|
| ---------------------------------- | ----------------------------------------------------------------- |
|
|
179
196
|
| `@arkade-os/swap` | the client, the verbs, the vocabulary, the error taxonomy |
|
|
197
|
+
| `@arkade-os/swap/advanced` | the orchestration below the verbs: the drive, corridors, RFQ wire |
|
|
180
198
|
| `@arkade-os/swap/node` | the Node storage default |
|
|
181
199
|
| `@arkade-os/swap/repositories/*` | the React Native backends |
|
|
182
200
|
| `@arkade-os/swap/nostr` | the Nostr RFQ transport, for hand-building one |
|
|
183
201
|
| `@arkade-os/swap/protocol` | the v1 building blocks, deprecated |
|
|
184
202
|
|
|
203
|
+
The root is a curated surface — if a name the client's modules define is not on it, it is on
|
|
204
|
+
`./advanced` (manual driving with `createSwapDrive`, destination claiming with `corridorSet`,
|
|
205
|
+
custom quote flows with `acceptQuote`/`quoteViaRfq`, record reading with `recordLeg`/`swapOf`).
|
|
206
|
+
"Advanced" is a deliberate deep subpath, not a second compatibility promise: those names move
|
|
207
|
+
with the client's internals across minor versions; the root is what stays put.
|
|
208
|
+
|
|
185
209
|
`./nostr` is a floor and not a deprecation: the client opens the card's rendezvous itself, and the
|
|
186
210
|
subpath is what keeps that an escape hatch rather than a wall. It is a separate entry point
|
|
187
211
|
because `nostr-tools` is an optional peer dependency, so a consumer who never hand-builds a
|