@funkit/fun-relay 2.2.0-next.5 → 2.2.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.
package/dist/index.mjs CHANGED
@@ -96,90 +96,6 @@ function getRelayClient() {
96
96
  import {
97
97
  MAINNET_RELAY_API as MAINNET_RELAY_API2
98
98
  } from "@relayprotocol/relay-sdk";
99
-
100
- // src/utils.ts
101
- function convertFunToRelayTokenAddress(address, chainId) {
102
- if (address.toLowerCase() === FUNKIT_NATIVE_TOKEN.toLowerCase()) {
103
- switch (chainId) {
104
- case FUN_HYPERCORE_CHAIN_ID_NUMBER:
105
- return RELAY_NATIVE_TOKEN_HYPERCORE;
106
- case RELAY_BITCOIN_CHAIN_ID_NUMBER:
107
- return RELAY_NATIVE_TOKEN_BITCOIN;
108
- // TODO: is it correct to assume chainId here is relay chain id?
109
- case RELAY_SOLANA_CHAIN_ID_NUMBER:
110
- case FUN_SOLANA_CHAIN_ID_NUMBER:
111
- return RELAY_NATIVE_TOKEN_SOLANA;
112
- case RELAY_LIGHTER_CHAIN_ID_NUMBER:
113
- return RELAY_LIGHTER_USDC_PERPS;
114
- default:
115
- return RELAY_NATIVE_TOKEN;
116
- }
117
- }
118
- if (RELAY_LIGHTER_CHAIN_ID_NUMBER === chainId) {
119
- const relayAddress = RELAY_LIGHTER_FUN_ADDRESS_MAP[address.toLowerCase()];
120
- if (relayAddress) {
121
- return relayAddress;
122
- }
123
- }
124
- return address;
125
- }
126
- function convertFunToRelayChainId(chainId) {
127
- if (chainId === FUN_SOLANA_CHAIN_ID_NUMBER) {
128
- return RELAY_SOLANA_CHAIN_ID_NUMBER;
129
- }
130
- return chainId;
131
- }
132
- function getRelayExecutionRefundState(info) {
133
- switch (info.status) {
134
- case "refund" /* REFUND */:
135
- return "REFUNDED" /* REFUNDED */;
136
- default:
137
- return void 0;
138
- }
139
- }
140
- function getRelayExecutionState(info) {
141
- switch (info.status) {
142
- case "success" /* SUCCESS */:
143
- return "COMPLETED" /* COMPLETED */;
144
- case "failure" /* FAILURE */:
145
- case "refund" /* REFUND */:
146
- return "CHECKOUT_ERROR" /* CHECKOUT_ERROR */;
147
- default:
148
- return "PENDING_RECEIVAL" /* PENDING_RECEIVAL */;
149
- }
150
- }
151
- function isRelayExecutionTerminalStatus(info) {
152
- return RELAY_TERMINAL_STATUSES.includes(info.status);
153
- }
154
- function jsonStringifyWithBigIntSanitization(serializable) {
155
- return JSON.stringify(
156
- serializable,
157
- (_, value) => typeof value === "bigint" ? `0x${value.toString(16)}` : value
158
- // return everything else unchanged
159
- );
160
- }
161
- function indexBy(items, getKey) {
162
- const indexedItems = {};
163
- for (const item of items) {
164
- const key = getKey(item);
165
- if (!key) {
166
- continue;
167
- }
168
- indexedItems[key] = item;
169
- }
170
- return indexedItems;
171
- }
172
- function filterNullishHeaders(params) {
173
- const result = {};
174
- for (const [key, value] of Object.entries(params)) {
175
- if (value != null) {
176
- result[key] = value;
177
- }
178
- }
179
- return result;
180
- }
181
-
182
- // src/execution.ts
183
99
  function getTxHash({
184
100
  logger,
185
101
  transactionType,
@@ -330,18 +246,6 @@ async function executeRelayQuote({
330
246
  ) {
331
247
  logger.info(`${logPrefix}:onTransactionConfirmed`, txHashes);
332
248
  isTransactionConfirmed = true;
333
- const firstStep = relayQuote.steps[0];
334
- const firstItem = firstStep?.items[0];
335
- if (firstStep?.requestId && firstItem) {
336
- manuallyRegisterIndex(logger, {
337
- requestId: firstStep.requestId,
338
- chainId: firstItem.data.chainId,
339
- tx: jsonStringifyWithBigIntSanitization({
340
- ...firstItem.data,
341
- txHash
342
- })
343
- });
344
- }
345
249
  try {
346
250
  await onTransactionConfirmed?.(txHash);
347
251
  } catch (e) {
@@ -355,42 +259,6 @@ async function executeRelayQuote({
355
259
  }
356
260
  });
357
261
  }
358
- async function manuallyRegisterIndex(logger, registerRequest) {
359
- const logPrefix = "manuallyRegisterIndex";
360
- const stringifiedRequest = JSON.stringify(registerRequest);
361
- const url = `${MAINNET_RELAY_API2}/transactions/single`;
362
- try {
363
- logger.info(`${logPrefix}:onManuallyRegisterIndex`, {
364
- params: stringifiedRequest
365
- });
366
- const response = await fetch(url, {
367
- method: "POST",
368
- body: JSON.stringify(registerRequest)
369
- });
370
- if (!response.ok) {
371
- logger.error(`${logPrefix}:onManuallyRegisterIndexError`, {
372
- message: "Error !response.ok - request to manually register index",
373
- response: JSON.stringify(response),
374
- params: stringifiedRequest
375
- });
376
- return;
377
- }
378
- const data = await response.json();
379
- if (data.message !== "Success") {
380
- logger.error(`${logPrefix}:onManuallyRegisterIndexError`, {
381
- message: `Data.message is not of type Success - ${data.message}`,
382
- response: JSON.stringify(response),
383
- params: stringifiedRequest
384
- });
385
- }
386
- return;
387
- } catch (err) {
388
- logger.error(`${logPrefix}:onManuallyRegisterIndexError`, {
389
- message: `Error sending request to register index at ${url}: ${JSON.stringify(err?.message)}`,
390
- params: stringifiedRequest
391
- });
392
- }
393
- }
394
262
  async function getRelayExecutionInfo(requestId, apiKey) {
395
263
  const url = `${MAINNET_RELAY_API2}/intents/status/v2?requestId=${requestId}`;
396
264
  const response = await fetch(url, {
@@ -475,6 +343,83 @@ function parseRelayFees({
475
343
 
476
344
  // src/price.ts
477
345
  import { MAINNET_RELAY_API as MAINNET_RELAY_API3 } from "@relayprotocol/relay-sdk";
346
+
347
+ // src/utils.ts
348
+ function convertFunToRelayTokenAddress(address, chainId) {
349
+ if (address.toLowerCase() === FUNKIT_NATIVE_TOKEN.toLowerCase()) {
350
+ switch (chainId) {
351
+ case FUN_HYPERCORE_CHAIN_ID_NUMBER:
352
+ return RELAY_NATIVE_TOKEN_HYPERCORE;
353
+ case RELAY_BITCOIN_CHAIN_ID_NUMBER:
354
+ return RELAY_NATIVE_TOKEN_BITCOIN;
355
+ // TODO: is it correct to assume chainId here is relay chain id?
356
+ case RELAY_SOLANA_CHAIN_ID_NUMBER:
357
+ case FUN_SOLANA_CHAIN_ID_NUMBER:
358
+ return RELAY_NATIVE_TOKEN_SOLANA;
359
+ case RELAY_LIGHTER_CHAIN_ID_NUMBER:
360
+ return RELAY_LIGHTER_USDC_PERPS;
361
+ default:
362
+ return RELAY_NATIVE_TOKEN;
363
+ }
364
+ }
365
+ if (RELAY_LIGHTER_CHAIN_ID_NUMBER === chainId) {
366
+ const relayAddress = RELAY_LIGHTER_FUN_ADDRESS_MAP[address.toLowerCase()];
367
+ if (relayAddress) {
368
+ return relayAddress;
369
+ }
370
+ }
371
+ return address;
372
+ }
373
+ function convertFunToRelayChainId(chainId) {
374
+ if (chainId === FUN_SOLANA_CHAIN_ID_NUMBER) {
375
+ return RELAY_SOLANA_CHAIN_ID_NUMBER;
376
+ }
377
+ return chainId;
378
+ }
379
+ function getRelayExecutionRefundState(info) {
380
+ switch (info.status) {
381
+ case "refund" /* REFUND */:
382
+ return "REFUNDED" /* REFUNDED */;
383
+ default:
384
+ return void 0;
385
+ }
386
+ }
387
+ function getRelayExecutionState(info) {
388
+ switch (info.status) {
389
+ case "success" /* SUCCESS */:
390
+ return "COMPLETED" /* COMPLETED */;
391
+ case "failure" /* FAILURE */:
392
+ case "refund" /* REFUND */:
393
+ return "CHECKOUT_ERROR" /* CHECKOUT_ERROR */;
394
+ default:
395
+ return "PENDING_RECEIVAL" /* PENDING_RECEIVAL */;
396
+ }
397
+ }
398
+ function isRelayExecutionTerminalStatus(info) {
399
+ return RELAY_TERMINAL_STATUSES.includes(info.status);
400
+ }
401
+ function indexBy(items, getKey) {
402
+ const indexedItems = {};
403
+ for (const item of items) {
404
+ const key = getKey(item);
405
+ if (!key) {
406
+ continue;
407
+ }
408
+ indexedItems[key] = item;
409
+ }
410
+ return indexedItems;
411
+ }
412
+ function filterNullishHeaders(params) {
413
+ const result = {};
414
+ for (const [key, value] of Object.entries(params)) {
415
+ if (value != null) {
416
+ result[key] = value;
417
+ }
418
+ }
419
+ return result;
420
+ }
421
+
422
+ // src/price.ts
478
423
  async function getRelayAssetPriceInfo({
479
424
  chainId,
480
425
  address,
@@ -833,7 +778,7 @@ import {
833
778
  encodeFunctionData as encodeFunctionData2,
834
779
  toFunctionSelector
835
780
  } from "viem";
836
- import { mainnet as mainnet2 } from "viem/chains";
781
+ import { mainnet as mainnet3 } from "viem/chains";
837
782
 
838
783
  // src/dynamicRoutes/abi.ts
839
784
  var UNWRAP_AND_CALL_ABI = [
@@ -1276,7 +1221,7 @@ var ASSET_LOGO_SRCS = {
1276
1221
  IMX: "https://sdk-cdn.fun.xyz/images/imx.svg",
1277
1222
  INJ: "https://sdk-cdn.fun.xyz/images/inj.svg",
1278
1223
  LDO: "https://sdk-cdn.fun.xyz/images/ldo.svg",
1279
- LINK: "https://sdk-cdn.fun.xyz/images/link.svg",
1224
+ LINK: "https://sdk-cdn.fun.xyz/images/link.png",
1280
1225
  LUCK: "https://sdk-cdn.fun.xyz/images/luck.png",
1281
1226
  MATIC: "https://sdk-cdn.fun.xyz/images/matic.svg",
1282
1227
  MFER: "https://sdk-cdn.fun.xyz/images/mfer.png",
@@ -1294,7 +1239,7 @@ var ASSET_LOGO_SRCS = {
1294
1239
  SOL: "https://sdk-cdn.fun.xyz/images/sol.svg",
1295
1240
  SUSDS: "https://sdk-cdn.fun.xyz/images/susds.svg",
1296
1241
  TYBG: "https://sdk-cdn.fun.xyz/images/tybg.png",
1297
- UNI: "https://sdk-cdn.fun.xyz/images/uni.svg",
1242
+ UNI: "https://sdk-cdn.fun.xyz/images/uni.png",
1298
1243
  USDC: "https://sdk-cdn.fun.xyz/images/usdc.svg",
1299
1244
  "USDC.E": "https://sdk-cdn.fun.xyz/images/usdc.svg",
1300
1245
  USDE: "https://sdk-cdn.fun.xyz/images/usde.svg",
@@ -1335,7 +1280,8 @@ var ASSET_LOGO_SRCS = {
1335
1280
  MON: "https://sdk-cdn.fun.xyz/images/monad.svg",
1336
1281
  WMON: "https://sdk-cdn.fun.xyz/images/wmon.svg",
1337
1282
  AUSD: "https://sdk-cdn.fun.xyz/images/ausd.svg",
1338
- SUSHI: "https://sdk-cdn.fun.xyz/images/sushi.svg"
1283
+ SUSHI: "https://sdk-cdn.fun.xyz/images/sushi.svg",
1284
+ SKY: "https://sdk-cdn.fun.xyz/images/sky.svg"
1339
1285
  };
1340
1286
 
1341
1287
  // src/dynamicRoutes/consts.ts
@@ -1349,6 +1295,25 @@ var tokenAddresses = {
1349
1295
  },
1350
1296
  USDC: {
1351
1297
  [mainnet.id]: getAddress("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")
1298
+ },
1299
+ // LIT is currently unused
1300
+ LIT: {
1301
+ [mainnet.id]: getAddress("0x232CE3bd40fCd6f80f3d55A522d03f25Df784Ee2")
1302
+ },
1303
+ LINK: {
1304
+ [mainnet.id]: getAddress("0x514910771AF9Ca656af840dff83E8264EcF986CA")
1305
+ },
1306
+ UNI: {
1307
+ [mainnet.id]: getAddress("0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984")
1308
+ },
1309
+ AAVE: {
1310
+ [mainnet.id]: getAddress("0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9")
1311
+ },
1312
+ SKY: {
1313
+ [mainnet.id]: getAddress("0x56072C95FAA701256059aa122697B133aDEd9279")
1314
+ },
1315
+ LDO: {
1316
+ [mainnet.id]: getAddress("0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32")
1352
1317
  }
1353
1318
  };
1354
1319
  var UNWRAP_AND_CALL_ADDRESS = {
@@ -1363,6 +1328,8 @@ var LIGHTER_DEPOSIT_ADDRESS = getAddress(
1363
1328
  var MATCH_ALL_CONDITION = "*";
1364
1329
 
1365
1330
  // src/dynamicRoutes/utils.ts
1331
+ import { erc20Abi as ERC20_ABI } from "viem";
1332
+ import { mainnet as mainnet2 } from "viem/chains";
1366
1333
  var createPath = (config) => {
1367
1334
  return config;
1368
1335
  };
@@ -1445,6 +1412,35 @@ var initDynamicRouting = (dynamicRoutes, dynamicRoutingConfig) => {
1445
1412
  );
1446
1413
  return indexedDynamicRoutingConfig;
1447
1414
  };
1415
+ var MAX_APPROVAL = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
1416
+ var getApprovalCalldata = ({
1417
+ tokenAddress,
1418
+ spenderAddress,
1419
+ amount
1420
+ }) => {
1421
+ return {
1422
+ contractAbi: ERC20_ABI,
1423
+ contractAddress: tokenAddress,
1424
+ functionName: "approve",
1425
+ functionArgs: [spenderAddress, amount]
1426
+ };
1427
+ };
1428
+ var getResetApprovalCalldata = ({
1429
+ tokenAddress,
1430
+ spenderAddress
1431
+ }) => {
1432
+ return getApprovalCalldata({
1433
+ tokenAddress,
1434
+ spenderAddress,
1435
+ amount: "0"
1436
+ });
1437
+ };
1438
+ var RESET_APPROVAL_TOKENS = [tokenAddresses.LDO[mainnet2.id]].map(
1439
+ (address) => address.toLowerCase()
1440
+ );
1441
+ var shouldResetApproval = (tokenAddress) => {
1442
+ return RESET_APPROVAL_TOKENS.includes(tokenAddress.toLowerCase());
1443
+ };
1448
1444
 
1449
1445
  // src/dynamicRoutes/lighter.ts
1450
1446
  var NATIVE_TOKEN = FUNKIT_NATIVE_TOKEN;
@@ -1453,14 +1449,31 @@ var RELAY_LIGHTER_ETH_SPOT_ADDRESS = "0x0000000000000000000000000000000000000001
1453
1449
  var RELAY_LIGHTER_USDC_PERPS_ADDRESS = "0x0000000000000000000000000000000000000000";
1454
1450
  var TICK_SIZE_FOR_ASSET_INDEX = {
1455
1451
  [3 /* USDC */]: BigInt(1),
1456
- [1 /* ETH */]: BigInt(10 ** 10)
1452
+ [1 /* ETH */]: BigInt(10 ** 10),
1453
+ [2 /* LIT */]: BigInt(10 ** 10),
1454
+ [5 /* LINK */]: BigInt(10 ** 10),
1455
+ [6 /* UNI */]: BigInt(10 ** 10),
1456
+ [7 /* AAVE */]: BigInt(10 ** 10),
1457
+ [8 /* SKY */]: BigInt(10 ** 10),
1458
+ [9 /* LDO */]: BigInt(10 ** 10)
1457
1459
  };
1458
1460
  var DEPOSIT_TOKEN_FOR_ASSET_INDEX = {
1459
- [3 /* USDC */]: tokenAddresses.USDC[mainnet2.id],
1460
- [1 /* ETH */]: NATIVE_TOKEN
1461
+ [3 /* USDC */]: tokenAddresses.USDC[mainnet3.id],
1462
+ [1 /* ETH */]: NATIVE_TOKEN,
1463
+ [2 /* LIT */]: tokenAddresses.LIT[mainnet3.id],
1464
+ [5 /* LINK */]: tokenAddresses.LINK[mainnet3.id],
1465
+ [6 /* UNI */]: tokenAddresses.UNI[mainnet3.id],
1466
+ [7 /* AAVE */]: tokenAddresses.AAVE[mainnet3.id],
1467
+ [8 /* SKY */]: tokenAddresses.SKY[mainnet3.id],
1468
+ [9 /* LDO */]: tokenAddresses.LDO[mainnet3.id]
1461
1469
  };
1462
1470
  var USDC_PERPS_SYMBOL = "USDC (Perps)";
1463
1471
  var ETH_SPOT_SYMBOL = "ETH (Spot)";
1472
+ var LINK_SPOT_SYMBOL = "LINK (Spot)";
1473
+ var UNI_SPOT_SYMBOL = "UNI (Spot)";
1474
+ var AAVE_SPOT_SYMBOL = "AAVE (Spot)";
1475
+ var SKY_SPOT_SYMBOL = "SKY (Spot)";
1476
+ var LDO_SPOT_SYMBOL = "LDO (Spot)";
1464
1477
  var generateLighterMainnetDepositActions = ({
1465
1478
  address,
1466
1479
  assetIndex,
@@ -1503,22 +1516,18 @@ var generateLighterMainnetDepositActions = ({
1503
1516
  });
1504
1517
  return [
1505
1518
  // Step 1: Approve WETH to UnwrapWETHAndCall
1506
- {
1507
- contractAbi: erc20Abi,
1508
- contractAddress: tokenAddresses.WETH[mainnet2.id],
1509
- functionName: "approve",
1510
- functionArgs: [
1511
- UNWRAP_AND_CALL_ADDRESS[mainnet2.id],
1512
- "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
1513
- ]
1514
- },
1519
+ getApprovalCalldata({
1520
+ tokenAddress: tokenAddresses.WETH[mainnet3.id],
1521
+ spenderAddress: UNWRAP_AND_CALL_ADDRESS[mainnet3.id],
1522
+ amount: MAX_APPROVAL
1523
+ }),
1515
1524
  // Step 2: UnwrapWETHAndCall pulls WETH, unwraps to ETH, sends to VaultWrapper, calls deposit
1516
1525
  {
1517
1526
  contractAbi: UNWRAP_AND_CALL_ABI,
1518
- contractAddress: UNWRAP_AND_CALL_ADDRESS[mainnet2.id],
1527
+ contractAddress: UNWRAP_AND_CALL_ADDRESS[mainnet3.id],
1519
1528
  functionName: "unwrapAndCall",
1520
1529
  functionArgs: [
1521
- VAULT_DEPOSITOR_ADDRESS[mainnet2.id],
1530
+ VAULT_DEPOSITOR_ADDRESS[mainnet3.id],
1522
1531
  // target (VaultWrapper)
1523
1532
  vaultWrapperCalldata
1524
1533
  // VaultWrapper.deposit() calldata
@@ -1526,52 +1535,53 @@ var generateLighterMainnetDepositActions = ({
1526
1535
  }
1527
1536
  ];
1528
1537
  }
1529
- if (depositToken === tokenAddresses.USDC[mainnet2.id]) {
1530
- return [
1531
- // Step 1: Approve USDC to VaultDepositor
1532
- {
1533
- contractAbi: erc20Abi,
1534
- contractAddress: tokenAddresses.USDC[mainnet2.id],
1535
- functionName: "approve",
1536
- functionArgs: [
1537
- VAULT_DEPOSITOR_ADDRESS[mainnet2.id],
1538
- "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
1539
- // Max approval
1540
- ]
1541
- },
1542
- // Step 2: VaultDepositor pulls USDC and calls Lighter deposit
1543
- {
1544
- contractAbi: VAULT_DEPOSITOR_ABI,
1545
- contractAddress: VAULT_DEPOSITOR_ADDRESS[mainnet2.id],
1546
- functionName: "depositWithTick",
1547
- functionArgs: [
1548
- tokenAddresses.USDC[mainnet2.id],
1549
- // token (USDC)
1550
- LIGHTER_DEPOSIT_ADDRESS,
1551
- // vault (Lighter deposit contract)
1552
- lighterDepositCalldata,
1553
- // callData
1554
- 0n,
1555
- // minAmountOut
1556
- tickSize,
1557
- // tickSize
1558
- dustRecipient
1559
- // dustRecipient
1560
- ]
1561
- }
1562
- ];
1563
- }
1538
+ const resetApprovalNeeded = shouldResetApproval(depositToken);
1539
+ return [
1540
+ // Special handling of LDO token as it requires approval reset before approval can be set to a new value due to non-standard implementation of the approve function.
1541
+ ...resetApprovalNeeded ? [
1542
+ getResetApprovalCalldata({
1543
+ tokenAddress: depositToken,
1544
+ spenderAddress: VAULT_DEPOSITOR_ADDRESS[mainnet3.id]
1545
+ })
1546
+ ] : [],
1547
+ // Step 1: Approve deposit token to VaultDepositor
1548
+ getApprovalCalldata({
1549
+ tokenAddress: depositToken,
1550
+ spenderAddress: VAULT_DEPOSITOR_ADDRESS[mainnet3.id],
1551
+ amount: MAX_APPROVAL
1552
+ }),
1553
+ // Step 2: VaultDepositor pulls deposit token and calls Lighter deposit
1554
+ {
1555
+ contractAbi: VAULT_DEPOSITOR_ABI,
1556
+ contractAddress: VAULT_DEPOSITOR_ADDRESS[mainnet3.id],
1557
+ functionName: "depositWithTick",
1558
+ functionArgs: [
1559
+ depositToken,
1560
+ // token (deposit token)
1561
+ LIGHTER_DEPOSIT_ADDRESS,
1562
+ // vault (Lighter deposit contract)
1563
+ lighterDepositCalldata,
1564
+ // callData
1565
+ 0n,
1566
+ // minAmountOut
1567
+ tickSize,
1568
+ // tickSize
1569
+ dustRecipient
1570
+ // dustRecipient
1571
+ ]
1572
+ }
1573
+ ];
1564
1574
  };
1565
1575
  var LIGHTER_USDC_PERPS_FUN_MAINNET_DEPOSIT = createPath({
1566
- targetChain: mainnet2.id.toString(),
1567
- targetAsset: tokenAddresses.USDC[mainnet2.id],
1576
+ targetChain: mainnet3.id.toString(),
1577
+ targetAsset: tokenAddresses.USDC[mainnet3.id],
1568
1578
  targetAssetTicker: USDC_PERPS_SYMBOL,
1569
1579
  iconSrc: ASSET_LOGO_SRCS.USDC,
1570
1580
  generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1571
1581
  if (!outputConfig) {
1572
1582
  return [];
1573
1583
  }
1574
- if (outputConfig.targetChain !== mainnet2.id.toString()) {
1584
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1575
1585
  return [];
1576
1586
  }
1577
1587
  return generateLighterMainnetDepositActions({
@@ -1582,15 +1592,15 @@ var LIGHTER_USDC_PERPS_FUN_MAINNET_DEPOSIT = createPath({
1582
1592
  }
1583
1593
  });
1584
1594
  var LIGHTER_ETH_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1585
- targetChain: mainnet2.id.toString(),
1586
- targetAsset: tokenAddresses.WETH[mainnet2.id],
1595
+ targetChain: mainnet3.id.toString(),
1596
+ targetAsset: tokenAddresses.WETH[mainnet3.id],
1587
1597
  targetAssetTicker: ETH_SPOT_SYMBOL,
1588
1598
  iconSrc: ASSET_LOGO_SRCS.ETH,
1589
1599
  generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1590
1600
  if (!outputConfig) {
1591
1601
  return [];
1592
1602
  }
1593
- if (outputConfig.targetChain !== mainnet2.id.toString()) {
1603
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1594
1604
  return [];
1595
1605
  }
1596
1606
  return generateLighterMainnetDepositActions({
@@ -1600,6 +1610,101 @@ var LIGHTER_ETH_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1600
1610
  });
1601
1611
  }
1602
1612
  });
1613
+ var LIGHTER_LINK_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1614
+ targetChain: mainnet3.id.toString(),
1615
+ targetAsset: tokenAddresses.LINK[mainnet3.id],
1616
+ targetAssetTicker: LINK_SPOT_SYMBOL,
1617
+ iconSrc: ASSET_LOGO_SRCS.LINK,
1618
+ generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1619
+ if (!outputConfig) {
1620
+ return [];
1621
+ }
1622
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1623
+ return [];
1624
+ }
1625
+ return generateLighterMainnetDepositActions({
1626
+ address,
1627
+ assetIndex: 5 /* LINK */,
1628
+ routeType: 1 /* Spot */
1629
+ });
1630
+ }
1631
+ });
1632
+ var LIGHTER_SKY_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1633
+ targetChain: mainnet3.id.toString(),
1634
+ targetAsset: tokenAddresses.SKY[mainnet3.id],
1635
+ targetAssetTicker: SKY_SPOT_SYMBOL,
1636
+ iconSrc: ASSET_LOGO_SRCS.SKY,
1637
+ generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1638
+ if (!outputConfig) {
1639
+ return [];
1640
+ }
1641
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1642
+ return [];
1643
+ }
1644
+ return generateLighterMainnetDepositActions({
1645
+ address,
1646
+ assetIndex: 8 /* SKY */,
1647
+ routeType: 1 /* Spot */
1648
+ });
1649
+ }
1650
+ });
1651
+ var LIGHTER_UNI_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1652
+ targetChain: mainnet3.id.toString(),
1653
+ targetAsset: tokenAddresses.UNI[mainnet3.id],
1654
+ targetAssetTicker: UNI_SPOT_SYMBOL,
1655
+ iconSrc: ASSET_LOGO_SRCS.UNI,
1656
+ generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1657
+ if (!outputConfig) {
1658
+ return [];
1659
+ }
1660
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1661
+ return [];
1662
+ }
1663
+ return generateLighterMainnetDepositActions({
1664
+ address,
1665
+ assetIndex: 6 /* UNI */,
1666
+ routeType: 1 /* Spot */
1667
+ });
1668
+ }
1669
+ });
1670
+ var LIGHTER_AAVE_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1671
+ targetChain: mainnet3.id.toString(),
1672
+ targetAsset: tokenAddresses.AAVE[mainnet3.id],
1673
+ targetAssetTicker: AAVE_SPOT_SYMBOL,
1674
+ iconSrc: ASSET_LOGO_SRCS.AAVE,
1675
+ generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1676
+ if (!outputConfig) {
1677
+ return [];
1678
+ }
1679
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1680
+ return [];
1681
+ }
1682
+ return generateLighterMainnetDepositActions({
1683
+ address,
1684
+ assetIndex: 7 /* AAVE */,
1685
+ routeType: 1 /* Spot */
1686
+ });
1687
+ }
1688
+ });
1689
+ var LIGHTER_LDO_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1690
+ targetChain: mainnet3.id.toString(),
1691
+ targetAsset: tokenAddresses.LDO[mainnet3.id],
1692
+ targetAssetTicker: LDO_SPOT_SYMBOL,
1693
+ iconSrc: ASSET_LOGO_SRCS.LDO,
1694
+ generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1695
+ if (!outputConfig) {
1696
+ return [];
1697
+ }
1698
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1699
+ return [];
1700
+ }
1701
+ return generateLighterMainnetDepositActions({
1702
+ address,
1703
+ assetIndex: 9 /* LDO */,
1704
+ routeType: 1 /* Spot */
1705
+ });
1706
+ }
1707
+ });
1603
1708
  var LIGHTER_DYNAMIC_ROUTES = [
1604
1709
  createRoute({
1605
1710
  id: "LIGHTER_ETH_SPOT",
@@ -1642,6 +1747,37 @@ var LIGHTER_DYNAMIC_ROUTES = [
1642
1747
  paths: {
1643
1748
  FUN_MAINNET_DEPOSIT: LIGHTER_ETH_SPOT_FUN_MAINNET_DEPOSIT
1644
1749
  }
1750
+ }),
1751
+ // LINK, UNI, AAVE, SKY, LDO tokens
1752
+ createRoute({
1753
+ id: "LIGHTER_LINK_SPOT_NEW_USER",
1754
+ paths: {
1755
+ FUN_MAINNET_DEPOSIT: LIGHTER_LINK_SPOT_FUN_MAINNET_DEPOSIT
1756
+ }
1757
+ }),
1758
+ createRoute({
1759
+ id: "LIGHTER_SKY_SPOT_NEW_USER",
1760
+ paths: {
1761
+ FUN_MAINNET_DEPOSIT: LIGHTER_SKY_SPOT_FUN_MAINNET_DEPOSIT
1762
+ }
1763
+ }),
1764
+ createRoute({
1765
+ id: "LIGHTER_UNI_SPOT_NEW_USER",
1766
+ paths: {
1767
+ FUN_MAINNET_DEPOSIT: LIGHTER_UNI_SPOT_FUN_MAINNET_DEPOSIT
1768
+ }
1769
+ }),
1770
+ createRoute({
1771
+ id: "LIGHTER_AAVE_SPOT_NEW_USER",
1772
+ paths: {
1773
+ FUN_MAINNET_DEPOSIT: LIGHTER_AAVE_SPOT_FUN_MAINNET_DEPOSIT
1774
+ }
1775
+ }),
1776
+ createRoute({
1777
+ id: "LIGHTER_LDO_SPOT_NEW_USER",
1778
+ paths: {
1779
+ FUN_MAINNET_DEPOSIT: LIGHTER_LDO_SPOT_FUN_MAINNET_DEPOSIT
1780
+ }
1645
1781
  })
1646
1782
  ];
1647
1783
 
@@ -1679,6 +1815,7 @@ export {
1679
1815
  initDynamicRouting,
1680
1816
  initializeRelayClient,
1681
1817
  isRelayExecutionTerminalStatus,
1682
- parseRelayFees
1818
+ parseRelayFees,
1819
+ shouldResetApproval
1683
1820
  };
1684
1821
  //# sourceMappingURL=index.mjs.map