@gibs/bridge-sdk 1.13.1 → 1.17.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 (217) hide show
  1. package/README.md +244 -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 +240 -0
  28. package/dist/cjs/config.js +537 -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 +346 -0
  36. package/dist/cjs/execution.js +468 -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 +23 -0
  44. package/dist/cjs/index.js +39 -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 +107 -0
  59. package/dist/cjs/prices.js +172 -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/carriers/ask-answer.d.ts +77 -0
  81. package/dist/cjs/routing/carriers/ask-answer.js +2 -0
  82. package/dist/cjs/routing/carriers/omnibridge.d.ts +137 -0
  83. package/dist/cjs/routing/carriers/omnibridge.js +459 -0
  84. package/dist/cjs/routing/carriers/pulsex-paths.d.ts +80 -0
  85. package/dist/cjs/routing/carriers/pulsex-paths.js +97 -0
  86. package/dist/cjs/routing/carriers/pulsex-split.d.ts +175 -0
  87. package/dist/cjs/routing/carriers/pulsex-split.js +193 -0
  88. package/dist/cjs/routing/carriers/pulsex.d.ts +159 -0
  89. package/dist/cjs/routing/carriers/pulsex.js +565 -0
  90. package/dist/cjs/routing/carriers/wrap.d.ts +25 -0
  91. package/dist/cjs/routing/carriers/wrap.js +119 -0
  92. package/dist/cjs/routing/composed-route-quality.d.ts +125 -0
  93. package/dist/cjs/routing/composed-route-quality.js +144 -0
  94. package/dist/cjs/routing/entry-chain-anchor.d.ts +88 -0
  95. package/dist/cjs/routing/entry-chain-anchor.js +59 -0
  96. package/dist/cjs/routing/format.d.ts +31 -0
  97. package/dist/cjs/routing/format.js +64 -0
  98. package/dist/cjs/routing/index.d.ts +38 -0
  99. package/dist/cjs/routing/index.js +134 -0
  100. package/dist/cjs/routing/producers.d.ts +770 -0
  101. package/dist/cjs/routing/producers.js +1617 -0
  102. package/dist/cjs/routing/providers.d.ts +31 -0
  103. package/dist/cjs/routing/providers.js +48 -0
  104. package/dist/cjs/routing/route-data.d.ts +355 -0
  105. package/dist/cjs/routing/route-data.js +2 -0
  106. package/dist/cjs/routing/search/compose.d.ts +168 -0
  107. package/dist/cjs/routing/search/compose.js +104 -0
  108. package/dist/cjs/routing/search/graph.d.ts +668 -0
  109. package/dist/cjs/routing/search/graph.js +461 -0
  110. package/dist/cjs/routing/search/plan-route-data.d.ts +269 -0
  111. package/dist/cjs/routing/search/plan-route-data.js +848 -0
  112. package/dist/cjs/routing/search/score.d.ts +356 -0
  113. package/dist/cjs/routing/search/score.js +445 -0
  114. package/dist/cjs/routing/swap-transactions.d.ts +91 -0
  115. package/dist/cjs/routing/swap-transactions.js +131 -0
  116. package/dist/cjs/routing/usd-value.d.ts +17 -0
  117. package/dist/cjs/routing/usd-value.js +29 -0
  118. package/dist/cjs/settings.d.ts +785 -0
  119. package/dist/cjs/settings.js +1074 -0
  120. package/dist/cjs/ton-connect.d.ts +98 -0
  121. package/dist/cjs/ton-connect.js +206 -0
  122. package/dist/cjs/ton-execution.d.ts +7 -0
  123. package/dist/cjs/ton-execution.js +23 -0
  124. package/dist/cjs/ton.d.ts +37 -0
  125. package/dist/cjs/ton.js +83 -0
  126. package/dist/cjs/tron-execution.d.ts +146 -0
  127. package/dist/cjs/tron-execution.js +248 -0
  128. package/dist/cjs/types.d.ts +51 -0
  129. package/dist/cjs/types.js +2 -0
  130. package/dist/claims.d.ts +198 -0
  131. package/dist/claims.js +140 -0
  132. package/dist/config.d.ts +24 -0
  133. package/dist/config.js +39 -5
  134. package/dist/consolidated-quote.d.ts +109 -15
  135. package/dist/consolidated-quote.js +310 -52
  136. package/dist/execution.d.ts +346 -0
  137. package/dist/execution.js +428 -0
  138. package/dist/hyperliquid-execution.js +2 -3
  139. package/dist/index.d.ts +3 -0
  140. package/dist/index.js +3 -0
  141. package/dist/lifi-execution-guard.d.ts +13 -2
  142. package/dist/lifi-execution-guard.js +4 -0
  143. package/dist/near-intents.js +2 -3
  144. package/dist/pre-quote.d.ts +6 -6
  145. package/dist/pre-quote.js +10 -14
  146. package/dist/providers.d.ts +17 -0
  147. package/dist/providers.js +6 -0
  148. package/dist/referral.d.ts +12 -4
  149. package/dist/referral.js +12 -4
  150. package/dist/relay-depository.d.ts +2 -0
  151. package/dist/relay-depository.js +82 -0
  152. package/dist/relay-quote.js +2 -3
  153. package/dist/routing/candidate.d.ts +3 -3
  154. package/dist/routing/candidate.js +3 -3
  155. package/dist/routing/carriers/ask-answer.d.ts +17 -0
  156. package/dist/routing/carriers/omnibridge.js +23 -21
  157. package/dist/routing/carriers/pulsex-paths.d.ts +80 -0
  158. package/dist/routing/carriers/pulsex-paths.js +92 -0
  159. package/dist/routing/carriers/pulsex-split.d.ts +175 -0
  160. package/dist/routing/carriers/pulsex-split.js +185 -0
  161. package/dist/routing/carriers/pulsex.d.ts +31 -21
  162. package/dist/routing/carriers/pulsex.js +141 -71
  163. package/dist/routing/composed-route-quality.d.ts +28 -6
  164. package/dist/routing/composed-route-quality.js +36 -5
  165. package/dist/routing/entry-chain-anchor.d.ts +1 -1
  166. package/dist/routing/entry-chain-anchor.js +1 -1
  167. package/dist/routing/index.d.ts +6 -2
  168. package/dist/routing/index.js +6 -2
  169. package/dist/routing/producers.js +1 -1
  170. package/dist/routing/providers.d.ts +5 -0
  171. package/dist/routing/providers.js +5 -0
  172. package/dist/routing/search/graph.d.ts +15 -0
  173. package/dist/routing/search/plan-route-data.d.ts +25 -0
  174. package/dist/routing/search/plan-route-data.js +43 -7
  175. package/dist/routing/search/score.d.ts +3 -0
  176. package/dist/routing/search/score.js +11 -3
  177. package/dist/routing/swap-transactions.d.ts +91 -0
  178. package/dist/routing/swap-transactions.js +125 -0
  179. package/dist/settings.d.ts +94 -1
  180. package/dist/settings.js +95 -3
  181. package/dist/ton-connect.d.ts +98 -0
  182. package/dist/ton-connect.js +200 -0
  183. package/dist/ton-execution.d.ts +4 -114
  184. package/dist/ton-execution.js +4 -244
  185. package/dist/ton.d.ts +37 -0
  186. package/dist/ton.js +65 -0
  187. package/docs/examples/example-a-ether-to-pulse.ts +300 -0
  188. package/docs/examples/example-b-token-pulsechain-to-ethereum.ts +270 -0
  189. package/docs/examples/shared.ts +261 -0
  190. package/docs/examples/tsconfig.json +18 -0
  191. package/docs/integration-guide.md +617 -0
  192. package/ecosystems/package.json +6 -0
  193. package/execution/package.json +6 -0
  194. package/fee-type/package.json +6 -0
  195. package/hyperliquid-execution/package.json +6 -0
  196. package/image-links/package.json +6 -0
  197. package/lifi-execution-guard/package.json +6 -0
  198. package/llms.txt +75 -10
  199. package/near-intents/package.json +6 -0
  200. package/near-intents-route/package.json +6 -0
  201. package/origin-deposit/package.json +6 -0
  202. package/package.json +817 -10
  203. package/pre-quote/package.json +6 -0
  204. package/prices/package.json +6 -0
  205. package/providers/package.json +6 -0
  206. package/quote-fees/package.json +6 -0
  207. package/referral/package.json +6 -0
  208. package/relay-currencies/package.json +6 -0
  209. package/relay-quote/package.json +6 -0
  210. package/route-steps/package.json +6 -0
  211. package/routing/package.json +6 -0
  212. package/settings/package.json +6 -0
  213. package/ton/package.json +6 -0
  214. package/ton-connect/package.json +6 -0
  215. package/ton-execution/package.json +6 -0
  216. package/tron-execution/package.json +6 -0
  217. package/types/package.json +6 -0
