@shapeshiftoss/swapper 17.7.1 → 17.7.2

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 (130) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/index.d.ts +1 -0
  3. package/dist/cjs/index.js +18 -7
  4. package/dist/cjs/swappers/AcrossSwapper/utils/acrossService.d.ts +3 -3
  5. package/dist/cjs/swappers/AcrossSwapper/utils/getTrade.js +1 -2
  6. package/dist/cjs/swappers/ArbitrumBridgeSwapper/endpoints.d.ts +3 -3
  7. package/dist/cjs/swappers/ArbitrumBridgeSwapper/getTradeQuote/getTradeQuote.js +2 -2
  8. package/dist/cjs/swappers/ArbitrumBridgeSwapper/getTradeRate/getTradeRate.js +1 -2
  9. package/dist/cjs/swappers/ArbitrumBridgeSwapper/utils/fetchArbitrumBridgeSwap.d.ts +2 -2
  10. package/dist/cjs/swappers/AvnuSwapper/endpoints.js +2 -2
  11. package/dist/cjs/swappers/AvnuSwapper/utils/constants.d.ts +1 -1
  12. package/dist/cjs/swappers/BebopSwapper/getBebopSolanaTradeQuote/getBebopSolanaTradeQuote.js +1 -2
  13. package/dist/cjs/swappers/BebopSwapper/getBebopSolanaTradeRate/getBebopSolanaTradeRate.js +1 -2
  14. package/dist/cjs/swappers/BebopSwapper/getBebopTradeQuote/getBebopTradeQuote.js +2 -3
  15. package/dist/cjs/swappers/BebopSwapper/getBebopTradeRate/getBebopTradeRate.js +2 -3
  16. package/dist/cjs/swappers/BebopSwapper/types.d.ts +1 -1
  17. package/dist/cjs/swappers/BebopSwapper/utils/bebopService.d.ts +1 -1
  18. package/dist/cjs/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +4 -4
  19. package/dist/cjs/swappers/BebopSwapper/utils/helpers/helpers.d.ts +2 -1
  20. package/dist/cjs/swappers/ButterSwap/swapperApi/checkTradeStatus.test.js +19 -9
  21. package/dist/cjs/swappers/ButterSwap/swapperApi/getTradeQuote.js +1 -1
  22. package/dist/cjs/swappers/ButterSwap/test-data/routeQuote.js +4 -4
  23. package/dist/cjs/swappers/ButterSwap/utils/butterSwapHistoryService.d.ts +3 -3
  24. package/dist/cjs/swappers/ButterSwap/utils/butterSwapService.d.ts +3 -3
  25. package/dist/cjs/swappers/ButterSwap/xhr.js +4 -4
  26. package/dist/cjs/swappers/CetusSwapper/utils/constants.d.ts +1 -1
  27. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteBoostQuote.js +4 -5
  28. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteEstimatedDurationsSeconds.js +4 -5
  29. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteQuote.js +5 -5
  30. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasQuoteQuoteFee.js +5 -5
  31. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusChunkInfo.js +4 -5
  32. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusDca.js +4 -5
  33. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusEgress.js +4 -5
  34. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasStatusSwap.js +4 -5
  35. package/dist/cjs/swappers/ChainflipSwapper/models/ChainflipBaasSwapDepositAddress.js +4 -5
  36. package/dist/cjs/swappers/ChainflipSwapper/utils/chainflipService.d.ts +3 -3
  37. package/dist/cjs/swappers/ChainflipSwapper/utils/getQuoteOrRate.js +2 -2
  38. package/dist/cjs/swappers/ChainflipSwapper/utils/getUtxoTxFees.d.ts +1 -1
  39. package/dist/cjs/swappers/ChainflipSwapper/utils/helpers.d.ts +3 -2
  40. package/dist/cjs/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.js +2 -3
  41. package/dist/cjs/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.test.js +8 -8
  42. package/dist/cjs/swappers/CowSwapper/getCowSwapTradeRate/getCowSwapTradeRate.js +2 -3
  43. package/dist/cjs/swappers/CowSwapper/utils/cowService.d.ts +3 -3
  44. package/dist/cjs/swappers/DebridgeSwapper/utils/debridgeService.d.ts +3 -3
  45. package/dist/cjs/swappers/DebridgeSwapper/utils/getTrade.js +1 -2
  46. package/dist/cjs/swappers/NearIntentsSwapper/utils/helpers/helpers.d.ts +2 -2
  47. package/dist/cjs/swappers/PortalsSwapper/getPortalsTradeQuote/getPortalsTradeQuote.js +1 -2
  48. package/dist/cjs/swappers/PortalsSwapper/getPortalsTradeRate/getPortalsTradeRate.js +3 -4
  49. package/dist/cjs/swappers/PortalsSwapper/utils/helpers.d.ts +1 -1
  50. package/dist/cjs/swappers/RelaySwapper/constant.d.ts +39 -1
  51. package/dist/cjs/swappers/RelaySwapper/utils/fetchRelayTrade.d.ts +1 -1
  52. package/dist/cjs/swappers/RelaySwapper/utils/getRelayPsbtRelayer.js +17 -7
  53. package/dist/cjs/swappers/RelaySwapper/utils/getTrade.js +1 -2
  54. package/dist/cjs/swappers/RelaySwapper/utils/relayService.d.ts +3 -3
  55. package/dist/cjs/swappers/SunioSwapper/utils/getQuoteOrRate.js +1 -2
  56. package/dist/cjs/swappers/SunioSwapper/utils/helpers/helpers.d.ts +2 -1
  57. package/dist/cjs/swappers/SunioSwapper/utils/sunioService.d.ts +3 -3
  58. package/dist/cjs/swappers/ThorchainSwapper/utils/getL1ToLongtailQuote.js +18 -8
  59. package/dist/cjs/swappers/ThorchainSwapper/utils/getL1ToLongtailRate.js +18 -8
  60. package/dist/cjs/swappers/ThorchainSwapper/utils/getLongtailQuote.js +1 -1
  61. package/dist/cjs/swappers/ThorchainSwapper/utils/getLongtailRate.js +1 -1
  62. package/dist/cjs/swappers/ThorchainSwapper/utils/longTailHelpers.js +2 -2
  63. package/dist/cjs/swappers/ZrxSwapper/getZrxTradeQuote/getZrxTradeQuote.js +1 -2
  64. package/dist/cjs/swappers/ZrxSwapper/getZrxTradeQuote/getZrxTradeQuote.test.js +17 -7
  65. package/dist/cjs/swappers/ZrxSwapper/getZrxTradeRate/getZrxTradeRate.js +1 -2
  66. package/dist/cjs/swappers/ZrxSwapper/utils/fetchFromZrx.js +2 -2
  67. package/dist/cjs/swappers/ZrxSwapper/utils/helpers/helpers.d.ts +2 -3
  68. package/dist/cjs/swappers/ZrxSwapper/utils/zrxService.d.ts +1 -1
  69. package/dist/cjs/swappers/utils/test-data/cryptoMarketDataById.d.ts +35 -1
  70. package/dist/cjs/thorchain-utils/getCallDataFromQuote.d.ts +1 -1
  71. package/dist/cjs/thorchain-utils/getL1RateOrQuote.js +21 -11
  72. package/dist/cjs/thorchain-utils/index.js +17 -7
  73. package/dist/cjs/thorchain-utils/parseBuyTxHash.d.ts +1 -1
  74. package/dist/cjs/thorchain-utils/service.d.ts +3 -3
  75. package/dist/cjs/tron-utils/getTronTransactionFees.d.ts +1 -1
  76. package/dist/cjs/utils/tenderly/storageSlots.js +20 -20
  77. package/dist/cjs/utils.d.ts +4 -4
  78. package/dist/esm/.tsbuildinfo +1 -1
  79. package/dist/esm/index.d.ts +1 -0
  80. package/dist/esm/index.js +1 -0
  81. package/dist/esm/swappers/AcrossSwapper/utils/acrossService.d.ts +3 -3
  82. package/dist/esm/swappers/ArbitrumBridgeSwapper/endpoints.d.ts +3 -3
  83. package/dist/esm/swappers/ArbitrumBridgeSwapper/utils/fetchArbitrumBridgeSwap.d.ts +2 -2
  84. package/dist/esm/swappers/AvnuSwapper/endpoints.js +2 -2
  85. package/dist/esm/swappers/AvnuSwapper/utils/constants.d.ts +1 -1
  86. package/dist/esm/swappers/BebopSwapper/getBebopTradeQuote/getBebopTradeQuote.js +1 -1
  87. package/dist/esm/swappers/BebopSwapper/getBebopTradeRate/getBebopTradeRate.js +1 -1
  88. package/dist/esm/swappers/BebopSwapper/types.d.ts +1 -1
  89. package/dist/esm/swappers/BebopSwapper/utils/bebopService.d.ts +1 -1
  90. package/dist/esm/swappers/BebopSwapper/utils/fetchFromBebop.d.ts +4 -4
  91. package/dist/esm/swappers/BebopSwapper/utils/helpers/helpers.d.ts +2 -1
  92. package/dist/esm/swappers/ButterSwap/swapperApi/checkTradeStatus.test.js +2 -2
  93. package/dist/esm/swappers/ButterSwap/swapperApi/getTradeQuote.js +1 -1
  94. package/dist/esm/swappers/ButterSwap/test-data/routeQuote.js +4 -4
  95. package/dist/esm/swappers/ButterSwap/utils/butterSwapHistoryService.d.ts +3 -3
  96. package/dist/esm/swappers/ButterSwap/utils/butterSwapService.d.ts +3 -3
  97. package/dist/esm/swappers/CetusSwapper/utils/constants.d.ts +1 -1
  98. package/dist/esm/swappers/ChainflipSwapper/utils/chainflipService.d.ts +3 -3
  99. package/dist/esm/swappers/ChainflipSwapper/utils/getQuoteOrRate.js +2 -2
  100. package/dist/esm/swappers/ChainflipSwapper/utils/getUtxoTxFees.d.ts +1 -1
  101. package/dist/esm/swappers/ChainflipSwapper/utils/helpers.d.ts +3 -2
  102. package/dist/esm/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.js +1 -1
  103. package/dist/esm/swappers/CowSwapper/getCowSwapTradeQuote/getCowSwapTradeQuote.test.js +8 -8
  104. package/dist/esm/swappers/CowSwapper/getCowSwapTradeRate/getCowSwapTradeRate.js +1 -1
  105. package/dist/esm/swappers/CowSwapper/utils/cowService.d.ts +3 -3
  106. package/dist/esm/swappers/DebridgeSwapper/utils/debridgeService.d.ts +3 -3
  107. package/dist/esm/swappers/NearIntentsSwapper/utils/helpers/helpers.d.ts +2 -2
  108. package/dist/esm/swappers/PortalsSwapper/getPortalsTradeRate/getPortalsTradeRate.js +2 -2
  109. package/dist/esm/swappers/PortalsSwapper/utils/helpers.d.ts +1 -1
  110. package/dist/esm/swappers/RelaySwapper/constant.d.ts +39 -1
  111. package/dist/esm/swappers/RelaySwapper/utils/fetchRelayTrade.d.ts +1 -1
  112. package/dist/esm/swappers/RelaySwapper/utils/relayService.d.ts +3 -3
  113. package/dist/esm/swappers/SunioSwapper/utils/helpers/helpers.d.ts +2 -1
  114. package/dist/esm/swappers/SunioSwapper/utils/sunioService.d.ts +3 -3
  115. package/dist/esm/swappers/ThorchainSwapper/utils/getL1ToLongtailQuote.js +1 -1
  116. package/dist/esm/swappers/ThorchainSwapper/utils/getL1ToLongtailRate.js +1 -1
  117. package/dist/esm/swappers/ThorchainSwapper/utils/getLongtailQuote.js +1 -1
  118. package/dist/esm/swappers/ThorchainSwapper/utils/getLongtailRate.js +1 -1
  119. package/dist/esm/swappers/ZrxSwapper/utils/fetchFromZrx.js +2 -2
  120. package/dist/esm/swappers/ZrxSwapper/utils/helpers/helpers.d.ts +2 -3
  121. package/dist/esm/swappers/ZrxSwapper/utils/zrxService.d.ts +1 -1
  122. package/dist/esm/swappers/utils/test-data/cryptoMarketDataById.d.ts +35 -1
  123. package/dist/esm/thorchain-utils/getCallDataFromQuote.d.ts +1 -1
  124. package/dist/esm/thorchain-utils/getL1RateOrQuote.js +4 -4
  125. package/dist/esm/thorchain-utils/parseBuyTxHash.d.ts +1 -1
  126. package/dist/esm/thorchain-utils/service.d.ts +3 -3
  127. package/dist/esm/tron-utils/getTronTransactionFees.d.ts +1 -1
  128. package/dist/esm/utils/tenderly/storageSlots.js +20 -20
  129. package/dist/esm/utils.d.ts +4 -4
  130. package/package.json +3 -3
