@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,785 @@
1
+ import { type Hex } from 'viem';
2
+ import type { TokenBridgeInfo } from './chain-info.js';
3
+ import { type Chains, type Pathway } from './config.js';
4
+ import { FeeType } from './fee-type.js';
5
+ import type { BridgeKey, Token } from './types.js';
6
+ export declare const oneEther: bigint;
7
+ export declare const basisPoints = 10000n;
8
+ /**
9
+ * Returns the bridge pathway (configuration) for a given bridge key, asset in, and whether to use the production pathway
10
+ * @param bridgeKey - the bridge key to use
11
+ * @param isProd - whether to use the production pathway
12
+ * @param assetIn - the asset in to bridge
13
+ * @returns the bridge pathway
14
+ */
15
+ export declare const bridgePathway: ({ bridgeKey, isProd, assetIn, }: {
16
+ bridgeKey: BridgeKey;
17
+ isProd: boolean;
18
+ assetIn: Token | null;
19
+ }) => Pathway | null;
20
+ /**
21
+ * Retrieves the amount to bridge from the amount and asset in. If either of them is nil, returns 0n
22
+ * @param amountIn - the amount to bridge
23
+ * @param assetIn - the asset in to bridge
24
+ * @returns the amount to bridge
25
+ */
26
+ export declare const amountToBridge: ({ amountIn, assetIn, }: {
27
+ amountIn: bigint | null;
28
+ assetIn: Token | null;
29
+ }) => bigint;
30
+ /**
31
+ * Calculates the bridge cost from the amount to bridge and bridge fee
32
+ * @param amountToBridge - the amount to bridge
33
+ * @param bridgeFee - the bridge fee
34
+ * @returns the bridge cost
35
+ */
36
+ export declare const bridgeCost: ({ amountToBridge, bridgeFee, }: {
37
+ amountToBridge: bigint;
38
+ bridgeFee: bigint | null;
39
+ }) => bigint | null;
40
+ /**
41
+ * Calculates the amount after bridge fee from the amount to bridge and bridge cost
42
+ * @param amountToBridge - the amount to bridge
43
+ * @param bridgeCost - the bridge cost
44
+ * @returns the amount after bridge fee
45
+ */
46
+ export declare const amountAfterBridgeFee: ({ amountToBridge, bridgeCost, }: {
47
+ amountToBridge: bigint;
48
+ bridgeCost: bigint | null;
49
+ }) => bigint | null;
50
+ /**
51
+ * Calculates the estimated amount out from the amount after bridge fee and fee
52
+ * @param amountAfterBridgeFee - the amount after bridge fee
53
+ * @param fee - the fee
54
+ * @returns the estimated amount out
55
+ */
56
+ export declare const estimatedAmountOut: ({ amountAfterBridgeFee, fee, }: {
57
+ amountAfterBridgeFee: bigint | null;
58
+ fee: bigint | null;
59
+ }) => bigint | null;
60
+ /**
61
+ * Calculates the estimated fee from the amount after bridge fee, fee, percent fee, fee type, limit, and whether to deliver the costs
62
+ * @param amountAfterBridgeFee - the amount after bridge fee
63
+ * @param fee - the fee
64
+ * @param percentFee - the percent fee
65
+ * @param feeType - the fee type
66
+ * @param limit - the limit
67
+ * @param costsToDeliver - whether to deliver the costs
68
+ * @returns the estimated fee
69
+ */
70
+ export declare const estimatedFee: ({ amountAfterBridgeFee, fee, percentFee, feeType, limit, costsToDeliver, }: {
71
+ amountAfterBridgeFee: bigint | null;
72
+ fee: bigint;
73
+ percentFee: bigint;
74
+ feeType: FeeType;
75
+ limit: bigint | null;
76
+ costsToDeliver: boolean;
77
+ }) => bigint | null;
78
+ /**
79
+ * Calculates the estimated native network cost from the estimated gas and latest base fee per gas
80
+ * @param estimatedGas - the estimated gas
81
+ * @param latestBaseFeePerGas - the latest base fee per gas
82
+ * @param requiresDelivery - whether to deliver the costs
83
+ * @returns the estimated native network cost
84
+ */
85
+ export declare const estimatedNativeNetworkCost: ({ estimatedGas, latestBaseFeePerGas, requiresDelivery, }: {
86
+ estimatedGas: bigint | null;
87
+ latestBaseFeePerGas: bigint | null;
88
+ requiresDelivery: boolean;
89
+ }) => bigint | null;
90
+ /**
91
+ * Calculates the estimated token network cost from the estimated native
92
+ * network cost, price corrective, decimals, and one token int
93
+ * @param estimatedNativeNetworkCost - the estimated native network cost
94
+ * @param priceCorrective - the price corrective
95
+ * @param decimals - the decimals
96
+ * @param oneTokenInt - the one token int
97
+ * @returns the estimated token network cost
98
+ */
99
+ export declare const estimatedTokenNetworkCost: ({ estimatedNativeNetworkCost, priceCorrective, decimals, oneTokenInt, }: {
100
+ estimatedNativeNetworkCost: bigint | null;
101
+ priceCorrective: bigint | null;
102
+ decimals: number | null;
103
+ oneTokenInt: bigint | null;
104
+ }) => bigint | null;
105
+ /**
106
+ * Calculates one token of the asset in as an int
107
+ * @param assetIn - the asset in to bridge
108
+ * @returns the one token int
109
+ */
110
+ export declare const oneTokenInt: ({ assetIn }: {
111
+ assetIn: Token | null;
112
+ }) => bigint;
113
+ /**
114
+ * Returns the limit as a bigint. Nil uses 0n
115
+ * @param lim - the limit
116
+ * @returns the limit
117
+ */
118
+ export declare const limit: (lim: bigint | null) => bigint;
119
+ /**
120
+ * Returns the network switch asset out address from the asset out, unwrap, and to chain
121
+ * @param assetOut - the asset out
122
+ * @param unwrap - whether to unwrap
123
+ * @param toChain - the chain to switch to
124
+ * @returns the network switch asset out address
125
+ */
126
+ export declare const networkSwitchAssetOutAddress: ({ assetOut, unwrap, toChain, }: {
127
+ assetOut: Token | null;
128
+ unwrap: boolean;
129
+ toChain: Chains;
130
+ }) => string | null;
131
+ /**
132
+ * Calculates the desired excess compensation basis points from the path, asset in, asset out, bridge key, fee type, list, and asset out address
133
+ * @param path - the path
134
+ * @param assetIn - the asset in to bridge
135
+ * @param assetOut - the asset out
136
+ * @param bridgeKey - the bridge key
137
+ * @param feeType - the fee type
138
+ * @param list - the list
139
+ * @param assetOutAddress - the asset out address
140
+ * @returns the desired excess compensation basis points
141
+ */
142
+ export declare const desiredExcessCompensationBasisPoints: ({ path, assetIn, assetOut, bridgeKey, feeType, list, assetOutAddress, }: {
143
+ path: Pathway | null;
144
+ assetIn: Token | null;
145
+ assetOut: Token | null;
146
+ bridgeKey: BridgeKey;
147
+ feeType: FeeType;
148
+ list: Set<string>;
149
+ assetOutAddress: string | null;
150
+ }) => 0n | 10000n | 1000n | 5000n;
151
+ /**
152
+ * What the Gibs delivery service takes from a transfer, stated so a reader can
153
+ * tell "no delivery" from "delivery not yet priced".
154
+ *
155
+ * WHY A UNION AND NOT A NULLABLE AMOUNT. The function this replaced returned null
156
+ * both when the reader switched delivery off and when the fee was not known yet. Those
157
+ * two mean opposite things for a route's cost: the first is a real zero, the
158
+ * second makes any total a guess. A cost built from the null could only pick one
159
+ * reading, and whichever it picked was wrong half the time.
160
+ *
161
+ * - `not-requested` — nothing is delivered for a fee, so the fee is zero.
162
+ * - `requested` — delivery is on. `amount` is null until it is known.
163
+ *
164
+ * The amount is in base units of the token the destination router receives:
165
+ * the delivery router takes its fee from the value that arrives on the
166
+ * destination chain, after the bridge's own fee.
167
+ */
168
+ export type DeliveryFee = {
169
+ status: 'not-requested';
170
+ } | {
171
+ status: 'requested';
172
+ /** The fee in base units of the delivered token, or null while unknown. */
173
+ amount: bigint | null;
174
+ /**
175
+ * The share of the arriving value the fee takes, as a fraction of one
176
+ * ether (5e14 is 0.05%). Null when the fee is not a share of the value
177
+ * (fixed and gas modes) or the share is not known yet.
178
+ */
179
+ rate: bigint | null;
180
+ };
181
+ /**
182
+ * Works out the Gibs delivery fee for a transfer, as a {@link DeliveryFee}.
183
+ *
184
+ * Each mode reads the SAME figure the delivered estimate subtracts
185
+ * ({@link estimatedFee}), so a route's cost and its delivered value reconcile:
186
+ *
187
+ * - percent: the arriving value times the rate. The router computes
188
+ * `value * multiplier / 1 ether`.
189
+ * - fixed: the fixed amount. The router takes `limit` as the fee.
190
+ * - gas: the limit. The router takes the gas cost, capped at the limit, so the
191
+ * limit is the most the reader pays and the figure the delivered estimate
192
+ * already assumes.
193
+ *
194
+ * `percentFee` must be null when the rate is not known. Passing a zero stand-in
195
+ * would state a free delivery.
196
+ *
197
+ * @param options.shouldDeliver - whether the reader asked for delivery
198
+ * @param options.routeOffersDelivery - whether this pathway delivers for a fee at all
199
+ * @param options.feeType - the delivery fee mode
200
+ * @param options.amountAfterBridgeFee - the value that reaches the destination router, or null
201
+ * @param options.percentFee - the percent rate as a fraction of one ether, or null when unknown
202
+ * @param options.fixedFee - the fixed fee in base units, or null when unknown
203
+ * @param options.limit - the gas mode cap in base units, or null when unknown
204
+ * @returns the delivery fee
205
+ */
206
+ export declare const deliveryFee: ({ shouldDeliver, routeOffersDelivery, feeType, amountAfterBridgeFee, percentFee, fixedFee, limit, }: {
207
+ shouldDeliver: boolean;
208
+ routeOffersDelivery: boolean;
209
+ feeType: FeeType;
210
+ amountAfterBridgeFee: bigint | null;
211
+ percentFee: bigint | null;
212
+ fixedFee: bigint | null;
213
+ limit: bigint | null;
214
+ }) => DeliveryFee;
215
+ /**
216
+ * The four-bit fee-type settings word a fee director carries.
217
+ *
218
+ * - bit 0: fixed fee mode.
219
+ * - bit 1: unwrap the delivered token to the native coin.
220
+ * - bit 2: exclude the priority fee from the delivery cost. Always set.
221
+ * - bit 3: percent fee mode.
222
+ *
223
+ * @param options.feeType - the delivery fee mode
224
+ * @param options.unwrap - whether the delivery unwraps to the native coin
225
+ * @returns the settings word for {@link feeDirectorStructEncoded}
226
+ */
227
+ export declare const feeTypeSettings: ({ feeType, unwrap }: {
228
+ feeType: FeeType;
229
+ unwrap: boolean;
230
+ }) => bigint;
231
+ /**
232
+ * An ERC-20 allowance a transaction needs before it can run: `spender` must
233
+ * be allowed to pull at least `minimum` of `token` from the sender on
234
+ * `chainId`.
235
+ */
236
+ export type ApprovalRequirement = {
237
+ chainId: number;
238
+ token: Hex;
239
+ spender: Hex;
240
+ minimum: bigint;
241
+ };
242
+ /**
243
+ * The ERC-20 `approve` call, as a target, a value and calldata. The
244
+ * interface's approval broadcast and the SDK's execution planner both build it
245
+ * here.
246
+ *
247
+ * @param options.token - the token to approve
248
+ * @param options.spender - the address allowed to pull it
249
+ * @param options.amount - the allowance to set
250
+ * @returns the call
251
+ */
252
+ export declare const approveCall: ({ token, spender, amount, }: {
253
+ token: Hex;
254
+ spender: Hex;
255
+ amount: bigint;
256
+ }) => {
257
+ to: Hex;
258
+ value: bigint;
259
+ data: Hex;
260
+ };
261
+ /**
262
+ * The `approve` amounts to send, in order, so the spender may pull exactly
263
+ * `minimum`. Empty when the allowance on chain already covers it.
264
+ *
265
+ * EXACT, NEVER UNLIMITED. An unlimited approval lets the spender pull the
266
+ * reader's whole balance for as long as the approval stands, so a later fault
267
+ * in that contract, or a spender a compromised quote named, costs everything
268
+ * rather than one transfer. The owner chose exact approvals everywhere
269
+ * (2026-10-07); the interface and the SDK's execution planner both decide
270
+ * here.
271
+ *
272
+ * A SHORT, NON-ZERO ALLOWANCE IS RESET TO ZERO FIRST. Some tokens (Tether on
273
+ * Ethereum is the known one) revert an `approve` that changes one non-zero
274
+ * allowance into another. Exact approvals leave such remainders more often,
275
+ * because an aggregator may spend less than it was allowed. A reset first
276
+ * works for every token, at the cost of one extra transaction in that case.
277
+ *
278
+ * @param options.allowance - the allowance on chain now
279
+ * @param options.minimum - the amount the next transaction pulls
280
+ * @returns the amounts to approve, in order: none, `[minimum]`, or `[0n, minimum]`
281
+ */
282
+ export declare const approvalAmounts: ({ allowance, minimum, }: {
283
+ allowance: bigint;
284
+ minimum: bigint;
285
+ }) => readonly bigint[];
286
+ /**
287
+ * The allowance a direct omnibridge crossing needs, or null when it needs none.
288
+ *
289
+ * Reads the SAME predicate {@link transactionInputs} uses to pick the call: a
290
+ * token the bridge minted ({@link interactingWithBridgeToken}) is burned by
291
+ * `transferAndCall` and needs no allowance, and the native coin is sent as
292
+ * value. Every other token is pulled by the pathway's `from` mediator through
293
+ * `relayTokens` or `relayTokensAndCall`.
294
+ *
295
+ * @param options.bridgePathway - the crossing's pathway
296
+ * @param options.assetIn - the token the crossing spends
297
+ * @param options.assetLink - the token's bridge link
298
+ * @param options.amountToBridge - the amount the crossing pulls
299
+ * @returns the approval the crossing needs, or null
300
+ */
301
+ export declare const omnibridgeApproval: ({ bridgePathway, assetIn, assetLink, amountToBridge, }: {
302
+ bridgePathway: Pathway;
303
+ assetIn: Token;
304
+ assetLink: TokenBridgeInfo;
305
+ amountToBridge: bigint;
306
+ }) => ApprovalRequirement | null;
307
+ /**
308
+ * Calculates the reasonable fixed fee from the estimated token network cost and desired excess compensation basis points
309
+ * @param estimatedTokenNetworkCost - the estimated token network cost
310
+ * @param desiredExcessCompensationBasisPoints - the desired excess compensation basis points
311
+ * @returns the reasonable fixed fee
312
+ */
313
+ export declare const reasonableFixedFee: ({ estimatedTokenNetworkCost, desiredExcessCompensationBasisPoints, }: {
314
+ estimatedTokenNetworkCost: bigint | null;
315
+ desiredExcessCompensationBasisPoints: bigint;
316
+ }) => bigint | null;
317
+ /**
318
+ * Calculates the reasonable percent on gas limit from the gas tip fee and estimated token network cost
319
+ * @param gasTipFee - the gas tip fee
320
+ * @param estimatedTokenNetworkCost - the estimated token network cost
321
+ * @returns the reasonable percent on gas limit
322
+ */
323
+ export declare const reasonablePercentOnGasLimit: ({ gasTipFee, estimatedTokenNetworkCost, }: {
324
+ gasTipFee: bigint | null;
325
+ estimatedTokenNetworkCost: bigint | null;
326
+ }) => bigint;
327
+ /**
328
+ * Calculates the reasonable percent fee from the reasonable fixed fee and amount after bridge fee
329
+ * @param reasonableFixedFee - the reasonable fixed fee
330
+ * @param amountAfterBridgeFee - the amount after bridge fee
331
+ * @returns the reasonable percent fee
332
+ */
333
+ export declare const reasonablePercentFee: ({ reasonableFixedFee, amountAfterBridgeFee, }: {
334
+ reasonableFixedFee: bigint | null;
335
+ amountAfterBridgeFee: bigint | null;
336
+ }) => bigint | null;
337
+ /**
338
+ * Returns whether the asset in address is interacting with a bridge token
339
+ * @param assetLink - the asset link
340
+ * @param assetInAddress - the asset in address
341
+ * @returns whether the asset in address is interacting with a bridge token
342
+ */
343
+ export declare const interactingWithBridgeToken: ({ assetLink, assetInAddress, }: {
344
+ assetLink: TokenBridgeInfo | null;
345
+ assetInAddress: string | null;
346
+ }) => boolean;
347
+ /**
348
+ * Calculates the fee director struct encoded from the recipient, bridge pathway, fee type, price corrective, gas tip fee, percent fee, fee type settings, limit, and asset out
349
+ * @param recipient - the recipient
350
+ * @param bridgePathway - the bridge pathway
351
+ * @param feeType - the fee type
352
+ * @param priceCorrective - the price corrective
353
+ * @param gasTipFee - the gas tip fee
354
+ * @param percentFee - the percent fee
355
+ * @param feeTypeSettings - the fee type settings
356
+ * @param limit - the limit
357
+ * @param assetOut - the asset out
358
+ * @returns the fee director struct encoded
359
+ */
360
+ export declare const feeDirectorStructEncoded: ({ recipient, bridgePathway, feeType, priceCorrective, gasTipFee, percentFee, feeTypeSettings, limit, assetOut, }: {
361
+ recipient: Hex | null;
362
+ feeType: FeeType;
363
+ priceCorrective: bigint | null;
364
+ gasTipFee: bigint | null;
365
+ percentFee: bigint | null;
366
+ feeTypeSettings: bigint;
367
+ limit: bigint;
368
+ bridgePathway: Pathway | null;
369
+ assetOut: Token | null;
370
+ }) => `0x${string}` | null;
371
+ /**
372
+ * Calculates the destination data param from the recipient, bridge pathway, asset in, destination router, fee director struct encoded, asset link, should deliver, and unwrap
373
+ * @param recipient - the recipient
374
+ * @param bridgePathway - the bridge pathway
375
+ * @param assetIn - the asset in to bridge
376
+ * @param destinationRouter - the destination router
377
+ * @param feeDirectorStructEncoded - the fee director struct encoded
378
+ * @param assetLink - the asset link
379
+ * @param shouldDeliver - whether to deliver the costs
380
+ * @param unwrap - whether to unwrap
381
+ * @returns the destination data param
382
+ */
383
+ export declare const destinationDataParam: ({ recipient, bridgePathway, assetIn, destinationRouter, feeDirectorStructEncoded, assetLink, shouldDeliver, unwrap, }: {
384
+ recipient: Hex | null;
385
+ bridgePathway: Pathway | null;
386
+ assetIn: Token | null;
387
+ destinationRouter: Hex | null;
388
+ feeDirectorStructEncoded: Hex | null;
389
+ assetLink: TokenBridgeInfo | null;
390
+ shouldDeliver: boolean;
391
+ unwrap: boolean;
392
+ }) => `0x${string}` | null;
393
+ /**
394
+ * Converts a desired excess compensation basis point value into a percentage as an integer, with the denominator assumed to be 1e18
395
+ * @param desiredExcessCompensationBasisPoints - the desired excess compensation basis points
396
+ * @returns the reasonable percent on top of gas fee
397
+ */
398
+ export declare const reasonablePercentOnTopOfGasFee: ({ desiredExcessCompensationBasisPoints, }: {
399
+ desiredExcessCompensationBasisPoints: bigint;
400
+ }) => bigint;
401
+ /**
402
+ * Calculates the desired compensation ratio from the desired excess compensation basis points
403
+ * @param desiredExcessCompensationBasisPoints - the desired excess compensation basis points
404
+ * @returns the desired compensation ratio
405
+ */
406
+ export declare const desiredCompensationRatio: ({ desiredExcessCompensationBasisPoints, }: {
407
+ desiredExcessCompensationBasisPoints: bigint;
408
+ }) => bigint;
409
+ /**
410
+ * Calculates the available compensation maximum from the amount after bridge fee, percent fee, fee type, fixed fee, and limit
411
+ * @param amountAfterBridgeFee - the amount after bridge fee
412
+ * @param percentFee - the percent fee
413
+ * @param feeType - the fee type
414
+ * @param fixedFee - the fixed fee
415
+ * @param limit - the limit
416
+ * @returns the available compensation maximum
417
+ */
418
+ export declare const availableCompensationMaximum: ({ amountAfterBridgeFee, percentFee, feeType, fixedFee, limit, }: {
419
+ amountAfterBridgeFee: bigint | null;
420
+ percentFee: bigint | null;
421
+ feeType: FeeType;
422
+ fixedFee: bigint | null;
423
+ limit: bigint;
424
+ }) => bigint | null;
425
+ /**
426
+ * Determines if the bridge is undercompensated based on network costs vs compensation limit using desired compensation rate
427
+ * @param estimatedTokenNetworkCost - the estimated token network cost
428
+ * @param feeType - the fee type
429
+ * @param limit - the maximum compensation limit
430
+ * @param amountAfterBridgeFee - the amount after bridge fee
431
+ * @param desiredExcessCompensationBasisPoints - the desired excess compensation basis points
432
+ * @returns whether the bridge is undercompensated
433
+ */
434
+ export declare const isUndercompensated: ({ estimatedTokenNetworkCost, feeType, limit, amountAfterBridgeFee, desiredExcessCompensationBasisPoints, }: {
435
+ estimatedTokenNetworkCost: bigint | null;
436
+ feeType: FeeType;
437
+ limit: bigint;
438
+ amountAfterBridgeFee: bigint | null;
439
+ desiredExcessCompensationBasisPoints: bigint;
440
+ }) => boolean;
441
+ /**
442
+ * The chain pair a surface is showing the reader, in decimal chain ids.
443
+ *
444
+ * This is what the reader BELIEVES they are doing — the pair in the address bar
445
+ * and on the destination pill — as distinct from the pair the bridge key
446
+ * resolves a pathway for. The two are separate values that nothing forced to
447
+ * agree, which is the whole reason this type exists.
448
+ */
449
+ export type SignedCrossing = {
450
+ /** The chain the reader's funds start on, as the surface states it. */
451
+ originChainId: number;
452
+ /** The chain the reader asked to receive on, as the surface states it. */
453
+ destinationChainId: number;
454
+ };
455
+ /**
456
+ * Why a bridge key must not be built into a transaction for the pair on screen,
457
+ * or null when the two agree.
458
+ *
459
+ * WHY THIS EXISTS, in the reader's words: "i just tried to swap from weth from
460
+ * ethereum on pls, to pls, and the calldata that i must have signed was to
461
+ * bridge back from pls to eth". A selection of PulseChain on BOTH sides is a
462
+ * swap; it has no pathway, so the bridge key kept whatever crossing it last
463
+ * held — or the address bar was repaired to a crossing — and the settings
464
+ * cascade went on building a real, signable transfer of the reader's bridged
465
+ * wrapped ether to Ethereum while the screen still named PulseChain.
466
+ *
467
+ * Three refusals, and each one is a separate way the two can part company:
468
+ *
469
+ * - A SAME-CHAIN SELECTION IS NEVER A CROSSING. Origin and destination on one
470
+ * chain describes a swap. No omnibridge pathway can serve it, so any pathway
471
+ * reached for here belongs to some other journey.
472
+ * - THE PATHWAY MUST LEAVE THE CHAIN THE READER'S FUNDS ARE ON. A key whose
473
+ * source chain differs spends a token the reader is not looking at.
474
+ * - THE PATHWAY MUST LAND WHERE THE READER ASKED. This is the reported defect:
475
+ * the destination silently became Ethereum.
476
+ *
477
+ * `signedCrossing` is `null` for a call no reader composed — the aggregator's
478
+ * executor call built by `buildDestinationCalldata`, where the chain pair IS
479
+ * the pathway and there is no screen to disagree with. Nullable rather than
480
+ * optional so every caller has to decide, and the decision is visible at the
481
+ * call site.
482
+ *
483
+ * @param bridgeKey - the key the pathway was resolved from
484
+ * @param signedCrossing - the pair on screen, or null when no surface composed it
485
+ * @returns the reason to refuse, or null when the two agree
486
+ */
487
+ export declare const crossingRefusal: ({ bridgeKey, signedCrossing, }: {
488
+ bridgeKey: BridgeKey | null;
489
+ signedCrossing: SignedCrossing | null;
490
+ }) => string | null;
491
+ /**
492
+ * Throws when the bridge key and the pair on screen describe different journeys.
493
+ *
494
+ * The LOUD half of {@link crossingRefusal}. {@link transactionInputs} runs
495
+ * during render, where a throw would blank the application, so it refuses
496
+ * quietly by returning null and the button it feeds stays inert. This is for
497
+ * the broadcast funnel, where a disagreement means something reconstructed the
498
+ * call another way and the reader is one signature from a transfer they never
499
+ * asked for — there, silence is the worse failure.
500
+ *
501
+ * @param bridgeKey - the key the pathway was resolved from
502
+ * @param signedCrossing - the pair on screen, or null when no surface composed it
503
+ * @throws when the two describe different journeys
504
+ */
505
+ export declare const assertCrossingAgrees: ({ bridgeKey, signedCrossing, }: {
506
+ bridgeKey: BridgeKey | null;
507
+ signedCrossing: SignedCrossing | null;
508
+ }) => void;
509
+ /**
510
+ * The one chain a surface is showing the reader for a SAME-CHAIN swap — the
511
+ * PulseX leg's own equivalent of {@link SignedCrossing}.
512
+ *
513
+ * KEPT AS ITS OWN TYPE RATHER THAN A `SignedCrossing` WITH BOTH FIELDS EQUAL.
514
+ * That shape still reads as a crossing that goes nowhere, and
515
+ * {@link crossingRefusal} already treats origin-equals-destination as exactly
516
+ * that: a crossing to refuse, because no omnibridge pathway serves it. A swap
517
+ * needs to say the OPPOSITE thing about the very same fact — "this signature
518
+ * never leaves the chain, on purpose, and that is not an error" — so it needs
519
+ * a name a caller cannot confuse with a crossing.
520
+ */
521
+ export type SignedSwap = {
522
+ /** The one chain both the swap's input and output live on. */
523
+ chainId: number;
524
+ };
525
+ /**
526
+ * What a surface believes ONE signature performs: a CROSSING between two
527
+ * chains, or a SWAP that stays on one.
528
+ *
529
+ * THE DISCRIMINANT IS EXPLICIT, never inferred from
530
+ * `originChainId === destinationChainId`. Inferring it would let a same-chain
531
+ * CROSSING selection — the exact case {@link crossingRefusal} already refuses,
532
+ * because no omnibridge pathway serves it — satisfy a caller building a swap
533
+ * transaction, which is a different signature entirely.
534
+ *
535
+ * EXTENDS THE CROSSING GUARD RATHER THAN REPLACING IT. {@link SignedCrossing},
536
+ * {@link crossingRefusal}, {@link assertCrossingAgrees} and
537
+ * {@link transactionInputs} are all UNCHANGED by this type's existence: every
538
+ * crossing still refuses exactly as it did before a swap leg existed at all.
539
+ *
540
+ * FOUR KINDS, ONE PER SENDER. A two-chain move is signed three different
541
+ * ways, and each way is its own kind so a signature built for one can never
542
+ * satisfy a sender built for another:
543
+ *
544
+ * - `'crossing'` — the omnibridge's own entry or exit call, signed by the
545
+ * reader's wallet against the bridge contracts.
546
+ * - `'aggregator'` — a provider's quote (Relay, LI.FI, NEAR Intents) that the
547
+ * reader's wallet signs; the provider carries the funds, and may perform
548
+ * the omnibridge entry call itself on arrival.
549
+ * - `'deposit-address'` — nothing is signed at all: the provider reserves an
550
+ * address and the reader pays it by hand from any wallet.
551
+ * - `'swap'` — a same-chain PulseX trade or native wrap.
552
+ *
553
+ * The three two-chain kinds share {@link SignedCrossing}'s fields, because
554
+ * each one still moves funds from one chain to another.
555
+ */
556
+ export type SignedLeg = ({
557
+ kind: 'crossing';
558
+ } & SignedCrossing) | ({
559
+ kind: 'aggregator';
560
+ } & SignedCrossing) | ({
561
+ kind: 'deposit-address';
562
+ } & SignedCrossing) | ({
563
+ kind: 'swap';
564
+ } & SignedSwap);
565
+ /**
566
+ * Why a same-chain PulseX swap transaction must not be built for the leg on
567
+ * screen, or null when they agree. The swap-side sibling of
568
+ * {@link crossingRefusal}.
569
+ *
570
+ * Two refusals, each a separate way the two can part company:
571
+ *
572
+ * - THE LEG ON SCREEN NAMES A CROSSING. A caller building a swap transaction
573
+ * while the reader is looking at a two-chain crossing would sign the wrong
574
+ * kind of thing for what is on screen.
575
+ * - THE SWAP DOES NOT EXECUTE ON THE CHAIN THE READER IS LOOKING AT. A stale
576
+ * candidate built for a chain the address bar has since left.
577
+ *
578
+ * @param signedLeg - what the surface believes this signature does, or null
579
+ * when no surface composed it
580
+ * @param chainId - the chain the candidate swap transaction actually executes on
581
+ * @returns the reason to refuse, or null when the two agree
582
+ */
583
+ export declare const swapRefusal: ({ signedLeg, chainId, }: {
584
+ signedLeg: SignedLeg | null;
585
+ chainId: number | null;
586
+ }) => string | null;
587
+ /**
588
+ * Throws when the leg on screen and the candidate swap transaction describe
589
+ * different journeys. The swap-side sibling of {@link assertCrossingAgrees} —
590
+ * loud where {@link swapRefusal} is quiet, for the same reason: this runs one
591
+ * step before the wallet, where silence is what lets a reader sign.
592
+ *
593
+ * @param signedLeg - what the surface believes this signature does, or null
594
+ * @param chainId - the chain the candidate swap transaction actually executes on
595
+ * @throws when the two describe different journeys
596
+ */
597
+ export declare const assertSwapAgrees: ({ signedLeg, chainId, }: {
598
+ signedLeg: SignedLeg | null;
599
+ chainId: number | null;
600
+ }) => void;
601
+ /**
602
+ * Which priced {@link import('./routing/candidate.js').RouteCandidate} a
603
+ * route was built to sign, which of the route's `sections` that candidate's
604
+ * quote answers for, and what KIND of leg that section is.
605
+ *
606
+ * WHY A BARE CANDIDATE IDENTIFIER IS NOT ENOUGH. A route's `candidateId` names
607
+ * the priced candidate an execute button broadcasts, but names nothing about
608
+ * WHICH of the route's sections that candidate's quote is for, or whether the
609
+ * section is a two-chain CROSSING or a same-chain SWAP. A composed route can
610
+ * carry more than one section — bridge an anchor token onto PulseChain, then a
611
+ * DEFERRED PulseX swap to the token the reader actually wants — and each
612
+ * section's calldata is built by a DIFFERENT sender component, chosen by the
613
+ * route's `kind`, entirely independently of the candidate id. Nothing today
614
+ * stops a future producer from stamping a candidate id onto a route while
615
+ * leaving its leg unstated, or a future sender from reaching for a candidate
616
+ * built for one leg to sign a different one — the same shape of mistake
617
+ * {@link SignedCrossing}/{@link SignedLeg} already exist to catch for what is
618
+ * on screen, one layer up from here.
619
+ *
620
+ * `leg` reuses {@link SignedLeg}'s own discriminant deliberately: a signature
621
+ * is either a crossing or a swap everywhere else in this codebase, and a
622
+ * candidate's pick has no reason to invent a second vocabulary for the same
623
+ * fact.
624
+ */
625
+ export type CandidatePick = {
626
+ /** The {@link import('./routing/candidate.js').RouteCandidate.id} this pick names. */
627
+ readonly candidateId: string;
628
+ /** The route's `sections` index this candidate's quote signs. */
629
+ readonly sectionIndex: number;
630
+ /** Whether the signed section is a two-chain crossing or a same-chain swap. */
631
+ readonly leg: SignedLeg['kind'];
632
+ };
633
+ /**
634
+ * Why a candidate must not be signed for the leg and section a caller is
635
+ * about to build calldata for, or null when they agree. The candidate-pick
636
+ * sibling of {@link crossingRefusal}/{@link swapRefusal}.
637
+ *
638
+ * UNLIKE THOSE TWO, A MISSING PICK IS ITSELF A REFUSAL. `crossingRefusal` and
639
+ * `swapRefusal` let a null leg through because some calls compose no screen at
640
+ * all (the aggregator's own executor call). A candidate-signing sender always
641
+ * has a screen — the route the reader picked — so a candidate id with no
642
+ * recorded leg is exactly the gap this type exists to close: `candidateId`
643
+ * alone used to be treated as sufficient identity, and this function is what
644
+ * stops it from being treated that way again.
645
+ *
646
+ * @param pick - what the route recorded it picked, or null/undefined when the
647
+ * producer that built the route never set one
648
+ * @param leg - the leg the caller is about to build calldata for
649
+ * @param sectionIndex - the route section the caller is about to build
650
+ * calldata for
651
+ * @returns the reason to refuse, or null when they agree
652
+ */
653
+ export declare const candidatePickRefusal: ({ pick, leg, sectionIndex, }: {
654
+ pick: CandidatePick | null;
655
+ leg: SignedLeg["kind"];
656
+ sectionIndex: number;
657
+ }) => string | null;
658
+ /**
659
+ * Throws when a candidate pick and the leg/section a caller is about to build
660
+ * calldata for describe different signatures. The candidate-pick sibling of
661
+ * {@link assertCrossingAgrees}/{@link assertSwapAgrees} — loud where {@link
662
+ * candidatePickRefusal} is quiet, for the same reason: this runs one step
663
+ * before the wallet, where silence is what lets a reader sign the wrong thing.
664
+ *
665
+ * @param pick - what the route recorded it picked, or null
666
+ * @param leg - the leg the caller is about to build calldata for
667
+ * @param sectionIndex - the route section the caller is about to build
668
+ * calldata for
669
+ * @throws when the pick and the leg/section being built describe different
670
+ * signatures
671
+ */
672
+ export declare const assertCandidatePickAgrees: ({ pick, leg, sectionIndex, }: {
673
+ pick: CandidatePick | null;
674
+ leg: SignedLeg["kind"];
675
+ sectionIndex: number;
676
+ }) => void;
677
+ /**
678
+ * Calculates the same-chain PulseX swap transaction inputs, or null when the
679
+ * inputs cannot form a call — including when the leg on screen and the swap's
680
+ * own chain disagree. The swap-side sibling of {@link transactionInputs}.
681
+ *
682
+ * SAME SHAPE AS `transactionInputs`, deliberately: `{ to, value, data } | null`,
683
+ * so a caller can dispatch either builder's result through one `sendTransaction`
684
+ * without a second shape to handle.
685
+ *
686
+ * WRAPPING AND UNWRAPPING THE NATIVE COIN USE THE ROUTER'S OWN NATIVE-COIN
687
+ * FUNCTIONS, not a separate deposit/withdraw step — one router contract wraps
688
+ * on the way in (`swapExactETHForTokens`) and unwraps on the way out
689
+ * (`swapExactTokensForETH`), the same contract `swapExactTokensForTokens`
690
+ * already targets when neither side is native.
691
+ *
692
+ * @param signedLeg - what the surface believes this signature does, or null
693
+ * @param chainId - the chain the swap actually executes on
694
+ * @param routerAddress - the PulseX router this swap is sent to, or null when
695
+ * none is deployed for this chain
696
+ * @param fromTokenAddress - the input token address, or the zero address for
697
+ * the chain's native coin
698
+ * @param toTokenAddress - the output token address, or the zero address for
699
+ * the chain's native coin
700
+ * @param swapPath - the ordered swap path — for a route-search hop, the one
701
+ * its quote was priced along (`pulseXSwapPathForHop`),
702
+ * already expressed in the router's own token addresses — the wrapped-native
703
+ * token stands in for either native end
704
+ * @param amountIn - the amount to swap, in the input token's base units
705
+ * @param minAmountOut - the minimum acceptable output after slippage, in the
706
+ * output token's base units
707
+ * @param recipient - the address the swap delivers to
708
+ * @param deadline - the unix-seconds deadline the router enforces
709
+ * @returns the transaction inputs, or null when the inputs cannot form a call
710
+ */
711
+ export declare const pulseXSwapTransactionInputs: ({ signedLeg, chainId, routerAddress, fromTokenAddress, toTokenAddress, swapPath, amountIn, minAmountOut, recipient, deadline, }: {
712
+ signedLeg: SignedLeg | null;
713
+ chainId: number | null;
714
+ routerAddress: Hex | null;
715
+ fromTokenAddress: Hex;
716
+ toTokenAddress: Hex;
717
+ swapPath: readonly Hex[];
718
+ amountIn: bigint;
719
+ minAmountOut: bigint;
720
+ recipient: Hex | null;
721
+ deadline: bigint;
722
+ }) => {
723
+ to: `0x${string}`;
724
+ value: bigint;
725
+ data: `0x${string}`;
726
+ } | null;
727
+ /**
728
+ * Calculates the transaction inputs from the bridge pathway, asset in, recipient, account, asset link, destination data param, amount to bridge, fee director struct encoded, and should deliver
729
+ * @param bridgeKey - the key the pathway was resolved from, for {@link crossingRefusal}
730
+ * @param signedCrossing - the chain pair on screen, or null when no surface composed it
731
+ * @param bridgePathway - the bridge pathway to use
732
+ * @param assetIn - the asset in to bridge
733
+ * @param recipient - the recipient of the bridge
734
+ * @param account - the account to bridge from
735
+ * @param assetLink - the asset link to use
736
+ * @param destinationDataParam - the destination data param to use
737
+ * @param amountToBridge - the amount to bridge
738
+ * @param feeDirectorStructEncoded - the fee director struct encoded to use
739
+ * @param shouldDeliver - whether to deliver the tokens to the recipient
740
+ * @returns the transaction inputs, or null when the inputs cannot form a call —
741
+ * including when the pathway crosses somewhere other than the pair on screen
742
+ */
743
+ export declare const transactionInputs: ({ bridgeKey, signedCrossing, bridgePathway, assetIn, recipient, account, assetLink, destinationDataParam, amountToBridge, feeDirectorStructEncoded, shouldDeliver, }: {
744
+ bridgeKey: BridgeKey | null;
745
+ signedCrossing: SignedCrossing | null;
746
+ bridgePathway: Pathway | null;
747
+ assetIn: Token | null;
748
+ recipient: Hex | null;
749
+ account: Hex | null;
750
+ assetLink: TokenBridgeInfo | null;
751
+ destinationDataParam: Hex | null;
752
+ amountToBridge: bigint;
753
+ feeDirectorStructEncoded: Hex | null;
754
+ shouldDeliver: boolean;
755
+ }) => {
756
+ to: `0x${string}`;
757
+ value: bigint;
758
+ data: `0x${string}`;
759
+ } | null;
760
+ /**
761
+ * Calculates the asset out key from the bridge key path, asset in address, and unwrap
762
+ * @param bridgeKeyPath - the bridge key path
763
+ * @param assetInAddress - the asset in address
764
+ * @param unwrap - whether to unwrap
765
+ * @returns the asset out key
766
+ */
767
+ export declare const assetOutKey: ({ bridgeKeyPath, assetInAddress, unwrap, }: {
768
+ bridgeKeyPath: string;
769
+ assetInAddress?: Hex | null;
770
+ unwrap: boolean;
771
+ }) => string | null;
772
+ /**
773
+ * Returns the asset out from the asset in address, assets out, bridge key path, and unwrap
774
+ * @param assetInAddress - the asset in address
775
+ * @param assetsOut - the assets out
776
+ * @param bridgeKeyPath - the bridge key path
777
+ * @param unwrap - whether to unwrap
778
+ * @returns the asset out
779
+ */
780
+ export declare const assetOut: ({ assetInAddress, assetsOut, bridgeKeyPath, unwrap, }: {
781
+ assetInAddress: Hex | null;
782
+ assetsOut: Map<string, Token>;
783
+ bridgeKeyPath: string;
784
+ unwrap: boolean;
785
+ }) => Token | null;