@funkit/fun-relay 2.3.0 → 2.4.1-next.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
@@ -576,7 +576,7 @@ async function getRelayQuote({
576
576
  const relayClient = getRelayClient();
577
577
  const isSameChainFlow = String(fromChainId) === String(toChainId);
578
578
  const txs = actionParams?.map((action) => {
579
- const data = encodeFunctionData({
579
+ const data = action.rawCalldata ?? encodeFunctionData({
580
580
  abi: action.contractAbi,
581
581
  args: action.functionArgs,
582
582
  functionName: action.functionName
@@ -874,7 +874,8 @@ var ASSET_LOGO_SRCS = {
874
874
  AUSD: "https://sdk-cdn.fun.xyz/images/ausd.svg",
875
875
  SUSHI: "https://sdk-cdn.fun.xyz/images/sushi.svg",
876
876
  SKY: "https://sdk-cdn.fun.xyz/images/sky.svg",
877
- LIT: "https://sdk-cdn.fun.xyz/images/lit.svg"
877
+ LIT: "https://sdk-cdn.fun.xyz/images/lit.svg",
878
+ AZTEC: "https://sdk-cdn.fun.xyz/images/aztec.svg"
878
879
  };
879
880
  var FALLBACK_ASSET = "https://sdk-cdn.fun.xyz/images/dollar_circle.png";
880
881
  function getAssetLogoSrc(symbol) {
@@ -1332,6 +1333,9 @@ var tokenAddresses = {
1332
1333
  },
1333
1334
  LDO: {
1334
1335
  [mainnet.id]: getAddress("0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32")
1336
+ },
1337
+ AZTEC: {
1338
+ [mainnet.id]: getAddress("0xA27EC0006e59f245217Ff08CD52A7E8b169E62D2")
1335
1339
  }
1336
1340
  };
1337
1341
  var UNWRAP_AND_CALL_ADDRESS = {
@@ -1473,7 +1477,8 @@ var TICK_SIZE_FOR_ASSET_INDEX = {
1473
1477
  [6 /* UNI */]: BigInt(10 ** 10),
1474
1478
  [7 /* AAVE */]: BigInt(10 ** 10),
1475
1479
  [8 /* SKY */]: BigInt(10 ** 10),
1476
- [9 /* LDO */]: BigInt(10 ** 10)
1480
+ [9 /* LDO */]: BigInt(10 ** 10),
1481
+ [10 /* AZTEC */]: BigInt(10 ** 10)
1477
1482
  };
1478
1483
  var DEPOSIT_TOKEN_FOR_ASSET_INDEX = {
1479
1484
  [3 /* USDC */]: tokenAddresses.USDC[mainnet3.id],
@@ -1483,7 +1488,8 @@ var DEPOSIT_TOKEN_FOR_ASSET_INDEX = {
1483
1488
  [6 /* UNI */]: tokenAddresses.UNI[mainnet3.id],
1484
1489
  [7 /* AAVE */]: tokenAddresses.AAVE[mainnet3.id],
1485
1490
  [8 /* SKY */]: tokenAddresses.SKY[mainnet3.id],
1486
- [9 /* LDO */]: tokenAddresses.LDO[mainnet3.id]
1491
+ [9 /* LDO */]: tokenAddresses.LDO[mainnet3.id],
1492
+ [10 /* AZTEC */]: tokenAddresses.AZTEC[mainnet3.id]
1487
1493
  };
1488
1494
  var USDC_PERPS_SYMBOL = "USDC (Perps)";
1489
1495
  var ETH_SPOT_SYMBOL = "ETH (Spot)";
@@ -1493,6 +1499,7 @@ var AAVE_SPOT_SYMBOL = "AAVE (Spot)";
1493
1499
  var SKY_SPOT_SYMBOL = "SKY (Spot)";
1494
1500
  var LDO_SPOT_SYMBOL = "LDO (Spot)";
1495
1501
  var LIT_SPOT_SYMBOL = "LIT (Spot)";
1502
+ var AZTEC_SPOT_SYMBOL = "AZTEC (Spot)";
1496
1503
  var generateLighterMainnetDepositActions = ({
1497
1504
  address,
1498
1505
  assetIndex,
@@ -1743,6 +1750,25 @@ var LIGHTER_LDO_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1743
1750
  });
1744
1751
  }
1745
1752
  });
1753
+ var LIGHTER_AZTEC_SPOT_FUN_MAINNET_DEPOSIT = createPath({
1754
+ targetChain: mainnet3.id.toString(),
1755
+ targetAsset: tokenAddresses.AZTEC[mainnet3.id],
1756
+ targetAssetTicker: AZTEC_SPOT_SYMBOL,
1757
+ iconSrc: ASSET_LOGO_SRCS.AZTEC,
1758
+ generateActionsParams: (address) => async (_finalTargetAssetAmount, outputConfig) => {
1759
+ if (!outputConfig) {
1760
+ return [];
1761
+ }
1762
+ if (outputConfig.targetChain !== mainnet3.id.toString()) {
1763
+ return [];
1764
+ }
1765
+ return generateLighterMainnetDepositActions({
1766
+ address,
1767
+ assetIndex: 10 /* AZTEC */,
1768
+ routeType: 1 /* Spot */
1769
+ });
1770
+ }
1771
+ });
1746
1772
  var LIGHTER_DYNAMIC_ROUTES = [
1747
1773
  createRoute({
1748
1774
  id: "LIGHTER_ETH_SPOT",
@@ -1822,6 +1848,12 @@ var LIGHTER_DYNAMIC_ROUTES = [
1822
1848
  paths: {
1823
1849
  FUN_MAINNET_DEPOSIT: LIGHTER_LDO_SPOT_FUN_MAINNET_DEPOSIT
1824
1850
  }
1851
+ }),
1852
+ createRoute({
1853
+ id: "LIGHTER_AZTEC_SPOT_NEW_USER",
1854
+ paths: {
1855
+ FUN_MAINNET_DEPOSIT: LIGHTER_AZTEC_SPOT_FUN_MAINNET_DEPOSIT
1856
+ }
1825
1857
  })
1826
1858
  ];
1827
1859
 
@@ -1836,6 +1868,7 @@ export {
1836
1868
  LogLevel,
1837
1869
  RELAY_BITCOIN_CHAIN_ID,
1838
1870
  RELAY_BITCOIN_CHAIN_ID_NUMBER,
1871
+ RELAY_LIGHTER_CHAIN_ID,
1839
1872
  RELAY_NATIVE_TOKEN,
1840
1873
  RELAY_NATIVE_TOKEN_BITCOIN,
1841
1874
  RELAY_NATIVE_TOKEN_HYPERCORE,