@@ -24,9 +24,9 @@ const fetchFromZrx = async ({ quoteOrRate, buyAsset, sellAsset, sellAmountInclud
24
24
  sellAmount: sellAmountIncludingProtocolFeesCryptoBaseUnit,
25
25
  taker: sellAddress,
26
26
  swapFeeBps: bn(affiliateBps).toNumber(),
27
- swapFeeToken: assetIdToZrxToken(buyAsset.assetId),
27
+ swapFeeToken: assetIdToZrxToken(buyAsset.assetId), // must be set to the buy asset to simplify fee calcs
28
28
  slippageBps: convertDecimalPercentageToBasisPoints(slippageTolerancePercentageDecimal).toNumber(),
29
- swapFeeRecipient: maybeTreasuryAddress,
29
+ swapFeeRecipient: maybeTreasuryAddress, // Where affiliate fees are sent
30
30
  feeRecipientTradeSurplus: maybeTreasuryAddress, // Where trade surplus is sent
31
31
  },
32
32
  });
@@ -1,10 +1,9 @@
1
1
  import type { AssetId, ChainId } from '@shapeshiftoss/caip';
2
2
  import type { Asset, AssetsByIdPartial } from '@shapeshiftoss/types';
3
- import { KnownChainIds } from '@shapeshiftoss/types';
4
- import type { ZrxFees } from '../../types.js';
3
+ import type { ZrxFees, ZrxSupportedChainId } from '../../types.js';
5
4
  export declare const assetIdToZrxToken: (assetId: AssetId) => string;
