@gibs/bridge-sdk 1.13.1 → 1.18.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.
Files changed (228) hide show
  1. package/README.md +295 -18
  2. package/abis/package.json +6 -0
  3. package/bridge-limits/package.json +6 -0
  4. package/chain-info/package.json +6 -0
  5. package/chain-names/package.json +6 -0
  6. package/chains/package.json +6 -0
  7. package/claims/package.json +6 -0
  8. package/config/package.json +6 -0
  9. package/consolidated-quote/package.json +6 -0
  10. package/destination-calldata/package.json +6 -0
  11. package/dist/chain-info.d.ts +1 -1
  12. package/dist/chain-info.js +11 -12
  13. package/dist/chains.d.ts +25 -0
  14. package/dist/chains.js +55 -20
  15. package/dist/cjs/abis.d.ts +1 -0
  16. package/dist/cjs/abis.js +19 -0
  17. package/dist/cjs/bridge-limits.d.ts +103 -0
  18. package/dist/cjs/bridge-limits.js +89 -0
  19. package/dist/cjs/chain-info.d.ts +169 -0
  20. package/dist/cjs/chain-info.js +452 -0
  21. package/dist/cjs/chain-names.d.ts +160 -0
  22. package/dist/cjs/chain-names.js +207 -0
  23. package/dist/cjs/chains.d.ts +90 -0
  24. package/dist/cjs/chains.js +357 -0
  25. package/dist/cjs/claims.d.ts +198 -0
  26. package/dist/cjs/claims.js +182 -0
  27. package/dist/cjs/config.d.ts +255 -0
  28. package/dist/cjs/config.js +569 -0
  29. package/dist/cjs/consolidated-quote.d.ts +648 -0
  30. package/dist/cjs/consolidated-quote.js +1048 -0
  31. package/dist/cjs/destination-calldata.d.ts +118 -0
  32. package/dist/cjs/destination-calldata.js +156 -0
  33. package/dist/cjs/ecosystems.d.ts +217 -0
  34. package/dist/cjs/ecosystems.js +298 -0
  35. package/dist/cjs/execution.d.ts +359 -0
  36. package/dist/cjs/execution.js +495 -0
  37. package/dist/cjs/fee-type.d.ts +10 -0
  38. package/dist/cjs/fee-type.js +10 -0
  39. package/dist/cjs/hyperliquid-execution.d.ts +152 -0
  40. package/dist/cjs/hyperliquid-execution.js +175 -0
  41. package/dist/cjs/image-links.d.ts +117 -0
  42. package/dist/cjs/image-links.js +153 -0
  43. package/dist/cjs/index.d.ts +24 -0
  44. package/dist/cjs/index.js +40 -0
  45. package/dist/cjs/lifi-execution-guard.d.ts +210 -0
  46. package/dist/cjs/lifi-execution-guard.js +409 -0
  47. package/dist/cjs/near-intents-conformance.d.ts +85 -0
  48. package/dist/cjs/near-intents-conformance.js +337 -0
  49. package/dist/cjs/near-intents-route.d.ts +47 -0
  50. package/dist/cjs/near-intents-route.js +303 -0
  51. package/dist/cjs/near-intents.d.ts +524 -0
  52. package/dist/cjs/near-intents.js +1071 -0
  53. package/dist/cjs/origin-deposit.d.ts +326 -0
  54. package/dist/cjs/origin-deposit.js +82 -0
  55. package/dist/cjs/package.json +3 -0
  56. package/dist/cjs/pre-quote.d.ts +198 -0
  57. package/dist/cjs/pre-quote.js +180 -0
  58. package/dist/cjs/prices.d.ts +117 -0
  59. package/dist/cjs/prices.js +224 -0
  60. package/dist/cjs/providers.d.ts +238 -0
  61. package/dist/cjs/providers.js +171 -0
  62. package/dist/cjs/quote-fees.d.ts +102 -0
  63. package/dist/cjs/quote-fees.js +201 -0
  64. package/dist/cjs/referral.d.ts +85 -0
  65. package/dist/cjs/referral.js +85 -0
  66. package/dist/cjs/relay-currencies.d.ts +47 -0
  67. package/dist/cjs/relay-currencies.js +95 -0
  68. package/dist/cjs/relay-depository.d.ts +2 -0
  69. package/dist/cjs/relay-depository.js +85 -0
  70. package/dist/cjs/relay-quote.d.ts +301 -0
  71. package/dist/cjs/relay-quote.js +996 -0
  72. package/dist/cjs/route-steps.d.ts +138 -0
  73. package/dist/cjs/route-steps.js +310 -0
  74. package/dist/cjs/routing/amounts.d.ts +80 -0
  75. package/dist/cjs/routing/amounts.js +126 -0
  76. package/dist/cjs/routing/candidate-route.d.ts +43 -0
  77. package/dist/cjs/routing/candidate-route.js +50 -0
  78. package/dist/cjs/routing/candidate.d.ts +237 -0
  79. package/dist/cjs/routing/candidate.js +100 -0
  80. package/dist/cjs/routing/carrier-provider-key.d.ts +31 -0
  81. package/dist/cjs/routing/carrier-provider-key.js +42 -0
  82. package/dist/cjs/routing/carriers/ask-answer.d.ts +77 -0
  83. package/dist/cjs/routing/carriers/ask-answer.js +2 -0
  84. package/dist/cjs/routing/carriers/omnibridge.d.ts +137 -0
  85. package/dist/cjs/routing/carriers/omnibridge.js +459 -0
  86. package/dist/cjs/routing/carriers/pulsex-paths.d.ts +80 -0
  87. package/dist/cjs/routing/carriers/pulsex-paths.js +97 -0
  88. package/dist/cjs/routing/carriers/pulsex-split.d.ts +175 -0
  89. package/dist/cjs/routing/carriers/pulsex-split.js +193 -0
  90. package/dist/cjs/routing/carriers/pulsex.d.ts +184 -0
  91. package/dist/cjs/routing/carriers/pulsex.js +615 -0
  92. package/dist/cjs/routing/carriers/wrap.d.ts +25 -0
  93. package/dist/cjs/routing/carriers/wrap.js +119 -0
  94. package/dist/cjs/routing/composed-route-quality.d.ts +125 -0
  95. package/dist/cjs/routing/composed-route-quality.js +144 -0
  96. package/dist/cjs/routing/entry-chain-anchor.d.ts +88 -0
  97. package/dist/cjs/routing/entry-chain-anchor.js +59 -0
  98. package/dist/cjs/routing/format.d.ts +31 -0
  99. package/dist/cjs/routing/format.js +64 -0
  100. package/dist/cjs/routing/index.d.ts +42 -0
  101. package/dist/cjs/routing/index.js +142 -0
  102. package/dist/cjs/routing/producers.d.ts +770 -0
  103. package/dist/cjs/routing/producers.js +1617 -0
  104. package/dist/cjs/routing/providers.d.ts +31 -0
  105. package/dist/cjs/routing/providers.js +48 -0
  106. package/dist/cjs/routing/route-data.d.ts +397 -0
  107. package/dist/cjs/routing/route-data.js +2 -0
  108. package/dist/cjs/routing/search/compose.d.ts +168 -0
  109. package/dist/cjs/routing/search/compose.js +104 -0
  110. package/dist/cjs/routing/search/graph.d.ts +668 -0
  111. package/dist/cjs/routing/search/graph.js +461 -0
  112. package/dist/cjs/routing/search/plan-route-data.d.ts +285 -0
  113. package/dist/cjs/routing/search/plan-route-data.js +871 -0
  114. package/dist/cjs/routing/search/score.d.ts +356 -0
  115. package/dist/cjs/routing/search/score.js +445 -0
  116. package/dist/cjs/routing/swap-transactions.d.ts +95 -0
  117. package/dist/cjs/routing/swap-transactions.js +133 -0
  118. package/dist/cjs/routing/usd-value.d.ts +17 -0
  119. package/dist/cjs/routing/usd-value.js +29 -0
  120. package/dist/cjs/settings.d.ts +785 -0
  121. package/dist/cjs/settings.js +1074 -0
  122. package/dist/cjs/swap-venues.d.ts +43 -0
  123. package/dist/cjs/swap-venues.js +29 -0
  124. package/dist/cjs/ton-connect.d.ts +98 -0
  125. package/dist/cjs/ton-connect.js +206 -0
  126. package/dist/cjs/ton-execution.d.ts +7 -0
  127. package/dist/cjs/ton-execution.js +23 -0
  128. package/dist/cjs/ton.d.ts +37 -0
  129. package/dist/cjs/ton.js +83 -0
  130. package/dist/cjs/tron-execution.d.ts +146 -0
  131. package/dist/cjs/tron-execution.js +248 -0
  132. package/dist/cjs/types.d.ts +51 -0
  133. package/dist/cjs/types.js +2 -0
  134. package/dist/claims.d.ts +198 -0
  135. package/dist/claims.js +140 -0
  136. package/dist/config.d.ts +42 -3
  137. package/dist/config.js +87 -21
  138. package/dist/consolidated-quote.d.ts +109 -15
  139. package/dist/consolidated-quote.js +310 -52
  140. package/dist/execution.d.ts +359 -0
  141. package/dist/execution.js +455 -0
  142. package/dist/hyperliquid-execution.js +2 -3
  143. package/dist/index.d.ts +4 -0
  144. package/dist/index.js +4 -0
  145. package/dist/lifi-execution-guard.d.ts +13 -2
  146. package/dist/lifi-execution-guard.js +4 -0
  147. package/dist/near-intents.js +2 -3
  148. package/dist/pre-quote.d.ts +6 -6
  149. package/dist/pre-quote.js +10 -14
  150. package/dist/prices.d.ts +10 -0
  151. package/dist/prices.js +52 -1
  152. package/dist/providers.d.ts +17 -0
  153. package/dist/providers.js +6 -0
  154. package/dist/referral.d.ts +12 -4
  155. package/dist/referral.js +12 -4
  156. package/dist/relay-depository.d.ts +2 -0
  157. package/dist/relay-depository.js +82 -0
  158. package/dist/relay-quote.js +2 -3
  159. package/dist/routing/candidate.d.ts +3 -3
  160. package/dist/routing/candidate.js +3 -3
  161. package/dist/routing/carrier-provider-key.d.ts +31 -0
  162. package/dist/routing/carrier-provider-key.js +37 -0
  163. package/dist/routing/carriers/ask-answer.d.ts +17 -0
  164. package/dist/routing/carriers/omnibridge.js +23 -21
  165. package/dist/routing/carriers/pulsex-paths.d.ts +80 -0
  166. package/dist/routing/carriers/pulsex-paths.js +92 -0
  167. package/dist/routing/carriers/pulsex-split.d.ts +175 -0
  168. package/dist/routing/carriers/pulsex-split.js +185 -0
  169. package/dist/routing/carriers/pulsex.d.ts +81 -46
  170. package/dist/routing/carriers/pulsex.js +267 -148
  171. package/dist/routing/composed-route-quality.d.ts +28 -6
  172. package/dist/routing/composed-route-quality.js +36 -5
  173. package/dist/routing/entry-chain-anchor.d.ts +1 -1
  174. package/dist/routing/entry-chain-anchor.js +1 -1
  175. package/dist/routing/index.d.ts +11 -3
  176. package/dist/routing/index.js +8 -2
  177. package/dist/routing/producers.js +1 -1
  178. package/dist/routing/providers.d.ts +5 -0
  179. package/dist/routing/providers.js +5 -0
  180. package/dist/routing/route-data.d.ts +47 -5
  181. package/dist/routing/search/graph.d.ts +15 -0
  182. package/dist/routing/search/plan-route-data.d.ts +42 -1
  183. package/dist/routing/search/plan-route-data.js +68 -9
  184. package/dist/routing/search/score.d.ts +3 -0
  185. package/dist/routing/search/score.js +11 -3
  186. package/dist/routing/swap-transactions.d.ts +95 -0
  187. package/dist/routing/swap-transactions.js +127 -0
  188. package/dist/settings.d.ts +94 -1
  189. package/dist/settings.js +95 -3
  190. package/dist/swap-venues.d.ts +43 -0
  191. package/dist/swap-venues.js +24 -0
  192. package/dist/ton-connect.d.ts +98 -0
  193. package/dist/ton-connect.js +200 -0
  194. package/dist/ton-execution.d.ts +4 -114
  195. package/dist/ton-execution.js +4 -244
  196. package/dist/ton.d.ts +37 -0
  197. package/dist/ton.js +65 -0
  198. package/docs/examples/example-a-ether-to-pulse.ts +300 -0
  199. package/docs/examples/example-b-token-pulsechain-to-ethereum.ts +270 -0
  200. package/docs/examples/shared.ts +261 -0
  201. package/docs/examples/tsconfig.json +18 -0
  202. package/docs/integration-guide.md +617 -0
  203. package/ecosystems/package.json +6 -0
  204. package/execution/package.json +6 -0
  205. package/fee-type/package.json +6 -0
  206. package/hyperliquid-execution/package.json +6 -0
  207. package/image-links/package.json +6 -0
  208. package/lifi-execution-guard/package.json +6 -0
  209. package/llms.txt +75 -10
  210. package/near-intents/package.json +6 -0
  211. package/near-intents-route/package.json +6 -0
  212. package/origin-deposit/package.json +6 -0
  213. package/package.json +817 -10
  214. package/pre-quote/package.json +6 -0
  215. package/prices/package.json +6 -0
  216. package/providers/package.json +6 -0
  217. package/quote-fees/package.json +6 -0
  218. package/referral/package.json +6 -0
  219. package/relay-currencies/package.json +6 -0
  220. package/relay-quote/package.json +6 -0
  221. package/route-steps/package.json +6 -0
  222. package/routing/package.json +6 -0
  223. package/settings/package.json +6 -0
  224. package/ton/package.json +6 -0
  225. package/ton-connect/package.json +6 -0
  226. package/ton-execution/package.json +6 -0
  227. package/tron-execution/package.json +6 -0
  228. package/types/package.json +6 -0