@@ -0,0 +1,269 @@
1
+ import { type ProviderKey } from '../../providers.js';
2
+ import type { Provider } from '../../config.js';
3
+ import type { QuoteFee } from '../../quote-fees.js';
4
+ import type { Token } from '../../types.js';
5
+ import type { DeferredCrossing, RouteCandidate } from '../candidate.js';
6
+ import type { RouteData, RouteKind } from '../route-data.js';
7
+ import type { RouteScoreInputs } from './score.js';
8
+ import { type AssetNode, type RoutePlan } from './graph.js';
9
+ /**
10
+ * Resolves a graph node to the full display token a `RouteTokenRef` needs.
11
+ *
12
+ * `AssetNode` (`./graph.js`) is deliberately opaque about symbol, name and
13
+ * logo — see that module's own doc for why a coin and its wrapped form stay
14
+ * two distinct nodes there. Whoever built the plan already resolved every
15
+ * node against a live capability index and therefore already has this
16
+ * mapping; this module never invents one.
17
+ */
18
+ export type ResolveNodeToken = (node: AssetNode) => Token;
19
+ /**
20
+ * The plan's omnibridge provider, or null when the plan crosses no bridge
21
+ * hop at all — exactly the derivation `RouteCandidate.plan`'s own TSDoc
22
+ * (`../candidate.ts`) promises: "that same hop's `carrier`... the `to` node's
23
+ * `chainId` of the plan's LAST hop whose carrier is `'pulsechain'` or
24
+ * `'tokensex'`." Reading the LAST such hop, not the first, matters for a
25
+ * plan with two bridge crossings (an outbound leg out of PulseChain followed
26
+ * later by a separate inbound one) — not a shape any of today's four
27
+ * builders draws, but one the general search can.
28
+ *
29
+ * @param plan - the plan to derive from
30
+ * @returns the omnibridge provider, or null
31
+ */
32
+ export declare const deriveOmnibridgeProviderFromPlan: (plan: RoutePlan) => Provider | null;
33
+ /**
34
+ * The plan's entry chain id — the chain the plan's FIRST hop lands on, when
35
+ * that hop is carried by an aggregator (LI.FI, Relay or NEAR Intents); null
36
+ * when the plan's first hop IS the omnibridge itself (a direct, same-chain
37
+ * crossing — `buildDirectCrossingCandidate`'s shape) or is a PulseX swap.
38
+ *
39
+ * MATCHES `RouteCandidate.entryChainId`'S EXISTING MEANING throughout the
40
+ * candidate-based builders — "the chain the omnibridge leg starts on" — for
41
+ * every candidate that carries one, including a candidate whose aggregator
42
+ * reaches its OWN destination with no further bridge hop at all (today's
43
+ * `makeCandidate` test fixtures set `entryChainId` to the destination chain
44
+ * in exactly that case, because it is still where the aggregator's own leg
45
+ * lands).
46
+ *
47
+ * @param plan - the plan to derive from
48
+ * @returns the entry chain id, or null for a direct crossing or a swap-only plan
49
+ */
50
+ export declare const deriveEntryChainIdFromPlan: (plan: RoutePlan) => number | null;
51
+ /**
52
+ * The decimal chain ids every INTERMEDIATE hop of the plan passes through,
53
+ * origin and destination excluded — `RouteData.viaChainIds`'s own contract.
54
+ * Undefined (never an empty array) when the plan has nothing to report, per
55
+ * that field's own "ABSENT... on any route with no intermediate chain" doc.
56
+ *
57
+ * @param plan - the plan to derive from
58
+ * @returns the via chain ids in hop order, or undefined
59
+ */
60
+ export declare const deriveViaChainIdsFromPlan: (plan: RoutePlan) => number[] | undefined;
61
+ /**
62
+ * The plan's `RouteKind`, per the route-search design's section 1: `'direct'`
63
+ * when signature 1 IS the omnibridge crossing itself (no aggregator prefix —
64
+ * `buildDirectCrossingCandidate`'s shape, and `buildOutboundRouteData`'s
65
+ * shape), `'conversion'` when the LAST hop is a PulseX swap
66
+ * (`buildConversionRouteData`'s shape), `'aggregated'` otherwise (an
67
+ * aggregator carries signature 1, fused with a bridge hop or not —
68
+ * `buildNearIntentsTwoStepRouteData`'s shape, and the general
69
+ * aggregator-fused shape).
70
+ *
71
+ * DIVERGES FROM TODAY'S LITERAL OUTPUT FOR ONE CASE, DELIBERATELY: a
72
+ * same-chain candidate built by `buildDirectCrossingCandidate` and rendered
73
+ * through `buildCandidateRouteData` today always comes back `kind:
74
+ * 'aggregated'`, because that builder hard-codes `'aggregated'`
75
+ * unconditionally — an artifact of `RouteCandidate.entryChainId` being
76
+ * non-nullable, so `buildCandidateRouteData` always assumes an
77
+ * aggregator-entry shape even for a candidate with no aggregator leg at all.
78
+ * This function instead answers `'direct'` for that exact plan, matching how
79
+ * `buildDirectRouteData` (the OTHER, non-candidate 'direct' family) already
80
+ * represents the identical real-world same-chain crossing. See this
81
+ * module's test file for the specific case.
82
+ *
83
+ * @param plan - the plan to derive from
84
+ * @returns the route's kind
85
+ */
86
+ export declare const derivePlanKind: (plan: RoutePlan) => RouteKind;
87
+ /**
88
+ * The plan's headline provider — the omnibridge crossing it out when it
89
+ * crosses one, or whichever carrier performs signature 1 when it does not.
90
+ * Matches every existing builder's own headline choice: the omnibridge when
91
+ * present (`buildCandidateRouteData`, `buildNearIntentsTwoStepRouteData`,
92
+ * `buildOutboundRouteData`), the aggregator's own key as the fallback
93
+ * (`buildCandidateRouteData`'s no-omnibridge branch).
94
+ *
95
+ * @param plan - the plan to derive from
96
+ * @returns the headline provider key
97
+ */
98
+ export declare const deriveHeadlineProviderKeyFromPlan: (plan: RoutePlan) => ProviderKey;
99
+ /**
100
+ * The anchor a two-signature plan leaves the reader holding between its
101
+ * first and second groups — `RouteCandidate.plan`'s own TSDoc: "the anchor
102
+ * the reader is left holding between signatures... taken from the first hop
103
+ * of the second group." Reuses `describeDeferredCrossing`
104
+ * (`../../near-intents-route.js`) rather than re-validating the same
105
+ * "positive amount, resolved token" rule a second time.
106
+ *
107
+ * Null when the plan has only one signature group (there is no deferred
108
+ * crossing to describe) or the plan is malformed (a signature group naming
109
+ * hop indices the plan does not have).
110
+ *
111
+ * @param plan - the plan to derive from
112
+ * @param resolveToken - resolves a graph node to its full display token
113
+ * @param anchorUsdValue - the anchor's own carrier's valuation of the
114
+ * landing, exactly as `DeferredCrossing.anchorUsdValue` expects — supplied
115
+ * by the caller, since a plan carries no United States dollar figures.
116
+ * @returns the deferred crossing, or null
117
+ */
118
+ export declare const deriveDeferredCrossingFromPlan: (plan: RoutePlan, resolveToken: ResolveNodeToken, anchorUsdValue: string | null) => DeferredCrossing | null;
119
+ /**
120
+ * The caller-supplied dollar figures and breakdown for ONE signature group —
121
+ * everything about a section this module cannot derive from the plan's
122
+ * structure alone (see this module's head doc).
123
+ */
124
+ export type PlanSectionPricing = {
125
+ /**
126
+ * What this section leaves the user holding, in United States dollars, or
127
+ * null when unpriced — `RouteLandingData.usdValue` for this section.
128
+ */
129
+ landingUsdValue: number | null;
130
+ /** This section's own cost, in United States dollars, or null when unpriced. */
131
+ feeUsdValue: number | null;
132
+ /**
133
+ * Each hop's own share of `feeUsdValue`, one entry per hop of the group in
134
+ * order, or omitted when the caller cannot price every hop.
135
+ *
136
+ * WHY A FUSED SECTION NEEDS THIS. One signature can carry two legs: an
137
+ * aggregator lands on the bridge's entry chain and makes the entry call in
138
+ * the same transaction. With no per-hop figure, a display that splits the
139
+ * section into legs can only put the whole cost on the first leg, so the
140
+ * aggregator wore the bridge's fee and the bridge leg read as free. The
141
+ * caller passes shares that add up to `feeUsdValue`, or nothing.
142
+ */
143
+ hopFeeUsdValues?: readonly (number | null)[];
144
+ /** The itemized charges behind `feeUsdValue`, passed straight through to `RouteSectionData.fees`. */
145
+ fees?: readonly QuoteFee[];
146
+ /** Estimated duration for this signature in minutes, or null/undefined to omit. */
147
+ etaMinutes?: number | null;
148
+ /** Estimated duration for this signature in seconds, or null/undefined to omit. */
149
+ etaSeconds?: number | null;
150
+ /** Explanation shown for a deferred section; omitted lets the display adapter supply its default. */
151
+ deferredNote?: string;
152
+ /**
153
+ * Overrides this section's `landing.amount`. Omitted (the default) uses
154
+ * the plan's own composed estimate — the group's last hop's
155
+ * `outcome.deliveredAmount` — which is always present, per design section
156
+ * 3 ("only signature 1 must be binding... every later hop['s] outcome" is
157
+ * still an estimate, never absent). Pass `null` explicitly ONLY to
158
+ * reproduce a builder that states no figure at all for a leg it has not
159
+ * yet quoted by ANY means, composed or otherwise — `buildOutboundRouteData`'s
160
+ * deferred section is the one target shape that does this; see this
161
+ * module's test file for why that is a real, if now avoidable, gap rather
162
+ * than a rule to keep by default.
163
+ */
164
+ landingAmountOverride?: bigint | null;
165
+ };
166
+ /** Everything {@link buildRouteDataFromPlan} needs beyond the plan's own structure. */
167
+ export type PlanRouteDataInputs = {
168
+ /** The priced plan to render. */
169
+ plan: RoutePlan;
170
+ /** Resolves a graph node to its full display token. */
171
+ resolveToken: ResolveNodeToken;
172
+ /** Stable identity for the route's sections, mirroring `RouteCandidate.id`. */
173
+ routeId: string;
174
+ /** One entry per signature group, in `plan.signatures` order. */
175
+ sections: readonly PlanSectionPricing[];
176
+ /** The route's aggregate all-in cost in United States dollars, or null/undefined. */
177
+ totalCostUsdValue?: number | null;
178
+ /** The route's net United States dollar outcome — the figure routes are ranked on. */
179
+ netValueUsd?: number | null;
180
+ /** Estimated end-to-end duration in minutes, or null/undefined. */
181
+ etaMinutes?: number | null;
182
+ };
183
+ /**
184
+ * Turns a priced {@link RoutePlan} into a raw {@link RouteData} — one section
185
+ * per signature group, `deferred` on every group after the first, each
186
+ * section's hops and token flow drawn structurally from the plan, and the
187
+ * dollar figures overlaid from `inputs.sections`. See this module's head doc
188
+ * for why the dollar figures are caller-supplied rather than derived here.
189
+ *
190
+ * NEVER SHOWS AN UNPRICED HEADLINE FIGURE, AND MARKS EVERY OTHER ESTIMATE AS
191
+ * ONE — PHASE 3. A section (and the route's own `output`) whose last hop is
192
+ * grounded on `EstimateBasis` `'unpriced'` lands on `amount: null`, whatever
193
+ * the caller's own pricing says, per {@link sectionLandingAmount}'s own doc.
194
+ * Every OTHER estimate (`'probe-rate'`, `'priced-conversion'`) still shows
195
+ * its figure, with `estimateBasis` set to that basis so a reader is never
196
+ * shown a composed/probed number as if it were a confirmed quote — see
197
+ * `RouteOutputData.estimateBasis`'s own doc (`../route-data.ts`) for the
198
+ * full rule this reads off {@link hopEstimateBasis}.
199
+ *
200
+ * @param inputs - the plan, a token resolver, an id, and per-section pricing
201
+ * @returns the raw route data
202
+ */
203
+ export declare const buildRouteDataFromPlan: (inputs: PlanRouteDataInputs) => RouteData;
204
+ /** Everything {@link buildRouteCandidateFromPlan} needs beyond the plan's own structure. */
205
+ export type PlanCandidateInputs = {
206
+ /** The priced plan to build a candidate for. */
207
+ plan: RoutePlan;
208
+ /** Resolves a graph node to its full display token. */
209
+ resolveToken: ResolveNodeToken;
210
+ /** Stable identity for the candidate, mirroring today's `candidate.id`. */
211
+ id: string;
212
+ /** The base-unit amount entering the plan's first hop. */
213
+ inputAmount: bigint;
214
+ /** What the reader pays for the plan's first hop, exactly as its own carrier reported it. */
215
+ paidUsdValue: string | null;
216
+ /**
217
+ * What the plan's LAST hop's own carrier valued its delivered side at —
218
+ * read only when the plan crosses no bridge hop, mirroring
219
+ * `candidateDeliveredUsd`'s no-omnibridge branch.
220
+ */
221
+ lastHopDeliveredUsdValue: string | null;
222
+ /** Per-destination-token United States dollar price, or null. */
223
+ destinationUsdPrice: number | null;
224
+ /** The omnibridge crossing fee, in destination-token base units. */
225
+ omnibridgeFeeAmount?: bigint;
226
+ /** The anchor's own carrier's valuation of the deferred-crossing landing, when the plan defers one. */
227
+ anchorUsdValue?: string | null;
228
+ /** The reader's typed amount, when it differs from `inputAmount` (see `RouteCandidate.requestedAmount`). */
229
+ requestedAmount?: bigint | null;
230
+ /** Charges the plan's carriers report outside `fromAmount`. */
231
+ fees?: readonly QuoteFee[];
232
+ /** The plan's first hop's own carrier-claimed execution duration, in seconds. */
233
+ executionDurationSeconds?: number;
234
+ };
235
+ /**
236
+ * Turns a priced {@link RoutePlan} into a {@link RouteCandidate}, filling
237
+ * `plan` and deriving `deferredCrossing`, `entryChainId` and
238
+ * `omnibridgeProvider` from it exactly as `RouteCandidate.plan`'s own TSDoc
239
+ * (`../candidate.ts`) promises.
240
+ *
241
+ * @param inputs - the plan, a token resolver, an id, and the caller's pricing
242
+ * @returns the route candidate
243
+ */
244
+ export declare const buildRouteCandidateFromPlan: (inputs: PlanCandidateInputs) => RouteCandidate;
245
+ /**
246
+ * Everything {@link buildRouteScoreInputsFromPlan} needs beyond the plan's
247
+ * own structure and `gaslessIntermediateChainCount`, which the design's own
248
+ * `RouteScoreInputs` doc says is "an input from the interface" — a live
249
+ * wallet balance read this pure module cannot perform.
250
+ */
251
+ export type PlanValuation = PlanCandidateInputs & {
252
+ /** Each hop's own carrier-claimed execution duration, in seconds, in hop order. */
253
+ legClaimedDurationsSeconds: readonly (number | null | undefined)[];
254
+ };
255
+ /**
256
+ * Turns a priced {@link RoutePlan} into {@link RouteScoreInputs} — reusing
257
+ * `candidateDeliveredUsd`, `candidatePaidUsd` and `candidateOutsideFeesUsd`
258
+ * (`../producers.js`) against the SAME candidate
259
+ * {@link buildRouteCandidateFromPlan} builds, exactly as `RouteScoreInputs`'
260
+ * own doc in `score.ts` asks: "generalized to the plan's LAST hop and FIRST
261
+ * hop respectively... import and reuse them; do not write a second
262
+ * valuation."
263
+ *
264
+ * @param valuation - the plan, a token resolver, an id, and the caller's pricing
265
+ * @param gaslessIntermediateChainCount - intermediate chains the connected
266
+ * account holds no gas on — supplied by the caller, never computed here
267
+ * @returns the plan's score inputs
268
+ */
269
+ export declare const buildRouteScoreInputsFromPlan: (valuation: PlanValuation, gaslessIntermediateChainCount: number) => RouteScoreInputs;