@switch-win/sdk 1.2.8 → 1.3.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 (73) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/GASLESS.md +407 -0
  3. package/LIMIT-ORDERS.md +212 -198
  4. package/README.md +131 -105
  5. package/ROBINHOOD.md +201 -198
  6. package/abi/GaslessSwitchV2ABI.json +1095 -0
  7. package/dist/constants.d.ts +276 -0
  8. package/dist/constants.d.ts.map +1 -0
  9. package/dist/constants.js +403 -0
  10. package/dist/constants.js.map +1 -0
  11. package/dist/gasless-client.d.ts +81 -0
  12. package/dist/gasless-client.d.ts.map +1 -0
  13. package/dist/gasless-client.js +467 -0
  14. package/dist/gasless-client.js.map +1 -0
  15. package/dist/gasless-index.d.ts +5 -0
  16. package/dist/gasless-index.d.ts.map +1 -0
  17. package/dist/gasless-index.js +5 -0
  18. package/dist/gasless-index.js.map +1 -0
  19. package/dist/gasless-operators.d.ts +32 -0
  20. package/dist/gasless-operators.d.ts.map +1 -0
  21. package/dist/gasless-operators.js +132 -0
  22. package/dist/gasless-operators.js.map +1 -0
  23. package/dist/gasless-store.d.ts +18 -0
  24. package/dist/gasless-store.d.ts.map +1 -0
  25. package/dist/gasless-store.js +83 -0
  26. package/dist/gasless-store.js.map +1 -0
  27. package/dist/gasless-types.d.ts +218 -0
  28. package/dist/gasless-types.d.ts.map +1 -0
  29. package/dist/gasless-types.js +2 -0
  30. package/dist/gasless-types.js.map +1 -0
  31. package/dist/gasless.d.ts +135 -0
  32. package/dist/gasless.d.ts.map +1 -0
  33. package/dist/gasless.js +513 -0
  34. package/dist/gasless.js.map +1 -0
  35. package/dist/index.d.ts +29 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +30 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/limit-orders.d.ts +440 -0
  40. package/dist/limit-orders.d.ts.map +1 -0
  41. package/dist/limit-orders.js +387 -0
  42. package/dist/limit-orders.js.map +1 -0
  43. package/dist/networks/index.d.ts +3 -0
  44. package/dist/networks/index.d.ts.map +1 -0
  45. package/dist/networks/index.js +2 -0
  46. package/dist/networks/index.js.map +1 -0
  47. package/dist/networks/robinhood.d.ts +536 -0
  48. package/dist/networks/robinhood.d.ts.map +1 -0
  49. package/dist/networks/robinhood.js +489 -0
  50. package/dist/networks/robinhood.js.map +1 -0
  51. package/dist/types.d.ts +436 -0
  52. package/dist/types.d.ts.map +1 -0
  53. package/dist/types.js +19 -0
  54. package/dist/types.js.map +1 -0
  55. package/examples/gasless-nextjs-proxy.ts +87 -0
  56. package/examples/gasless-operator.ts +76 -0
  57. package/examples/gasless-swap.ts +170 -0
  58. package/examples/limit-order-ethers.ts +195 -0
  59. package/examples/nextjs-proxy.ts +82 -0
  60. package/examples/react-hooks.tsx +396 -0
  61. package/examples/swap-ethers.ts +209 -0
  62. package/examples/swap-web3py.py +267 -0
  63. package/package.json +53 -12
  64. package/src/constants.ts +181 -178
  65. package/src/gasless-client.ts +823 -0
  66. package/src/gasless-index.ts +4 -0
  67. package/src/gasless-operators.ts +227 -0
  68. package/src/gasless-store.ts +137 -0
  69. package/src/gasless-types.ts +258 -0
  70. package/src/gasless.ts +756 -0
  71. package/src/index.ts +69 -63
  72. package/src/limit-orders.ts +206 -195
  73. package/src/types.ts +80 -55