@@ -0,0 +1,615 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.createPulseXCarrier = exports.priceImpactAgainstMarginal = exports.amountOutAlongPath = exports.pulseXSwapPathForHop = exports.pulseXWrappedNativePath = exports.pulseXRouterForEdge = exports.venueForEdge = exports.pulseXVenues = void 0;
37
+ const multicall_1 = require("@gibs/common/multicall");
38
+ const viem_1 = require("viem");
39
+ const abis = __importStar(require("../../abis.js"));
40
+ const chains_js_1 = require("../../chains.js");
41
+ const config_js_1 = require("../../config.js");
42
+ const ecosystems_js_1 = require("../../ecosystems.js");
43
+ const swap_venues_js_1 = require("../../swap-venues.js");
44
+ const providers_js_1 = require("../providers.js");
45
+ const producers_js_1 = require("../producers.js");
46
+ const graph_js_1 = require("../search/graph.js");
47
+ const pulsex_paths_js_1 = require("./pulsex-paths.js");
48
+ /**
49
+ * PulseX (the PulseChain-native decentralized exchange, used here for a
50
+ * conversion swap leg) as a plug-in `Carrier` for `@gibs/quotes`'s
51
+ * route-search engine. GIBS-SPECIFIC — see `docs/quote-service.md`'s
52
+ * "Carriers" section: "never built in ... PulseX." Registered from
53
+ * `packages/ui/src/lib/state/useRouteSearch.ts` / `route-search-quotes.ts`.
54
+ *
55
+ * See `omnibridge.ts`'s head doc for why this returns a plain object shaped
56
+ * like `Carrier` rather than importing that type.
57
+ */
58
+ /** The hub addresses every candidate path on PulseChain is built from — see {@link pulseXHubTokens}. */
59
+ const hubAddresses = pulsex_paths_js_1.pulseXHubTokens.map((hub) => hub.address);
60
+ /**
61
+ * The wrapped-native token a chain's swaps route through, or undefined when
62
+ * this package does not know one for the chain. Without it a path on that
63
+ * chain can only be direct.
64
+ *
65
+ * @param chainId - the numeric chain id
66
+ */
67
+ const wrappedNativeFor = (chainId) => {
68
+ const wrapped = config_js_1.nativeAssetOut[(0, config_js_1.toChain)(chainId)];
69
+ return wrapped === undefined ? undefined : (0, viem_1.getAddress)(wrapped);
70
+ };
71
+ /**
72
+ * The hub tokens a path on `chainId` may pass through. PulseChain has the
73
+ * full list; any other chain has only its wrapped-native token, because this
74
+ * package knows no other hubs.
75
+ */
76
+ const hubsFor = (chainId) => {
77
+ if (chainId === producers_js_1.pulsechainChainId)
78
+ return hubAddresses;
79
+ const wrapped = wrappedNativeFor(chainId);
80
+ return wrapped === undefined ? [] : [wrapped];
81
+ };
82
+ /**
83
+ * Every PulseX deployment on PulseChain, V1 first: the PulseChain entry of
84
+ * {@link defaultSwapVenues}. Frozen. It lists the DEFAULTS only — a carrier
85
+ * built with its own `venues` offers those instead.
86
+ */
87
+ exports.pulseXVenues = config_js_1.defaultSwapVenues[producers_js_1.pulsechainChainId] ?? [];
88
+ /**
89
+ * The {@link SwapVenue} a swap edge runs on: the one its figure was quoted
90
+ * against. Reads the edge's own {@link HopEdge.venue}; an edge with none runs
91
+ * on the FIRST venue of its chain (V1 for PulseX) — every swap edge built
92
+ * before venues existed was quoted and signed there, and the same-chain swap
93
+ * sender's own hand-built edge still is.
94
+ *
95
+ * NEVER FALLS BACK TO ANOTHER CHAIN OR ANOTHER ROUTER. An edge that names a
96
+ * router `venues` does not list gets null, so the caller can refuse it.
97
+ *
98
+ * @param venues - the venues the caller allows
99
+ * @param edge - the edge to sign; `from` names the chain, and defaults to PulseChain when absent
100
+ * @returns the venue, or null when the edge is not a swap edge or names a router that is not in `venues`
101
+ */
102
+ const venueForEdge = (venues, edge) => {
103
+ if (edge.carrier !== 'PulseX')
104
+ return null;
105
+ const chainId = edge.from?.chainId ?? producers_js_1.pulsechainChainId;
106
+ if (edge.venue === undefined)
107
+ return venues[chainId]?.[0] ?? null;
108
+ return (0, swap_venues_js_1.findSwapVenue)(venues, chainId, edge.venue);
109
+ };
110
+ exports.venueForEdge = venueForEdge;
111
+ /**
112
+ * The router a PulseX edge must be signed on, judged against the DEFAULT
113
+ * venues only. Prefer {@link venueForEdge} with the venues your host passes.
114
+ *
115
+ * @param edge - the edge to sign
116
+ * @returns the router, or null when the edge is not a swap edge or names a router that is not a default
117
+ */
118
+ const pulseXRouterForEdge = (edge) => (0, exports.venueForEdge)(config_js_1.defaultSwapVenues, edge)?.router ?? null;
119
+ exports.pulseXRouterForEdge = pulseXRouterForEdge;
120
+ /**
121
+ * A node's own address for a pool lookup: native (the zero address) is not a
122
+ * token the router or its factory ever holds a pool for — only the chain's
123
+ * wrapped-native token is — so a native node resolves to that wrapped token
124
+ * before it ever reaches {@link pulseXConversionSwapPath}. Every other node
125
+ * is unchanged. A chain with no known wrapped-native token leaves a native
126
+ * node as it is; it has no pool, so no path prices.
127
+ *
128
+ * MIRRORS `useRouteSearch.ts`'s `quotePathAddress` (the UI's async `ask`
129
+ * already resolves native this way through that function) — this is the
130
+ * SAME rule, restated here because `prepare`/`exact` never go through the
131
+ * UI's `readAmountOut` at all; see {@link pulseXCandidatePaths}'s own doc.
132
+ *
133
+ * @param node - the node to resolve
134
+ * @returns the node's own address, or its chain's wrapped-native address for a native node
135
+ */
136
+ const poolTokenAddress = (node) => (0, ecosystems_js_1.sameAddress)(node.address, viem_1.zeroAddress, 'evm') ? (wrappedNativeFor(node.chainId) ?? viem_1.zeroAddress) : node.address;
137
+ /**
138
+ * The fixed Wrapped-PLS path from `from` to `to` — `[from, WPLS, to]`, or
139
+ * `[from, to]` when one side is WPLS — or null when both ends resolve to the
140
+ * same pool token (PLS<->WPLS is the wrap carrier's job).
141
+ *
142
+ * NOT THE PATH A HOP IS SIGNED ALONG. The carrier's own `exact` picks the
143
+ * best of many paths ({@link candidatePulseXPaths}) and records the winner on
144
+ * the hop's outcome; the signer reads it back with {@link pulseXSwapPathForHop}.
145
+ * This fixed path serves only the carrier's asynchronous `ask` — the
146
+ * interface's `getAmountsOut` read, which the route search never calls for a
147
+ * PulseX hop, because the search only asks aggregators live.
148
+ *
149
+ * Native PLS resolves to WPLS first ({@link poolTokenAddress}), so a path
150
+ * never starts or ends on the zero address, which has no pool.
151
+ *
152
+ * @param from - the hop's origin node
153
+ * @param to - the hop's destination node
154
+ * @returns the fixed path, or null when there is nothing for PulseX to swap
155
+ */
156
+ const pulseXWrappedNativePath = (from, to) => {
157
+ const fromAddress = poolTokenAddress(from);
158
+ const toAddress = poolTokenAddress(to);
159
+ if ((0, ecosystems_js_1.sameAddress)(fromAddress, toAddress, 'evm'))
160
+ return null;
161
+ const wrappedNative = wrappedNativeFor(from.chainId);
162
+ return wrappedNative === undefined ? [fromAddress, toAddress] : (0, providers_js_1.pulseXConversionSwapPath)(fromAddress, toAddress, wrappedNative);
163
+ };
164
+ exports.pulseXWrappedNativePath = pulseXWrappedNativePath;
165
+ /**
166
+ * Every path a PulseX hop from `from` to `to` may be priced along, or none
167
+ * when both ends resolve to the same pool token. EVERY PULSEX PRICE AND
168
+ * POOL READ IN THIS FILE GOES THROUGH THIS ONE FUNCTION, so `prepare` reads
169
+ * exactly the pools `exact` will look up, and native PLS resolves to WPLS
170
+ * the same way in both ({@link poolTokenAddress} — a path that started on
171
+ * the zero address once left every native-PLS hop unpriced).
172
+ *
173
+ * @param from - the hop's origin node
174
+ * @param to - the hop's destination node
175
+ * @returns the candidate paths, direct first; empty when there is nothing to swap
176
+ */
177
+ const pulseXCandidatePaths = (from, to) => {
178
+ const fromAddress = poolTokenAddress(from);
179
+ const toAddress = poolTokenAddress(to);
180
+ if ((0, ecosystems_js_1.sameAddress)(fromAddress, toAddress, 'evm'))
181
+ return [];
182
+ const wrappedNative = wrappedNativeFor(from.chainId);
183
+ // No known wrapped-native token: the direct pool is the only path.
184
+ if (wrappedNative === undefined)
185
+ return [[fromAddress, toAddress]];
186
+ return (0, pulsex_paths_js_1.candidatePulseXPaths)({ from: fromAddress, to: toAddress, wrappedNative, hubs: hubsFor(from.chainId) });
187
+ };
188
+ /**
189
+ * Whether a swap venue in `venues` can carry funds directly from `from` to
190
+ * `to`: both must be Ethereum-Virtual-Machine tokens on the SAME chain, that
191
+ * chain must have at least one venue, and the two must resolve to different
192
+ * pool tokens, so there is at least one path to price.
193
+ *
194
+ * NO TOKEN ALLOWLIST IS CONSULTED, on purpose: whether a pool exists is the
195
+ * reserve read's question, answered in `prepare`, not this one's.
196
+ */
197
+ const pulseXCarries = (venues, from, to) => {
198
+ if (from.ecosystem !== 'evm' || to.ecosystem !== 'evm')
199
+ return false;
200
+ if (from.chainId !== to.chainId)
201
+ return false;
202
+ if ((venues[from.chainId] ?? []).length === 0)
203
+ return false;
204
+ return pulseXCandidatePaths(from, to).length > 0;
205
+ };
206
+ /**
207
+ * The swap path a planned PulseX hop must be signed along: the path its
208
+ * outcome records ({@link HopOutcome.swapPath}), which is the path the
209
+ * carrier's `exact` priced the figure on. NEVER REBUILT HERE — rebuilding a
210
+ * path at signing time is how a quote on one path becomes a signature on
211
+ * another.
212
+ *
213
+ * The recorded path is checked against the hop's own edge before it is
214
+ * returned: it must start at the edge's input pool token, end at its output
215
+ * pool token, hold only addresses, and name no token twice. A path that fails
216
+ * any check is refused (null) rather than signed.
217
+ *
218
+ * @param hop - the planned hop to sign
219
+ * @returns the path to sign, or null when the hop is not a PulseX hop, records no path, or records one that does not fit its edge
220
+ */
221
+ const pulseXSwapPathForHop = (hop) => {
222
+ if (hop.edge.carrier !== 'PulseX')
223
+ return null;
224
+ const swapPath = hop.outcome.swapPath;
225
+ if (swapPath === undefined || swapPath.length < 2)
226
+ return null;
227
+ if (!swapPath.every((address) => (0, viem_1.isAddress)(address, { strict: false })))
228
+ return null;
229
+ const path = swapPath.map((address) => (0, viem_1.getAddress)(address));
230
+ if (new Set(path).size !== path.length)
231
+ return null;
232
+ if (!(0, ecosystems_js_1.sameAddress)(path[0], poolTokenAddress(hop.edge.from), 'evm'))
233
+ return null;
234
+ if (!(0, ecosystems_js_1.sameAddress)(path[path.length - 1], poolTokenAddress(hop.edge.to), 'evm'))
235
+ return null;
236
+ return path;
237
+ };
238
+ exports.pulseXSwapPathForHop = pulseXSwapPathForHop;
239
+ /**
240
+ * PulseX's own constant-product swap fee in basis points (29 of 10000, a
241
+ * numerator of 9971) — the default for {@link amountOutAlongPath}; a
242
+ * venue carries its own `feeBasisPoints`. The SAME `getAmountOut` formula every
243
+ * Uniswap-V2-style router uses: `amountOut = floor(amountIn * feeNumerator *
244
+ * reserveOut / (reserveIn * feeDenominator + amountIn * feeNumerator))`.
245
+ *
246
+ * MEASURED, NOT ASSUMED — see `uniV2Factories`'s own doc in `config.ts` for
247
+ * the full account. Reading live reserves from both PulseX router
248
+ * deployments (V1 `0x98bf93…`, V2 `0x165C34…`) and back-solving this ratio
249
+ * against each router's own `getAmountsOut`, on a one-hop and a two-hop
250
+ * path, gave the IDENTICAL ratio — `9971/10000` — for both, to the base
251
+ * unit. One constant serves both, and `pulsex-carrier.fork.test.ts` pins
252
+ * this claim against live chain data rather than trusting the arithmetic
253
+ * alone.
254
+ */
255
+ const PULSEX_FEE_BASIS_POINTS = 29;
256
+ /** Basis points in a whole: the denominator of every venue's fee. */
257
+ const BASIS_POINTS_DENOMINATOR = 10000n;
258
+ /** The minimal read-only factory ABI `prepare` needs — just enough to resolve a pool's address from its two tokens. */
259
+ const univ2FactoryAbi = (0, viem_1.parseAbi)([
260
+ 'function getPair(address tokenA, address tokenB) external view returns (address pair)',
261
+ ]);
262
+ /**
263
+ * The Uniswap-V2-style constant-product `getAmountOut`, applied with
264
+ * the venue's fee. Reproduces the router's own on-chain formula
265
+ * exactly — see `pulsex-carrier.fork.test.ts` — so PRICE IMPACT IS ALREADY
266
+ * IN HERE: this is the same nonlinear function the router evaluates, not a
267
+ * flat-fee approximation with an impact correction bolted on afterward.
268
+ *
269
+ * @param amountIn - the input amount, in `reserveIn`'s token's base units
270
+ * @param reserveIn - the pool's reserve of the input token
271
+ * @param reserveOut - the pool's reserve of the output token
272
+ * @param feeBasisPoints - the venue's swap fee, in basis points
273
+ * @returns the output amount, in `reserveOut`'s token's base units; 0 when either reserve is 0
274
+ */
275
+ const constantProductAmountOut = (amountIn, reserveIn, reserveOut, feeBasisPoints) => {
276
+ if (reserveIn <= 0n || reserveOut <= 0n || amountIn <= 0n)
277
+ return 0n;
278
+ const amountInWithFee = amountIn * (BASIS_POINTS_DENOMINATOR - BigInt(feeBasisPoints));
279
+ const numerator = amountInWithFee * reserveOut;
280
+ const denominator = reserveIn * BASIS_POINTS_DENOMINATOR + amountInWithFee;
281
+ return numerator / denominator;
282
+ };
283
+ /**
284
+ * What `amountIn` delivers after crossing every pool of a path in order,
285
+ * chaining {@link constantProductAmountOut}.
286
+ *
287
+ * @param amountIn - the amount entering the first pool
288
+ * @param steps - the pools in order of travel
289
+ * @param feeBasisPoints - the venue's swap fee in basis points; PulseX's 29 when omitted
290
+ * @returns the amount leaving the last pool; 0 when any pool cannot pay out
291
+ */
292
+ const amountOutAlongPath = (amountIn, steps, feeBasisPoints = PULSEX_FEE_BASIS_POINTS) => steps.reduce((runningAmount, step) => constantProductAmountOut(runningAmount, step.reserveIn, step.reserveOut, feeBasisPoints), amountIn);
293
+ exports.amountOutAlongPath = amountOutAlongPath;
294
+ /**
295
+ * How far a trade's executed rate falls below the marginal (near-spot) rate,
296
+ * in percent. The marginal rate is a tiny reference trade through the same
297
+ * pools (`amountIn / PULSEX_MARGINAL_REFERENCE_DIVISOR`). The swap fee rides
298
+ * in both rates, so it cancels and the gap is price impact alone. A path
299
+ * through several pools composes by itself: the reference trade crosses the
300
+ * same pools in the same order.
301
+ *
302
+ * impact = (1 - (amountOut / amountIn) / (referenceAmountOut / referenceAmountIn)) * 100
303
+ *
304
+ * @param options.amountIn - the full trade's input
305
+ * @param options.amountOut - what the full trade delivers
306
+ * @param options.referenceAmountIn - the reference trade's input
307
+ * @param options.referenceAmountOut - what the reference trade delivers
308
+ * @returns the impact in percent, never below 0; null when a reference figure is zero (impact cannot be measured)
309
+ */
310
+ const priceImpactAgainstMarginal = (options) => {
311
+ const { amountIn, amountOut, referenceAmountIn, referenceAmountOut } = options;
312
+ if (amountIn <= 0n || referenceAmountIn <= 0n || referenceAmountOut <= 0n)
313
+ return null;
314
+ // The output the trade would deliver at the marginal rate with no impact.
315
+ const idealAmountOut = (referenceAmountOut * amountIn) / referenceAmountIn;
316
+ if (idealAmountOut <= 0n)
317
+ return null;
318
+ if (amountOut >= idealAmountOut)
319
+ return 0;
320
+ const MILLIONTHS = 1000000n;
321
+ return Number(((idealAmountOut - amountOut) * MILLIONTHS * 100n) / idealAmountOut) / Number(MILLIONTHS);
322
+ };
323
+ exports.priceImpactAgainstMarginal = priceImpactAgainstMarginal;
324
+ /** The stable key one pool is stored and looked up under — the two token addresses, lower-cased and sorted, so either query order finds the same entry. */
325
+ const poolKey = (tokenA, tokenB) => {
326
+ const [lower, higher] = [tokenA.toLowerCase(), tokenB.toLowerCase()].sort();
327
+ return `${lower}|${higher}`;
328
+ };
329
+ /** The key one venue's pool is stored under: the same two tokens on V1 and on V2 are two different pools with two different reserves. */
330
+ const venuePoolKey = (venue, tokenA, tokenB) => `${venue.chainId}|${venue.factory.toLowerCase()}|${poolKey(tokenA, tokenB)}`;
331
+ /** Every consecutive (tokenIn, tokenOut) hop a PulseX swap path implies. */
332
+ const hopsAlongPath = (path) => path.slice(0, -1).map((tokenIn, index) => [tokenIn, path[index + 1]]);
333
+ /**
334
+ * The pools a path crosses on one venue, each read in the direction of
335
+ * travel, or null when any of them was never read — `getPair` found no pool,
336
+ * or the read failed. A path with a missing pool cannot be priced, exactly as
337
+ * the router's own `getAmountsOut` would revert on it.
338
+ *
339
+ * @param options.venue - the deployment whose pools the path trades against
340
+ * @param options.path - the tokens, in order
341
+ * @param options.reservesByPoolKey - every pool `prepare` read, keyed by {@link venuePoolKey}
342
+ * @returns the steps in order, or null when a pool is missing
343
+ */
344
+ const stepsAlongPath = (options) => {
345
+ const { venue, path, reservesByPoolKey } = options;
346
+ const steps = [];
347
+ for (const [tokenIn, tokenOut] of hopsAlongPath(path)) {
348
+ const reserves = reservesByPoolKey.get(venuePoolKey(venue, tokenIn, tokenOut));
349
+ if (reserves === undefined)
350
+ return null;
351
+ const tokenInIsLower = tokenIn.toLowerCase() < tokenOut.toLowerCase();
352
+ steps.push({
353
+ reserveIn: tokenInIsLower ? reserves.reserveOfLowerAddress : reserves.reserveOfHigherAddress,
354
+ reserveOut: tokenInIsLower ? reserves.reserveOfHigherAddress : reserves.reserveOfLowerAddress,
355
+ });
356
+ }
357
+ return steps;
358
+ };
359
+ /**
360
+ * Batch-reads reserves for every pool `nodes`' candidate PulseX paths touch,
361
+ * on EVERY venue in `venues`, once, so {@link createPulseXCarrier}'s `exact`
362
+ * can answer every hop SYNCHRONOUSLY afterward.
363
+ *
364
+ * EACH VENUE IS READ THROUGH ITS OWN FACTORY. The same two tokens usually
365
+ * have a pool on V1 and another on V2, with different reserves; the two are
366
+ * stored apart ({@link venuePoolKey}) and never blended. `PULSEX_FEE_NUMERATOR`
367
+ * is proven identical for both deployments (see its own doc), so the formula
368
+ * is shared and only the reserves differ.
369
+ *
370
+ * TWO MULTICALLS ON PULSECHAIN, WHATEVER THE VENUE COUNT: `getPair` must
371
+ * resolve each pool's address before `getReserves` can be read from it, so
372
+ * the second read cannot join the first — but every venue's `getPair` rides
373
+ * the first multicall and every pool's `getReserves` rides the second.
374
+ *
375
+ * THE HUB SEARCH WIDENS EACH READ, NOT THEIR NUMBER. Every pool any candidate
376
+ * path crosses is read here ({@link pulseXCandidatePaths}), so `exact` can
377
+ * price every path with no further call. Measured 2026-10-06: an 8-token
378
+ * PulseChain universe asked 84 entries across the two reads (the fixed
379
+ * Wrapped-PLS path asked about 16). The shared multicall helper splits a read
380
+ * past its request-size budget into sequential posts; `getPair` crosses that
381
+ * line at about 11 pool tokens (198 entries over two venues).
382
+ *
383
+ * @param nodes - every node the search might branch through
384
+ * @param venues - the venues this carrier offers
385
+ * @param clientForChain - see {@link CreatePulseXCarrierOptions}'s own field
386
+ * @returns every pool this universe touches, keyed by {@link venuePoolKey} — pools with no `getPair` result are simply absent, not an error
387
+ */
388
+ const preparePulseXReserves = async ({ nodes, venues, clientForChain, }) => {
389
+ const reservesByPoolKey = new Map();
390
+ const chainIds = Object.keys(venues)
391
+ .map(Number)
392
+ .filter((chainId) => (venues[chainId] ?? []).length > 0);
393
+ for (const chainId of chainIds) {
394
+ const chainReserves = await preparePulseXReservesOnChain({ nodes, chainId, venues, clientForChain });
395
+ for (const [key, reserves] of chainReserves)
396
+ reservesByPoolKey.set(key, reserves);
397
+ }
398
+ return reservesByPoolKey;
399
+ };
400
+ /**
401
+ * One chain's share of {@link preparePulseXReserves}: two multicalls, the
402
+ * `getPair` reads and then the `getReserves` reads, over every venue of the
403
+ * chain. A chain with no client, or with no chain description to multicall
404
+ * against, reads nothing.
405
+ */
406
+ const preparePulseXReservesOnChain = async ({ nodes, chainId, venues, clientForChain, }) => {
407
+ const reservesByPoolKey = new Map();
408
+ const client = clientForChain(chainId);
409
+ const knownChain = chains_js_1.chainsMetadata[(0, config_js_1.toChain)(chainId)];
410
+ const chain = knownChain ?? client?.chain;
411
+ if (client === null || chain === undefined)
412
+ return reservesByPoolKey;
413
+ const chainNodes = nodes.filter((node) => node.ecosystem === 'evm' && node.chainId === chainId);
414
+ const poolTokenPairs = new Map();
415
+ for (const from of chainNodes) {
416
+ for (const to of chainNodes) {
417
+ if ((0, graph_js_1.assetNodeKey)(from) === (0, graph_js_1.assetNodeKey)(to))
418
+ continue;
419
+ if (!pulseXCarries(venues, from, to))
420
+ continue;
421
+ for (const path of pulseXCandidatePaths(from, to)) {
422
+ for (const [tokenIn, tokenOut] of hopsAlongPath(path)) {
423
+ poolTokenPairs.set(poolKey(tokenIn, tokenOut), [tokenIn, tokenOut]);
424
+ }
425
+ }
426
+ }
427
+ }
428
+ if (poolTokenPairs.size === 0)
429
+ return reservesByPoolKey;
430
+ const poolQueries = (venues[chainId] ?? []).flatMap((venue) => Array.from(poolTokenPairs.values()).map(([tokenIn, tokenOut]) => ({
431
+ key: venuePoolKey(venue, tokenIn, tokenOut),
432
+ factory: venue.factory,
433
+ tokenIn,
434
+ tokenOut,
435
+ })));
436
+ const factoryResults = await (0, multicall_1.multicallRead)({
437
+ chain,
438
+ client,
439
+ abi: univ2FactoryAbi,
440
+ calls: poolQueries.map((query) => ({
441
+ functionName: 'getPair',
442
+ target: query.factory,
443
+ args: [query.tokenIn, query.tokenOut],
444
+ allowFailure: true,
445
+ })),
446
+ });
447
+ const pairAddressByPoolKey = new Map();
448
+ poolQueries.forEach((query, index) => {
449
+ const pairAddress = factoryResults[index];
450
+ // A decoded address is exactly 42 characters; a failed `allowFailure`
451
+ // call's undecoded revert bytes are almost never that length — see
452
+ // `omnibridge.ts`'s identical guard for why `typeof` alone cannot tell
453
+ // success from failure for an address-returning call.
454
+ if (typeof pairAddress === 'string' && pairAddress.length === 42 && pairAddress !== viem_1.zeroAddress) {
455
+ pairAddressByPoolKey.set(query.key, (0, viem_1.getAddress)(pairAddress));
456
+ }
457
+ });
458
+ if (pairAddressByPoolKey.size === 0)
459
+ return reservesByPoolKey;
460
+ const reservePoolKeys = Array.from(pairAddressByPoolKey.keys());
461
+ const reserveResults = await (0, multicall_1.multicallRead)({
462
+ chain,
463
+ client,
464
+ abi: abis.pair,
465
+ calls: reservePoolKeys.map((key) => ({
466
+ functionName: 'getReserves',
467
+ target: pairAddressByPoolKey.get(key),
468
+ allowFailure: true,
469
+ })),
470
+ });
471
+ reservePoolKeys.forEach((key, index) => {
472
+ const result = reserveResults[index];
473
+ if (!Array.isArray(result))
474
+ return;
475
+ const [reserve0, reserve1] = result;
476
+ if (typeof reserve0 !== 'bigint' || typeof reserve1 !== 'bigint')
477
+ return;
478
+ // Standard Uniswap-V2-style factories sort a pair's tokens before
479
+ // creating it, so `token0` is always the LEXICOGRAPHICALLY LOWER
480
+ // address — confirmed against live PulseX pools 2026-09-24 (both V1 and
481
+ // V2), never re-derived with an extra `token0()` read.
482
+ reservesByPoolKey.set(key, { reserveOfLowerAddress: reserve0, reserveOfHigherAddress: reserve1 });
483
+ });
484
+ return reservesByPoolKey;
485
+ };
486
+ /**
487
+ * The venues a carrier offers: every venue in `venues`, or only the routers
488
+ * the host names. A named router that is in no venue is a configuration
489
+ * error, thrown at construction rather than offered silently.
490
+ *
491
+ * @param venues - the resolved venues
492
+ * @param routers - the routers the host can sign on, or undefined for all
493
+ * @returns the venues, in their original order
494
+ */
495
+ const selectPulseXVenues = (venues, routers) => {
496
+ if (routers === undefined)
497
+ return venues;
498
+ const named = (venue) => routers.some((router) => (0, ecosystems_js_1.sameAddress)(venue.router, router, 'evm'));
499
+ for (const router of routers) {
500
+ const offered = Object.values(venues).some((list) => list.some((venue) => (0, ecosystems_js_1.sameAddress)(venue.router, router, 'evm')));
501
+ if (!offered)
502
+ throw new Error(`createPulseXCarrier: ${router} is not a known PulseX router in the offered swap venues`);
503
+ }
504
+ return Object.freeze(Object.fromEntries(Object.entries(venues).map(([chainId, list]) => [chainId, list.filter(named)])));
505
+ };
506
+ /**
507
+ * Builds the PulseX conversion swap as a plug-in carrier.
508
+ *
509
+ * @param options - see {@link CreatePulseXCarrierOptions}
510
+ * @returns the carrier — `id: 'PulseX'`
511
+ */
512
+ const createPulseXCarrier = (options) => {
513
+ const { readAmountOut, clientForChain } = options;
514
+ const venues = selectPulseXVenues((0, swap_venues_js_1.resolveSwapVenues)(options.venues), options.routers);
515
+ // ONE EDGE PER VENUE. Each names its router as its `venue`, so the search
516
+ // quotes and ranks V1 and V2 as two separate hops and the better one wins
517
+ // on its own figure — and the winner is signed on the router it names.
518
+ const edgesFrom = (from, to) => {
519
+ if ((0, graph_js_1.assetNodeKey)(from) === (0, graph_js_1.assetNodeKey)(to))
520
+ return [];
521
+ if (!pulseXCarries(venues, from, to))
522
+ return [];
523
+ return (venues[from.chainId] ?? []).map((venue) => ({
524
+ carrier: 'PulseX',
525
+ from,
526
+ to,
527
+ fusesNext: false,
528
+ origin: 'wallet',
529
+ floors: [],
530
+ venue: venue.router,
531
+ }));
532
+ };
533
+ const ask = async ({ edge, inputAmount }) => {
534
+ const amountOut = await readAmountOut(edge, inputAmount);
535
+ if (amountOut === null || amountOut <= 0n) {
536
+ return { ok: false, refusal: { kind: 'no-quote', reason: 'no liquidity on this PulseX path', minimumAmount: null } };
537
+ }
538
+ return {
539
+ ok: true,
540
+ deliveredAmount: amountOut,
541
+ // getAmountsOut is exact for the CURRENT block; no slippage tolerance is
542
+ // modelled here, so the guaranteed figure is left equal to the expected
543
+ // one, matching the omnibridge carrier's own convention.
544
+ minimumDeliveredAmount: amountOut,
545
+ claimedDurationSeconds: 0,
546
+ };
547
+ };
548
+ // Populated by `prepare`, read by `exact` — see `omnibridge.ts`'s identical
549
+ // field for why a mutable closure here is safe (client-side,
550
+ // one-search-at-a-time; PulseX is likewise "never built into" the shared
551
+ // display-quote service).
552
+ let reservesByPoolKey = new Map();
553
+ const prepare = async (nodes) => {
554
+ if (clientForChain === undefined)
555
+ return;
556
+ reservesByPoolKey = await preparePulseXReserves({ nodes, venues, clientForChain });
557
+ };
558
+ const exact = (edge, amountIn) => {
559
+ if (!pulseXCarries(venues, edge.from, edge.to))
560
+ return null;
561
+ // Quoted on the edge's OWN venue — the router it will be signed on — and
562
+ // only on a venue this carrier offers.
563
+ const venue = (0, exports.venueForEdge)(venues, edge);
564
+ if (venue === null)
565
+ return null;
566
+ // EVERY CANDIDATE PATH IS PRICED, AND THE BEST ONE WINS. A path with a
567
+ // pool `prepare` never found is left out — the same as a router call
568
+ // that would revert — and a path that pays out nothing is never picked.
569
+ const quotes = pulseXCandidatePaths(edge.from, edge.to).flatMap((path) => {
570
+ const steps = stepsAlongPath({ venue, path, reservesByPoolKey });
571
+ return steps === null ? [] : [{ path, steps, deliveredAmount: (0, exports.amountOutAlongPath)(amountIn, steps, venue.feeBasisPoints) }];
572
+ });
573
+ // No path had every pool read — a structural non-answer, not a refusal
574
+ // (`exact`'s own doc: `null` means "nothing to say"). NOTE THIS DOES NOT
575
+ // FALL BACK TO AN ESTIMATE: a carrier with `exact` defined never yields
576
+ // an `'estimate'` outcome (see `enumerate.ts`'s `resolveHopOutcome`,
577
+ // branch 1) — `null` here PRUNES the hop entirely, the same as a refusal.
578
+ if (quotes.length === 0)
579
+ return null;
580
+ const best = (0, pulsex_paths_js_1.bestPulseXPathQuote)(quotes);
581
+ if (best === null) {
582
+ return { outcome: 'refused', refusal: { kind: 'no-quote', reason: 'no liquidity on this PulseX path', minimumAmount: null } };
583
+ }
584
+ // Price impact is measured on the CHOSEN path's own pools, with the same
585
+ // reference trade as before.
586
+ const referenceAmountIn = amountIn / producers_js_1.PULSEX_MARGINAL_REFERENCE_DIVISOR;
587
+ const priceImpactPercent = (0, exports.priceImpactAgainstMarginal)({
588
+ amountIn,
589
+ amountOut: best.deliveredAmount,
590
+ referenceAmountIn,
591
+ referenceAmountOut: (0, exports.amountOutAlongPath)(referenceAmountIn, best.steps, venue.feeBasisPoints),
592
+ });
593
+ // The path rides on the answer, so the signer signs exactly what was
594
+ // priced (`pulseXSwapPathForHop`). Impact is left off (not zero) when the
595
+ // reference trade rounds away: an unknown impact must stay unknown so the
596
+ // quality gate withholds the plan.
597
+ const delivered = { outcome: 'delivered', deliveredAmount: best.deliveredAmount, swapPath: best.path };
598
+ return priceImpactPercent === null ? delivered : { ...delivered, priceImpactPercent };
599
+ };
600
+ return {
601
+ id: 'PulseX',
602
+ edgesFrom,
603
+ ask,
604
+ prepare,
605
+ exact,
606
+ isRateLimited: false,
607
+ // A same-chain swap requires the reader's own wallet signature — never
608
+ // a by-hand deposit.
609
+ depositMode: 'wallet-signed',
610
+ sender: 'swap',
611
+ // A same-chain swap settles with the transaction itself.
612
+ settlementSeconds: 0,
613
+ };
614
+ };
615
+ exports.createPulseXCarrier = createPulseXCarrier;
@@ -0,0 +1,25 @@
1
+ import { type AssetNode, type HopEdge } from '../search/graph.js';
2
+ import type { CarrierAskAnswer, CarrierExactResult } from './ask-answer.js';
3
+ /**
4
+ * Builds the native wrap/unwrap carrier as a plug-in.
5
+ *
6
+ * NO OPTIONS, NO `prepare`. There is no local read to batch — a wrap has no
7
+ * minimum, no maximum, no fee rate and no reserve to be wrong about; it is a
8
+ * pure 1:1 identity over every chain `config.ts` names a wrapped-native
9
+ * token for. `exact` alone is total over every edge this carrier offers.
10
+ *
11
+ * @returns the carrier — `id: 'wrap'`
12
+ */
13
+ export declare const createWrapCarrier: () => {
14
+ id: string;
15
+ edgesFrom: (from: AssetNode, to: AssetNode) => readonly HopEdge[];
16
+ ask: ({ edge, inputAmount }: {
17
+ edge: HopEdge;
18
+ inputAmount: bigint;
19
+ }) => Promise<CarrierAskAnswer>;
20
+ exact: (edge: HopEdge, amountIn: bigint) => CarrierExactResult | null;
21
+ isRateLimited: boolean;
22
+ depositMode: "wallet-signed";
23
+ sender: "swap";
24
+ settlementSeconds: number;
25
+ };