sushi 6.1.1 → 6.1.3

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.
@@ -284,45 +284,45 @@ export const ROUTE_PROCESSOR_9_ADDRESS: Record<
284
284
  > = {
285
285
  [EvmChainId.ETHEREUM]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
286
286
  [EvmChainId.ARBITRUM]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
287
- [EvmChainId.OPTIMISM]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
287
+ [EvmChainId.OPTIMISM]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
288
288
  [EvmChainId.BASE]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
289
- [EvmChainId.POLYGON]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
290
- [EvmChainId.AVALANCHE]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
289
+ [EvmChainId.POLYGON]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
290
+ [EvmChainId.AVALANCHE]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
291
291
  [EvmChainId.BSC]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
292
- [EvmChainId.LINEA]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
293
- [EvmChainId.ARBITRUM_NOVA]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
294
- [EvmChainId.GNOSIS]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
295
- [EvmChainId.FANTOM]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
296
- [EvmChainId.BTTC]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
297
- [EvmChainId.CELO]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
298
- [EvmChainId.FILECOIN]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
299
- [EvmChainId.HAQQ]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
300
- [EvmChainId.KAVA]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
301
- [EvmChainId.METIS]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
302
- [EvmChainId.THUNDERCORE]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
292
+ [EvmChainId.LINEA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
293
+ [EvmChainId.ARBITRUM_NOVA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
294
+ [EvmChainId.GNOSIS]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
295
+ [EvmChainId.FANTOM]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
296
+ [EvmChainId.BTTC]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
297
+ [EvmChainId.CELO]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
298
+ [EvmChainId.FILECOIN]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
299
+ [EvmChainId.HAQQ]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
300
+ [EvmChainId.KAVA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
301
+ [EvmChainId.METIS]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
302
+ [EvmChainId.THUNDERCORE]: '0x861255aef9aad3e268fb67a3c97afd490bff3d6b',
303
303
  [EvmChainId.SCROLL]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
304
- [EvmChainId.ZETACHAIN]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
305
- [EvmChainId.POLYGON_ZKEVM]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
306
- [EvmChainId.HARMONY]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
307
- [EvmChainId.BOBA]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
308
- [EvmChainId.BOBA_BNB]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
309
- [EvmChainId.CORE]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
310
- [EvmChainId.CRONOS]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
311
- [EvmChainId.BLAST]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
312
- [EvmChainId.SKALE_EUROPA]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
313
- [EvmChainId.ROOTSTOCK]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
304
+ [EvmChainId.ZETACHAIN]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
305
+ [EvmChainId.POLYGON_ZKEVM]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
306
+ [EvmChainId.HARMONY]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
307
+ [EvmChainId.BOBA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
308
+ [EvmChainId.BOBA_BNB]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
309
+ [EvmChainId.CORE]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
310
+ [EvmChainId.CRONOS]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
311
+ [EvmChainId.BLAST]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
312
+ [EvmChainId.SKALE_EUROPA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
313
+ [EvmChainId.ROOTSTOCK]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
314
314
  [EvmChainId.ZKSYNC_ERA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
315
- [EvmChainId.MANTLE]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
316
- [EvmChainId.MANTA]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
317
- [EvmChainId.MODE]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
318
- [EvmChainId.TAIKO]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
319
- [EvmChainId.ZKLINK]: '0xe2efede921b3114fdde3f9529bc682dbaf742058',
320
- [EvmChainId.APE]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
321
- [EvmChainId.SONIC]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
322
- [EvmChainId.HEMI]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
323
- [EvmChainId.KATANA]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
324
- [EvmChainId.HYPEREVM]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
325
- [EvmChainId.BERACHAIN]: '0x81602ef321c46d73f5ba7f476947ae1a862957dc',
315
+ [EvmChainId.MANTLE]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
316
+ [EvmChainId.MANTA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
317
+ [EvmChainId.MODE]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
318
+ [EvmChainId.TAIKO]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
319
+ [EvmChainId.ZKLINK]: '0xfb7eedd827c4bed92b9b6c5159bee11301f3da8c',
320
+ [EvmChainId.APE]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
321
+ [EvmChainId.SONIC]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
322
+ [EvmChainId.HEMI]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
323
+ [EvmChainId.KATANA]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
324
+ [EvmChainId.HYPEREVM]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
325
+ [EvmChainId.BERACHAIN]: '0x3b0aa7d38bf3c103bf02d1de2e37568cbed3d6e8',
326
326
  } as const
327
327
  export const isRouteProcessor9ChainId = (
328
328
  chainId: number,
@@ -30,6 +30,8 @@ describe('numberToFixed', () => {
30
30
 
31
31
  describe('significant digits', () => {
32
32
  it('should format numbers with significant digits', () => {
33
+ expect(numberToFixed(1234.5678, { significant: 4 })).toBe('1235')
34
+ expect(numberToFixed(2779.6772866, { significant: 4 })).toBe('2780')
33
35
  expect(numberToFixed(123456789.123456, { significant: 4 })).toBe(
34
36
  '123456789',
35
37
  )
@@ -46,6 +48,9 @@ describe('numberToFixed', () => {
46
48
 
47
49
  it('should handle string inputs with significant digits', () => {
48
50
  expect(numberToFixed('1234.5678', { significant: 4 })).toBe('1235')
51
+ expect(numberToFixed('2779.677286642591274414', { significant: 4 })).toBe(
52
+ '2780',
53
+ )
49
54
  expect(numberToFixed('123456789.123456', { significant: 4 })).toBe(
50
55
  '123456789',
51
56
  )
@@ -192,6 +192,8 @@ function stringToFixed(
192
192
  }
193
193
 
194
194
  function roundString(original: string, formatted: string) {
195
+ const decimalIndex = original.indexOf('.')
196
+
195
197
  const nextDigitIndex = formatted.length
196
198
 
197
199
  let nextDigit = original.charCodeAt(nextDigitIndex)
@@ -213,7 +215,10 @@ function roundString(original: string, formatted: string) {
213
215
  }
214
216
  }
215
217
 
216
- return `${formatted.substring(0, formatted.length - 1)}${String.fromCharCode(lastDigit() + 1)}`
218
+ return `${formatted.substring(0, formatted.length - 1)}${String.fromCharCode(lastDigit() + 1)}`.padEnd(
219
+ decimalIndex,
220
+ '0',
221
+ )
217
222
  }
218
223
 
219
224
  return formatted
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sushi",
3
3
  "description": "Sushi",
4
- "version": "6.1.1",
4
+ "version": "6.1.3",
5
5
  "type": "module",
6
6
  "main": "./_cjs/generic/index.js",
7
7
  "module": "./_esm/generic/index.js",