@@ -0,0 +1,387 @@
1
+ /**
2
+ * Switch Limit Orders (V2) — Helper Functions
3
+ *
4
+ * Provides a complete toolkit for creating, signing, submitting, querying,
5
+ * and cancelling EIP-712 signed limit orders on PulseChain and Robinhood
6
+ * Chain.
7
+ *
8
+ * ## How it works
9
+ *
10
+ * 1. **Build** order parameters with `buildLimitOrder()`
11
+ * 2. **Sign** via EIP-712 with your wallet (ethers.js `signTypedData`)
12
+ * 3. **Submit** the signed order to the Switch backend with `submitLimitOrder()`
13
+ * 4. The Switch filler bot monitors active orders and fills them when profitable
14
+ * 5. **Cancel** an order on-chain via `invalidateNonce()`; the backend indexer
15
+ * observes the cancellation event
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import { buildLimitOrder, submitLimitOrder, fetchLimitOrders } from "@switch-win/sdk/limit-orders";
20
+ * ```
21
+ */
22
+ import { LIMIT_ORDERS_ENDPOINT, LIMIT_ORDER_PAIRS_ENDPOINT, LIMIT_ORDER_STATS_ENDPOINT, LIMIT_ORDER_EIP712_DOMAIN, LIMIT_ORDER_EIP712_TYPES, SWITCH_LIMIT_ORDER, SWITCH_ROUTER, SWITCH_PLS_FLOW, WPLS, NATIVE_PLS, } from "./constants.js";
23
+ import { ROBINHOOD_CHAIN, ROBINHOOD_NATIVE_ETH, ROBINHOOD_SWITCH_CONTRACTS, ROBINHOOD_TOKENS, } from "./networks/robinhood.js";
24
+ import { GASLESS_DEPLOYMENTS, GASLESS_LEGACY_CONTRACTS } from "./gasless.js";
25
+ const gaslessContracts = new Set([
26
+ ...Object.values(GASLESS_DEPLOYMENTS).map(deployment => deployment.contract),
27
+ ...Object.values(GASLESS_LEGACY_CONTRACTS).flat(),
28
+ ].map(address => address.toLowerCase()));
29
+ // ── Re-export EIP-712 constants for convenience ─────────────────────────────
30
+ export { LIMIT_ORDER_EIP712_DOMAIN, LIMIT_ORDER_EIP712_TYPES } from "./constants.js";
31
+ /**
32
+ * Build a `LimitOrderParams` object ready for EIP-712 signing.
33
+ *
34
+ * @param options - Order parameters
35
+ * @returns A fully-populated `LimitOrderParams` object
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const order = buildLimitOrder({
40
+ * maker: "0xYourAddress",
41
+ * tokenIn: WPLS,
42
+ * tokenOut: "0xPLSXAddress",
43
+ * amountIn: ethers.parseUnits("1000", 18).toString(),
44
+ * minAmountOut: ethers.parseUnits("500000", 18).toString(),
45
+ * });
46
+ * ```
47
+ */
48
+ export function buildLimitOrder(options) {
49
+ const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
50
+ return {
51
+ maker: options.maker,
52
+ tokenIn: options.tokenIn,
53
+ tokenOut: options.tokenOut,
54
+ amountIn: options.amountIn,
55
+ minAmountOut: options.minAmountOut,
56
+ deadline: options.deadline ?? 0,
57
+ nonce: options.nonce ?? Date.now(),
58
+ feeOnOutput: options.feeOnOutput ?? false,
59
+ recipient: options.recipient ?? options.maker,
60
+ unwrapOutput: options.unwrapOutput ?? false,
61
+ partnerAddress: options.partnerAddress ?? ZERO_ADDRESS,
62
+ };
63
+ }
64
+ /**
65
+ * Get the EIP-712 domain and types needed for signing a limit order.
66
+ *
67
+ * Pass the returned values directly to your wallet's `signTypedData` method.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * // ethers.js v6
72
+ * const { domain, types } = getEIP712SigningParams();
73
+ * const signature = await signer.signTypedData(domain, types, order);
74
+ *
75
+ * // ethers.js v5
76
+ * const signature = await signer._signTypedData(domain, types, order);
77
+ * ```
78
+ */
79
+ export function getEIP712SigningParams(limitOrderContract, chainId = 369) {
80
+ if (limitOrderContract && gaslessContracts.has(limitOrderContract.toLowerCase())) {
81
+ throw new Error("GaslessSwitch requires its dedicated signing domain. Use getGaslessSigningParams() for V2.");
82
+ }
83
+ if (limitOrderContract) {
84
+ return {
85
+ domain: {
86
+ name: "SwitchLimitOrder",
87
+ version: "2",
88
+ chainId,
89
+ verifyingContract: limitOrderContract,
90
+ },
91
+ types: LIMIT_ORDER_EIP712_TYPES,
92
+ };
93
+ }
94
+ return {
95
+ domain: LIMIT_ORDER_EIP712_DOMAIN,
96
+ types: LIMIT_ORDER_EIP712_TYPES,
97
+ };
98
+ }
99
+ /**
100
+ * Get the approval target for `feeOnOutput: false` orders (the default).
101
+ *
102
+ * When `feeOnOutput` is `false`, the **SwitchLimitOrder** contract pulls
103
+ * tokens from the maker via `safeTransferFrom`, then forwards them to the
104
+ * router internally. The maker must `approve(SWITCH_LIMIT_ORDER, amountIn)`.
105
+ *
106
+ * For `feeOnOutput: true` orders, use {@link getRouterApprovalTarget} instead.
107
+ *
108
+ * @returns The SwitchLimitOrder contract address
109
+ */
110
+ export function getApprovalTarget(limitOrderContract) {
111
+ return limitOrderContract || SWITCH_LIMIT_ORDER;
112
+ }
113
+ /**
114
+ * Get the approval target for `feeOnOutput: true` orders.
115
+ *
116
+ * When `feeOnOutput` is `true`, the **SwitchRouter** pulls tokens directly
117
+ * from the maker via `goSwitchFrom` (one transfer, one tax — ideal for tax
118
+ * input tokens). The maker must `approve(SWITCH_ROUTER, amountIn)`.
119
+ *
120
+ * For `feeOnOutput: false` orders (default), use {@link getApprovalTarget} instead.
121
+ *
122
+ * @returns The SwitchRouter contract address
123
+ */
124
+ export function getRouterApprovalTarget(routerContract) {
125
+ return routerContract || SWITCH_ROUTER;
126
+ }
127
+ /**
128
+ * Determine whether `unwrapOutput` should be set for a given output token.
129
+ *
130
+ * Returns `true` only if `tokenOut` is WPLS (the output will be unwrapped
131
+ * to native PLS by the contract).
132
+ */
133
+ export function shouldUnwrapOutput(tokenOut, wrappedNativeToken = WPLS) {
134
+ return tokenOut.toLowerCase() === wrappedNativeToken.toLowerCase();
135
+ }
136
+ // ═══════════════════════════════════════════════════════════════════════════════
137
+ // Native-currency flow (SwitchPLSFlow ABI: PLS on PulseChain, ETH on Robinhood)
138
+ // ═══════════════════════════════════════════════════════════════════════════════
139
+ /**
140
+ * Get the SwitchPLSFlow contract address.
141
+ *
142
+ * Use this contract to create native PLS limit orders (sell PLS for any token)
143
+ * in a single transaction — no EIP-712 signing required.
144
+ *
145
+ * @returns The SwitchPLSFlow contract address
146
+ */
147
+ export function getPLSFlowAddress(nativeFlowContract) {
148
+ return nativeFlowContract || SWITCH_PLS_FLOW;
149
+ }
150
+ /** Static defaults. Prefer {@link fetchLimitOrderConfig} at application startup. */
151
+ export const LIMIT_ORDER_NETWORK_CONFIGS = {
152
+ pulsechain: {
153
+ network: "pulsechain",
154
+ chainId: 369,
155
+ chainName: "PulseChain",
156
+ nativeSymbol: "PLS",
157
+ nativeSentinel: NATIVE_PLS,
158
+ wrappedNativeToken: WPLS,
159
+ routerContract: SWITCH_ROUTER,
160
+ limitOrderContract: SWITCH_LIMIT_ORDER,
161
+ nativeFlowContract: SWITCH_PLS_FLOW,
162
+ },
163
+ robinhood: {
164
+ network: "robinhood",
165
+ chainId: ROBINHOOD_CHAIN.id,
166
+ chainName: ROBINHOOD_CHAIN.name,
167
+ nativeSymbol: "ETH",
168
+ nativeSentinel: ROBINHOOD_NATIVE_ETH,
169
+ wrappedNativeToken: ROBINHOOD_TOKENS.WETH.address,
170
+ routerContract: ROBINHOOD_SWITCH_CONTRACTS.router,
171
+ limitOrderContract: ROBINHOOD_SWITCH_CONTRACTS.limitOrder,
172
+ nativeFlowContract: ROBINHOOD_SWITCH_CONTRACTS.nativeEthFlow,
173
+ },
174
+ };
175
+ /** Return the static deployment defaults for a supported limit-order network. */
176
+ export function getLimitOrderNetworkConfig(network = "pulsechain") {
177
+ return LIMIT_ORDER_NETWORK_CONFIGS[network];
178
+ }
179
+ /** Build the correct EIP-712 signing domain for a supported network. */
180
+ export function getNetworkEIP712SigningParams(network, limitOrderContract) {
181
+ const config = getLimitOrderNetworkConfig(network);
182
+ return getEIP712SigningParams(limitOrderContract ?? config.limitOrderContract, config.chainId);
183
+ }
184
+ /** Resolve the maker's ERC-20 approval target for the selected fee mode. */
185
+ export function getLimitOrderApprovalTarget(network, feeOnOutput, overrides = {}) {
186
+ const config = getLimitOrderNetworkConfig(network);
187
+ return feeOnOutput
188
+ ? getRouterApprovalTarget(overrides.routerContract ?? config.routerContract)
189
+ : getApprovalTarget(overrides.limitOrderContract ?? config.limitOrderContract);
190
+ }
191
+ function endpointForNetwork(endpoint, network) {
192
+ if (!network)
193
+ return endpoint;
194
+ const url = new URL(endpoint);
195
+ url.searchParams.set("network", network);
196
+ return url.toString();
197
+ }
198
+ /**
199
+ * Check if the input token is native PLS (should use PLSFlow instead of EIP-712).
200
+ *
201
+ * When the user wants to sell native PLS (not WPLS), they should use the
202
+ * PLSFlow contract instead of the standard EIP-712 signing flow.
203
+ *
204
+ * @param tokenIn - The input token address
205
+ * @returns `true` if tokenIn is the native PLS sentinel address
206
+ */
207
+ export function isNativePLS(tokenIn) {
208
+ const NATIVE_SENTINEL = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
209
+ return tokenIn.toLowerCase() === NATIVE_SENTINEL.toLowerCase();
210
+ }
211
+ /** Network-neutral native-currency sentinel check (PLS or ETH). */
212
+ export function isNativeCurrency(tokenIn) {
213
+ const normalized = tokenIn.toLowerCase();
214
+ return (normalized === NATIVE_PLS.toLowerCase() ||
215
+ normalized === ROBINHOOD_NATIVE_ETH.toLowerCase());
216
+ }
217
+ /** Return the native-order flow contract for PulseChain or Robinhood Chain. */
218
+ export function getNativeFlowAddress(network, nativeFlowContract) {
219
+ return nativeFlowContract ?? getLimitOrderNetworkConfig(network).nativeFlowContract;
220
+ }
221
+ // ═══════════════════════════════════════════════════════════════════════════════
222
+ // API Helpers
223
+ // ═══════════════════════════════════════════════════════════════════════════════
224
+ /**
225
+ * Submit a signed limit order to the Switch backend.
226
+ *
227
+ * The backend verifies the EIP-712 signature and stores the order. No gas
228
+ * is required — this is an off-chain operation.
229
+ *
230
+ * **⚠️ CRITICAL:** For standard ERC-20 orders, the EIP-712 signature is
231
+ * purely off-chain — nothing is recorded on-chain until the bot fills it.
232
+ * If this POST fails or never fires (e.g. user closes their browser after
233
+ * signing), the **order is permanently lost**. Your integration should:
234
+ *
235
+ * 1. Call `submitLimitOrder()` **immediately** after the user signs.
236
+ * 2. **Await** the response and verify `success: true` before showing
237
+ * the order as "created" in your UI.
238
+ * 3. If the POST fails, first query the same maker + nonce and verify its
239
+ * contract and every signed field. The backend rejects duplicate nonces;
240
+ * it does not return an idempotent success. Retry only the identical payload,
241
+ * preserving its nonce and signature while the order is still live.
242
+ * 4. Do **not** navigate away or close the signing flow until the
243
+ * backend confirms the order.
244
+ *
245
+ * Native PLS/ETH flow orders are an exception — they are recorded
246
+ * on-chain first, so the backend can discover them via event indexing
247
+ * even if the POST never arrives.
248
+ *
249
+ * @param signedOrder - Order parameters + EIP-712 signature
250
+ * @returns The created order record, or an error
251
+ *
252
+ * @example
253
+ * ```ts
254
+ * const order = buildLimitOrder({ ... });
255
+ * const signature = await signer.signTypedData(domain, types, order);
256
+ * const result = await submitLimitOrder({ ...order, signature });
257
+ *
258
+ * if ("error" in result) {
259
+ * console.error(result.error);
260
+ * } else {
261
+ * console.log("Order created:", result.order.id);
262
+ * }
263
+ * ```
264
+ */
265
+ export async function submitLimitOrder(signedOrder, options = {}) {
266
+ const res = await fetch(endpointForNetwork(LIMIT_ORDERS_ENDPOINT, options.network), {
267
+ method: "POST",
268
+ headers: { "Content-Type": "application/json" },
269
+ body: JSON.stringify(signedOrder),
270
+ });
271
+ return res.json();
272
+ }
273
+ /**
274
+ * Legacy helper for backend deployments that implemented REST cancellation.
275
+ *
276
+ * The current hosted Switch API intentionally has no DELETE endpoint.
277
+ * Cancellation must be performed on-chain with `invalidateNonce(nonce)` on
278
+ * the contract stored in the order's `limitOrderContract` field. The indexer
279
+ * then updates the order status from the emitted event.
280
+ *
281
+ * @param maker - Maker address
282
+ * @param nonce - Nonce of the order to cancel
283
+ * @returns Success confirmation or error on compatible legacy backends
284
+ * @deprecated Do not use with the hosted Switch API; cancel on-chain instead.
285
+ */
286
+ export async function cancelLimitOrder(maker, nonce, options = {}) {
287
+ const res = await fetch(endpointForNetwork(LIMIT_ORDERS_ENDPOINT, options.network), {
288
+ method: "DELETE",
289
+ headers: { "Content-Type": "application/json" },
290
+ body: JSON.stringify({ maker, nonce }),
291
+ });
292
+ return res.json();
293
+ }
294
+ /**
295
+ * Fetch limit orders from the Switch backend with optional filters.
296
+ *
297
+ * @param options - Query filters (all optional)
298
+ * @returns Paginated list of orders
299
+ *
300
+ * @example
301
+ * ```ts
302
+ * // All active orders for a specific maker
303
+ * const { orders, total } = await fetchLimitOrders({
304
+ * maker: "0xYourAddress",
305
+ * status: "ACTIVE",
306
+ * });
307
+ *
308
+ * // All filled orders for a token pair
309
+ * const filled = await fetchLimitOrders({
310
+ * tokenIn: WPLS,
311
+ * tokenOut: "0xPLSXAddress",
312
+ * status: "FILLED",
313
+ * });
314
+ *
315
+ * // Orders attributed to a specific partner
316
+ * const partnerOrders = await fetchLimitOrders({
317
+ * partnerAddress: "0xPartnerAddress",
318
+ * status: "ACTIVE",
319
+ * });
320
+ * ```
321
+ */
322
+ export async function fetchLimitOrders(options = {}) {
323
+ const params = new URLSearchParams();
324
+ if (options.status)
325
+ params.set("status", options.status);
326
+ if (options.maker)
327
+ params.set("maker", options.maker);
328
+ if (options.owner)
329
+ params.set("owner", options.owner);
330
+ if (options.partnerAddress)
331
+ params.set("partnerAddress", options.partnerAddress);
332
+ if (options.tokenIn)
333
+ params.set("tokenIn", options.tokenIn);
334
+ if (options.tokenOut)
335
+ params.set("tokenOut", options.tokenOut);
336
+ if (options.pair)
337
+ params.set("pair", options.pair);
338
+ if (options.limit != null)
339
+ params.set("limit", String(options.limit));
340
+ if (options.offset != null)
341
+ params.set("offset", String(options.offset));
342
+ if (options.network)
343
+ params.set("network", options.network);
344
+ const url = params.toString()
345
+ ? `${LIMIT_ORDERS_ENDPOINT}?${params}`
346
+ : LIMIT_ORDERS_ENDPOINT;
347
+ const res = await fetch(url);
348
+ return res.json();
349
+ }
350
+ /**
351
+ * Fetch a single limit order by maker address and nonce.
352
+ *
353
+ * @param maker - Maker address
354
+ * @param nonce - Order nonce
355
+ * @returns The order record, or an error if not found
356
+ */
357
+ export async function fetchLimitOrder(maker, nonce, options = {}) {
358
+ const res = await fetch(endpointForNetwork(`${LIMIT_ORDERS_ENDPOINT}/${maker}/${nonce}`, options.network));
359
+ return res.json();
360
+ }
361
+ /**
362
+ * Fetch active trading pairs with order counts.
363
+ *
364
+ * Useful for displaying which token pairs have open limit orders.
365
+ */
366
+ export async function fetchLimitOrderPairs(options = {}) {
367
+ const res = await fetch(endpointForNetwork(LIMIT_ORDER_PAIRS_ENDPOINT, options.network));
368
+ return res.json();
369
+ }
370
+ /** Fetch the active deployment and EIP-712 domain for a network. */
371
+ export async function fetchLimitOrderConfig(options = {}) {
372
+ const res = await fetch(endpointForNetwork(`${LIMIT_ORDERS_ENDPOINT}/config`, options.network));
373
+ if (!res.ok) {
374
+ throw new Error(`Failed to fetch limit-order config (${res.status})`);
375
+ }
376
+ return res.json();
377
+ }
378
+ /**
379
+ * Fetch summary statistics for all limit orders.
380
+ *
381
+ * Returns counts of active, filled, cancelled, and expired orders.
382
+ */
383
+ export async function fetchLimitOrderStats(options = {}) {
384
+ const res = await fetch(endpointForNetwork(LIMIT_ORDER_STATS_ENDPOINT, options.network));
385
+ return res.json();
386
+ }
387
+ //# sourceMappingURL=limit-orders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limit-orders.js","sourceRoot":"","sources":["../src/limit-orders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAgBH,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,IAAI,EACJ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7E,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC5E,GAAG,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE;CAClD,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAEzC,+EAA+E;AAE/E,OAAO,EAAE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tC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,kBAAkB,CAAC,0BAA0B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACzF,OAAO,GAAG,CAAC,IAAI,EAA8B,CAAC;AAChD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ROBINHOOD_NETWORK, ROBINHOOD_CHAIN, ROBINHOOD_NATIVE_ETH, ROBINHOOD_LIMIT_ORDER_EIP712_DOMAIN, ROBINHOOD_SWITCH_CONTRACTS, ROBINHOOD_ADAPTERS, ROBINHOOD_TAX_SAFE_ADAPTER_INDICES, ROBINHOOD_TAX_SAFE_ADAPTERS, ROBINHOOD_UNISWAP_CONTRACTS, ROBINHOOD_TOKENS, ROBINHOOD_FRONTEND_TOKEN_LIST, ROBINHOOD_FRONTEND_DEFAULT_TOKENS, ROBINHOOD_TRUSTED_INTERMEDIATES, ROBINHOOD_FEE_TOKEN_PRIORITY, selectRobinhoodFeeOnOutput, buildRobinhoodQuoteUrl, } from "./robinhood.js";
2
+ export type { RobinhoodAdapter, RobinhoodToken, RobinhoodQuoteParams, RobinhoodTaxInfo, } from "./robinhood.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/networks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,mCAAmC,EACnC,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,EAClC,2BAA2B,EAC3B,2BAA2B,EAC3B,gBAAgB,EAChB,6BAA6B,EAC7B,iCAAiC,EACjC,+BAA+B,EAC/B,4BAA4B,EAC5B,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ROBINHOOD_NETWORK, ROBINHOOD_CHAIN, ROBINHOOD_NATIVE_ETH, ROBINHOOD_LIMIT_ORDER_EIP712_DOMAIN, ROBINHOOD_SWITCH_CONTRACTS, ROBINHOOD_ADAPTERS, ROBINHOOD_TAX_SAFE_ADAPTER_INDICES, ROBINHOOD_TAX_SAFE_ADAPTERS, ROBINHOOD_UNISWAP_CONTRACTS, ROBINHOOD_TOKENS, ROBINHOOD_FRONTEND_TOKEN_LIST, ROBINHOOD_FRONTEND_DEFAULT_TOKENS, ROBINHOOD_TRUSTED_INTERMEDIATES, ROBINHOOD_FEE_TOKEN_PRIORITY, selectRobinhoodFeeOnOutput, buildRobinhoodQuoteUrl, } from "./robinhood.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/networks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,mCAAmC,EACnC,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,EAClC,2BAA2B,EAC3B,2BAA2B,EAC3B,gBAAgB,EAChB,6BAA6B,EAC7B,iCAAiC,EACjC,+BAA+B,EAC/B,4BAA4B,EAC5B,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC"}