6
5
  export declare const zrxTokenToAssetId: (token: string, chainId: ChainId) => AssetId;
7
- export declare const isSupportedChainId: (chainId: ChainId) => chainId is KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet;
6
+ export declare const isSupportedChainId: (chainId: ChainId) => chainId is ZrxSupportedChainId;
8
7
  export declare const assertValidTrade: ({ buyAsset, sellAsset, }: {
9
8
  buyAsset: Asset;
10
9
  sellAsset: Asset;
@@ -4,6 +4,6 @@ import type { MonadicSwapperAxiosService } from '../../../types.js';
4
4
  type AxiosInstanceHoF = (instance: AxiosInstance, options?: Omit<RetryConfig, 'instance'>) => AxiosInstance;
5
5
  export declare const zrxServiceFactory: ({ baseUrl, wrapper, }: {
6
6
  baseUrl: string;
7
- wrapper?: AxiosInstanceHoF | undefined;
7
+ wrapper?: AxiosInstanceHoF;
8
8
  }) => MonadicSwapperAxiosService;
9
9
  export {};
@@ -1,5 +1,39 @@
1
+ import { AVAX, BSC, BTC, ETH, FOX_GNOSIS, FOX_MAINNET, OPTIMISM, RUNE, USDC_GNOSIS, USDC_MAINNET, WBTC, WETH } from './assets.js';
1
2
  export declare const marketDataByAssetIdUsd: {
2
- [x: string]: {
3
+ [FOX_MAINNET.assetId]: {
4
+ price: string;
5
+ };
6
+ [FOX_GNOSIS.assetId]: {
7
+ price: string;
8
+ };
9
+ [ETH.assetId]: {
10
+ price: string;
11
+ };
12
+ [AVAX.assetId]: {
13
+ price: string;
14
+ };
15
+ [BSC.assetId]: {
16
+ price: string;
17
+ };
18
+ [BTC.assetId]: {
19
+ price: string;
20
+ };
21
+ [RUNE.assetId]: {
22
+ price: string;
23
+ };
24
+ [OPTIMISM.assetId]: {
25
+ price: string;
26
+ };
27
+ [USDC_MAINNET.assetId]: {
28
+ price: string;
29
+ };
30
+ [USDC_GNOSIS.assetId]: {
31
+ price: string;
32
+ };
33
+ [WBTC.assetId]: {
34
+ price: string;
35
+ };
36
+ [WETH.assetId]: {
3
37
  price: string;
4
38
  };
5
39
  };
@@ -1,7 +1,7 @@
1
1
  import type { Asset } from '@shapeshiftoss/types';
2
2
  import type { SwapperConfig, SwapperName } from '../types.js';
3
3
  import type { ThorEvmTradeQuote } from './types.js';
4
- export declare const getCallDataFromQuote: ({ tradeType, data, sellAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit, memo: tcMemo, expiry, config, longtailData, slippageTolerancePercentageDecimal, vault, swapperName, }: Pick<ThorEvmTradeQuote, "data" | "slippageTolerancePercentageDecimal" | "memo" | "expiry" | "tradeType" | "aggregator" | "vault" | "longtailData"> & {
4
+ export declare const getCallDataFromQuote: ({ tradeType, data, sellAsset, sellAmountIncludingProtocolFeesCryptoBaseUnit, memo: tcMemo, expiry, config, longtailData, slippageTolerancePercentageDecimal, vault, swapperName, }: Pick<ThorEvmTradeQuote, "vault" | "aggregator" | "data" | "memo" | "tradeType" | "expiry" | "longtailData" | "slippageTolerancePercentageDecimal"> & {
5
5
  sellAmountIncludingProtocolFeesCryptoBaseUnit: string;
6
6
  config: SwapperConfig;
7
7
  sellAsset: Asset;
@@ -258,7 +258,7 @@ export const getL1RateOrQuote = async (input, deps, streamingInterval, tradeType
258
258
  })();
259
259
  return makeThorTradeRateOrQuote({
260
260
  route,
261
- allowanceContract: '0x0',
261
+ allowanceContract: '0x0', // not applicable to UTXOs
262
262
  memo,
263
263
  feeData,
264
264
  });
@@ -279,7 +279,7 @@ export const getL1RateOrQuote = async (input, deps, streamingInterval, tradeType
279
279
  return makeThorTradeRateOrQuote({
280
280
  route,
281
281
  memo: getMemo(route),
282
- allowanceContract: '0x0',
282
+ allowanceContract: '0x0', // not applicable to cosmossdk
283
283
  feeData: {
284
284
  networkFeeCryptoBaseUnit: fast.txFee,
285
285
  protocolFees: getProtocolFees(route.quote),
@@ -364,7 +364,7 @@ export const getL1RateOrQuote = async (input, deps, streamingInterval, tradeType
364
364
  // TRC20: Estimate energy with actual recipient
365
365
  try {
366
366
  const result = await tronWeb.transactionBuilder.triggerConstantContract(contractAddress, 'transfer(address,uint256)', {}, [
367
- { type: 'address', value: vault },
367
+ { type: 'address', value: vault }, // Use vault as recipient
368
368
  {
369
369
  type: 'uint256',
370
370
  value: sellAmountIncludingProtocolFeesCryptoBaseUnit,
@@ -398,7 +398,7 @@ export const getL1RateOrQuote = async (input, deps, streamingInterval, tradeType
398
398
  // For quotes, fees will be calculated in getTronTransactionFees when executing
399
399
  return Promise.resolve(makeThorTradeRateOrQuote({
400
400
  route,
401
- allowanceContract: '0x0',
401
+ allowanceContract: '0x0', // not applicable to TRON
402
402
  memo,
403
403
  feeData: {
404
404
  networkFeeCryptoBaseUnit,
@@ -1,2 +1,2 @@
1
1
  import type { ThorNodeTxSchema } from './types.js';
2
- export declare const parseThorBuyTxHash: (sellTxId: string, latestOutTx: ThorNodeTxSchema | undefined, nativeChain: 'THOR' | 'MAYA') => string | undefined;
2
+ export declare const parseThorBuyTxHash: (sellTxId: string, latestOutTx: ThorNodeTxSchema | undefined, nativeChain: "THOR" | "MAYA") => string | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare const thorService: {
2
- get: <T = any>(url: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T, any, {}>, import("../index.js").SwapErrorRight>>;
3
- post: <T_1 = any>(url: string, data: any, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_1, any, {}>, import("../index.js").SwapErrorRight>>;
4
- delete: <T_2 = any>(url: string, data: any, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T_2, any, {}>, import("../index.js").SwapErrorRight>>;
2
+ get: <T = any>(url: string, config?: import("axios").AxiosRequestConfig<any>) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T>, import("../index.js").SwapErrorRight>>;
3
+ post: <T = any>(url: string, data: any, config?: import("axios").AxiosRequestConfig<any>) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T>, import("../index.js").SwapErrorRight>>;
4
+ delete: <T = any>(url: string, data: any, config?: import("axios").AxiosRequestConfig<any>) => Promise<import("@sniptt/monads").Result<import("axios").AxiosResponse<T>, import("../index.js").SwapErrorRight>>;
5
5
  };
@@ -1,2 +1,2 @@
1
1
  import type { GetUnsignedTronTransactionArgs } from '../types.js';
2
- export declare const getTronTransactionFees: ({ tradeQuote, stepIndex, }: Pick<GetUnsignedTronTransactionArgs, 'tradeQuote' | 'stepIndex'>) => Promise<string>;
2
+ export declare const getTronTransactionFees: ({ tradeQuote, stepIndex, }: Pick<GetUnsignedTronTransactionArgs, "tradeQuote" | "stepIndex">) => Promise<string>;
@@ -23,39 +23,39 @@ export const getAllowanceStorageSlot = (ownerAddress, spenderAddress, allowanceS
23
23
  // USDC (BEP20 - BSC): balance at slot 1, allowance at slot 2
24
24
  export const KNOWN_BALANCE_SLOTS = {
25
25
  // USDT - Native Tether deployment (custom slot 2)
26
- '0xdac17f958d2ee523a2206206994597c13d831ec7': 2,
26
+ '0xdac17f958d2ee523a2206206994597c13d831ec7': 2, // USDT Ethereum
27
27
  // Slot 51 pattern (L2GatewayToken + ERC20Upgradeable + storage gaps)
28
28
  // Various L2 tokens use this pattern with different implementations
29
- '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9': 51,
30
- '0x912ce59144191c1204e64559fe8253a0e49e6548': 51,
31
- '0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7': 51,
32
- '0x01bff41798a0bcf287b996046ca68b395dbc1071': 51,
29
+ '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9': 51, // USDT Arbitrum (StandardArbERC20)
30
+ '0x912ce59144191c1204e64559fe8253a0e49e6548': 51, // ARB Arbitrum (StandardArbERC20)
31
+ '0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7': 51, // USDT Avalanche (TransparentProxy)
32
+ '0x01bff41798a0bcf287b996046ca68b395dbc1071': 51, // USDT0 Optimism (LayerZero OFT - https://docs.usdt0.to)
33
33
  // Wormhole bridge pattern (slot 5)
34
- '0xca7dec8550f43a5e46e3dfb95801f64280e75b27': 5,
34
+ '0xca7dec8550f43a5e46e3dfb95801f64280e75b27': 5, // SWEAT Arbitrum (Wormhole bridge)
35
35
  // USDT - BEP20 pattern (slot 1 - Binance-Peg token)
36
- '0x55d398326f99059ff775485246999027b3197955': 1,
36
+ '0x55d398326f99059ff775485246999027b3197955': 1, // USDT BSC (confirmed)
37
37
  // USDT - xDai bridge pattern (slot 3)
38
- '0x4ecaba5870353805a9f068101a40e0f32ed605c6': 3,
38
+ '0x4ecaba5870353805a9f068101a40e0f32ed605c6': 3, // USDT Gnosis (confirmed)
39
39
  // USDT - Standard ERC20 deployments (slot 0)
40
40
  // Polygon confirmed, Optimism bridged USDT (0x94b008aa...) also uses slot 0
41
41
  // USDC (Circle native deployments - all use slot 9)
42
- '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': 9,
43
- '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e': 9,
44
- '0x0b2c639c533813f4aa9d7837caf62653d097ff85': 9,
45
- '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359': 9,
46
- '0xaf88d065e77c8cc2239327c5edb3a432268e5831': 9,
47
- '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913': 9,
42
+ '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': 9, // USDC Ethereum
43
+ '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e': 9, // USDC Avalanche
44
+ '0x0b2c639c533813f4aa9d7837caf62653d097ff85': 9, // USDC Optimism
45
+ '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359': 9, // USDC Polygon
46
+ '0xaf88d065e77c8cc2239327c5edb3a432268e5831': 9, // USDC Arbitrum
47
+ '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913': 9, // USDC Base
48
48
  // USDC (BEP20 pattern on BSC - slot 1)
49
49
  '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d': 1, // USDC BSC (BEP20)
50
50
  };
51
51
  export const KNOWN_ALLOWANCE_SLOTS = {
52
52
  // USDT allowance slots (explicit mapping for all non-standard implementations)
53
- '0xdac17f958d2ee523a2206206994597c13d831ec7': 5,
54
- '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9': 52,
55
- '0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7': 52,
56
- '0x01bff41798a0bcf287b996046ca68b395dbc1071': 52,
57
- '0x55d398326f99059ff775485246999027b3197955': 2,
58
- '0x4ecaba5870353805a9f068101a40e0f32ed605c6': 4,
53
+ '0xdac17f958d2ee523a2206206994597c13d831ec7': 5, // USDT Ethereum (native Tether)
54
+ '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9': 52, // USDT Arbitrum (StandardArbERC20)
55
+ '0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7': 52, // USDT Avalanche (StandardArbERC20)
56
+ '0x01bff41798a0bcf287b996046ca68b395dbc1071': 52, // USDT0 Optimism (LayerZero OFT)
57
+ '0x55d398326f99059ff775485246999027b3197955': 2, // USDT BSC (BEP20)
58
+ '0x4ecaba5870353805a9f068101a40e0f32ed605c6': 4, // USDT Gnosis (xDai bridge)
59
59
  // Note: Polygon and Optimism standard bridged USDT (0x94b008aa...) use slot 1 (fallback)
60
60
  // Note: SWEAT (slot 5) allowance auto-inferred to slot 6 via Wormhole pattern
61
61
  // USDC allowance slots (BSC uses BEP20 pattern, not Circle FiatToken)
@@ -12,7 +12,7 @@ export declare const makeSwapErrorRight: ({ details, cause, code, message, }: {
12
12
  message: string;
13
13
  details?: unknown;
14
14
  cause?: unknown;
15
- code?: TradeQuoteError | undefined;
15
+ code?: TradeQuoteError;
16
16
  }) => SwapErrorRight;
17
17
  export declare const createTradeAmountTooSmallErr: (details?: {
18
18
  minAmountCryptoBaseUnit: string;
@@ -21,9 +21,9 @@ export declare const createTradeAmountTooSmallErr: (details?: {
21
21
  export declare const createCache: (maxAge: number, cachedUrls: string[], axiosConfig: AxiosRequestConfig) => AxiosInstance;
22
22
  export declare const AsyncResultOf: <T>(promise: Promise<T>) => Promise<Result<T, Error>>;
23
23
  export declare const makeSwapperAxiosServiceMonadic: (service: AxiosInstance) => {
24
- get: <T = any>(url: string, config?: AxiosRequestConfig<any>) => Promise<Result<AxiosResponse<T, any, {}>, SwapErrorRight>>;
25
- post: <T_1 = any>(url: string, data: any, config?: AxiosRequestConfig<any>) => Promise<Result<AxiosResponse<T_1, any, {}>, SwapErrorRight>>;
26
- delete: <T_2 = any>(url: string, data: any, config?: AxiosRequestConfig<any>) => Promise<Result<AxiosResponse<T_2, any, {}>, SwapErrorRight>>;
24
+ get: <T = any>(url: string, config?: AxiosRequestConfig<any>) => Promise<Result<AxiosResponse<T>, SwapErrorRight>>;
25
+ post: <T = any>(url: string, data: any, config?: AxiosRequestConfig<any>) => Promise<Result<AxiosResponse<T>, SwapErrorRight>>;
26
+ delete: <T = any>(url: string, data: any, config?: AxiosRequestConfig<any>) => Promise<Result<AxiosResponse<T>, SwapErrorRight>>;
27
27
  };
28
28
  export declare const getHopByIndex: (quote: TradeQuote | TradeRate | undefined, index: SupportedTradeQuoteStepIndex) => TradeQuoteStep | undefined;
29
29
  export declare const executeEvmTransaction: (txToSign: SignTx<EvmChainId>, callbacks: EvmTransactionExecutionProps) => Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "17.7.1",
3
+ "version": "17.7.2",
4
4
  "repository": "https://github.com/shapeshift/web",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,9 +51,9 @@
51
51
  "viem": "2.43.5",
52
52
  "@shapeshiftoss/caip": "^8.16.7",
53
53
  "@shapeshiftoss/chain-adapters": "^11.3.9",
54
- "@shapeshiftoss/contracts": "^1.0.5-coderabbit-fix.2",
55
- "@shapeshiftoss/hdwallet-core": "^1.62.41",
56
54
  "@shapeshiftoss/types": "^8.6.7",
55
+ "@shapeshiftoss/hdwallet-core": "^1.62.41",
56
+ "@shapeshiftoss/contracts": "^1.0.5-coderabbit-fix.2",
57
57
  "@shapeshiftoss/unchained-client": "^10.14.10",
58
58
  "@shapeshiftoss/utils": "^1.0.5"
59
59
  },