@sodax/types 2.0.0-rc.9 → 2.0.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 (50) hide show
  1. package/dist/backend/backendApiV1.d.ts +28 -0
  2. package/dist/backend/backendApiV2.d.ts +678 -0
  3. package/dist/backend/backendApiV2.js +38 -0
  4. package/dist/backend/index.d.ts +2 -1
  5. package/dist/backend/index.js +2 -1
  6. package/dist/bitcoin/bitcoin.d.ts +18 -0
  7. package/dist/bitcoin/bitcoin.js +13 -0
  8. package/dist/chains/chain-keys.d.ts +3 -2
  9. package/dist/chains/chain-keys.js +1 -0
  10. package/dist/chains/chains.d.ts +435 -16
  11. package/dist/chains/chains.js +76 -4
  12. package/dist/chains/tokens.d.ts +592 -12
  13. package/dist/chains/tokens.js +285 -5
  14. package/dist/common/common.d.ts +15 -7
  15. package/dist/common/constants.d.ts +19 -1
  16. package/dist/dex/dex.d.ts +4 -1
  17. package/dist/hooks/hooks.d.ts +42 -0
  18. package/dist/hooks/hooks.js +44 -0
  19. package/dist/hooks/index.d.ts +1 -0
  20. package/dist/hooks/index.js +1 -0
  21. package/dist/index.d.ts +3 -1
  22. package/dist/index.js +3 -1
  23. package/dist/injective/injective.d.ts +4 -0
  24. package/dist/leverageYield/index.d.ts +1 -0
  25. package/dist/leverageYield/index.js +1 -0
  26. package/dist/leverageYield/leverageYield.d.ts +152 -0
  27. package/dist/leverageYield/leverageYield.js +51 -0
  28. package/dist/moneyMarket/moneyMarket.d.ts +248 -6
  29. package/dist/moneyMarket/moneyMarket.js +13 -0
  30. package/dist/near/near.d.ts +5 -1
  31. package/dist/shared/analytics.d.ts +119 -0
  32. package/dist/shared/analytics.js +1 -0
  33. package/dist/shared/features.d.ts +9 -0
  34. package/dist/shared/features.js +1 -0
  35. package/dist/shared/index.d.ts +3 -0
  36. package/dist/shared/index.js +3 -0
  37. package/dist/shared/logger.d.ts +27 -0
  38. package/dist/shared/logger.js +1 -0
  39. package/dist/shared/shared.d.ts +21 -0
  40. package/dist/sodax-config/sodax-config.d.ts +769 -73
  41. package/dist/sodax-config/sodax-config.js +3 -4
  42. package/dist/solana/solana.d.ts +2 -0
  43. package/dist/stacks/stacks.d.ts +2 -0
  44. package/dist/stellar/stellar.d.ts +4 -0
  45. package/dist/sui/sui.d.ts +3 -2
  46. package/dist/swap/swap.d.ts +478 -90
  47. package/dist/swap/swap.js +79 -12
  48. package/package.json +2 -2
  49. package/dist/backend/backendApi.d.ts +0 -74
  50. /package/dist/backend/{backendApi.js → backendApiV1.js} +0 -0
@@ -2,6 +2,23 @@
2
2
  // cycle: chains.ts imports from tokens.ts, and tokens.ts imports ChainKeys — if we source it
3
3
  // from chains.js the value is still undefined when tokens.ts initializes.
4
4
  import { ChainKeys } from './chain-keys.js';
5
+ /**
6
+ * Base URL for default token logos hosted in the `@sodax/assets` package.
7
+ * Each logo is served from `main` via raw.githubusercontent and named by the
8
+ * token's slugified symbol, so the full URL is `${TOKEN_LOGO_BASE_URL}/<slug>.png`.
9
+ */
10
+ export const TOKEN_LOGO_BASE_URL = 'https://raw.githubusercontent.com/icon-project/sodax-sdks/main/packages/assets/token';
11
+ /**
12
+ * Filename slug for a token logo: the symbol lowercased with every run of
13
+ * non-alphanumeric characters collapsed to a single `-` (so `bnUSD (legacy)` →
14
+ * `bnusd-legacy`, `AVAX.LL` → `avax-ll`). Keeps filenames URL- and path-safe.
15
+ */
16
+ export const tokenLogoSlug = (symbol) => symbol
17
+ .toLowerCase()
18
+ .replace(/[^a-z0-9]+/g, '-')
19
+ .replace(/^-|-$/g, '');
20
+ /** Default logo URL for a token, resolved from its symbol (hosted in @sodax/assets). */
21
+ export const tokenLogo = (symbol) => `${TOKEN_LOGO_BASE_URL}/${tokenLogoSlug(symbol)}.png`;
5
22
  export const StatATokenAddresses = {
6
23
  '0xac8540fee419c7ceb985889eaba1e84b42a53e8a': '0x21685E341DE7844135329914Be6Bd8D16982d834',
7
24
  '0x8ade79c255761971f4057253712b916ab2494275': '0x7A1A5555842Ad2D0eD274d09b5c4406a95799D5d',
@@ -32,7 +49,11 @@ export const HubVaultSymbols = [
32
49
  'sodaNEAR',
33
50
  'sodaKAIA',
34
51
  'sodaSTX',
52
+ 'sodaSUSDS',
53
+ 'sodaHBAR',
54
+ 'sodaJITOSOL',
35
55
  'sodaUSDS',
56
+ 'sodaUSSD',
36
57
  ];
37
58
  export const SodaTokens = {
38
59
  sodaBNB: {
@@ -251,15 +272,90 @@ export const SodaTokens = {
251
272
  hubAsset: '0x1Fbe5229e9d189F26bEE77E5bFa24309FdA90483',
252
273
  vault: '0x1Fbe5229e9d189F26bEE77E5bFa24309FdA90483',
253
274
  },
254
- sodaUSDS: {
255
- symbol: 'sodaUSDS',
256
- name: 'Soda USDS',
275
+ sodaSUSDS: {
276
+ symbol: 'sodaSUSDS',
277
+ name: 'SODA sUSDS',
257
278
  decimals: 18,
258
279
  address: '0x243b0c26c8b38793908d7C64e8510f21B19B4613',
259
280
  chainKey: ChainKeys.SONIC_MAINNET,
260
281
  hubAsset: '0x243b0c26c8b38793908d7C64e8510f21B19B4613',
261
282
  vault: '0x243b0c26c8b38793908d7C64e8510f21B19B4613',
262
- }
283
+ },
284
+ sodaHBAR: {
285
+ symbol: 'sodaHBAR',
286
+ name: 'Soda HBAR',
287
+ decimals: 18,
288
+ address: '0x3BB956cc8922E1Ba4148dc10eD1b4Fa19aa599c4',
289
+ chainKey: ChainKeys.SONIC_MAINNET,
290
+ hubAsset: '0x3BB956cc8922E1Ba4148dc10eD1b4Fa19aa599c4',
291
+ vault: '0x3BB956cc8922E1Ba4148dc10eD1b4Fa19aa599c4',
292
+ },
293
+ sodaJITOSOL: {
294
+ symbol: 'sodaJITOSOL',
295
+ name: 'Soda JITOSOL',
296
+ decimals: 18,
297
+ address: '0xe1bad4400d947Bc4fa66f9c0A143D800002083a0',
298
+ chainKey: ChainKeys.SONIC_MAINNET,
299
+ hubAsset: '0xe1bad4400d947Bc4fa66f9c0A143D800002083a0',
300
+ vault: '0xe1bad4400d947Bc4fa66f9c0A143D800002083a0',
301
+ },
302
+ sodaUSDS: {
303
+ symbol: 'sodaUSDS',
304
+ name: 'Soda USDS',
305
+ decimals: 18,
306
+ address: '0xA3AeFa2BAfEAB479c4Aca6024A16906bbC75566e',
307
+ chainKey: ChainKeys.SONIC_MAINNET,
308
+ hubAsset: '0xA3AeFa2BAfEAB479c4Aca6024A16906bbC75566e',
309
+ vault: '0xA3AeFa2BAfEAB479c4Aca6024A16906bbC75566e',
310
+ },
311
+ sodaUSSD: {
312
+ symbol: 'sodaUSSD',
313
+ name: 'Soda USSD',
314
+ decimals: 18,
315
+ address: '0xb780e09576C2667ba9F5B80FbAb2e6b8A0a21e37',
316
+ chainKey: ChainKeys.SONIC_MAINNET,
317
+ hubAsset: '0xb780e09576C2667ba9F5B80FbAb2e6b8A0a21e37',
318
+ vault: '0xb780e09576C2667ba9F5B80FbAb2e6b8A0a21e37',
319
+ },
320
+ };
321
+ /**
322
+ * Leverage-yield vault share tokens on Sonic. Each entry is the ERC-4626 share token
323
+ * issued by a deployed `LeverageYieldVault` (see `leverageYield.leverageYieldVaults` for
324
+ * the matching vault metadata). Spread into `sonicSupportedTokens` and the swap registry
325
+ * so they're discoverable in token selectors and swappable via the solver.
326
+ *
327
+ * `address`, `hubAsset`, and `vault` are all the leverage-vault proxy address — these
328
+ * tokens live on the hub and aren't further wrapped.
329
+ */
330
+ export const LsodaSymbols = ['lsodaWEETH', 'lsodaWSTETH', 'lsodaJITOSOL'];
331
+ export const LsodaTokens = {
332
+ lsodaWEETH: {
333
+ symbol: 'lsodaWEETH',
334
+ name: 'Leveraged Soda weETH',
335
+ decimals: 18,
336
+ address: '0xD09de2f5070699A909c0FD32fb5A909d3886701D',
337
+ chainKey: ChainKeys.SONIC_MAINNET,
338
+ hubAsset: '0xD09de2f5070699A909c0FD32fb5A909d3886701D',
339
+ vault: '0xD09de2f5070699A909c0FD32fb5A909d3886701D',
340
+ },
341
+ lsodaWSTETH: {
342
+ symbol: 'lsodaWSTETH',
343
+ name: 'Leveraged Soda wstETH',
344
+ decimals: 18,
345
+ address: '0x136E5D1CEC5db1829E24941Eddd9C8640E02Ce7a',
346
+ chainKey: ChainKeys.SONIC_MAINNET,
347
+ hubAsset: '0x136E5D1CEC5db1829E24941Eddd9C8640E02Ce7a',
348
+ vault: '0x136E5D1CEC5db1829E24941Eddd9C8640E02Ce7a',
349
+ },
350
+ lsodaJITOSOL: {
351
+ symbol: 'lsodaJITOSOL',
352
+ name: 'Leveraged Soda JITOSOL',
353
+ decimals: 18,
354
+ address: '0xD7Ae4853E0f93682F5DaA14734F5D18cBa09Bd78',
355
+ chainKey: ChainKeys.SONIC_MAINNET,
356
+ hubAsset: '0xD7Ae4853E0f93682F5DaA14734F5D18cBa09Bd78',
357
+ vault: '0xD7Ae4853E0f93682F5DaA14734F5D18cBa09Bd78',
358
+ },
263
359
  };
264
360
  // --- Per-chain supported tokens ---
265
361
  export const sonicSupportedTokens = {
@@ -326,7 +422,17 @@ export const sonicSupportedTokens = {
326
422
  hubAsset: '0x7c7d53EEcda37a87ce0D5bf8E0b24512A48dC963',
327
423
  vault: SodaTokens.sodaSODA.address,
328
424
  },
425
+ USSD: {
426
+ symbol: 'USSD',
427
+ name: 'US Sonic Dollar',
428
+ decimals: 18,
429
+ address: '0x000000000eCcFf26B795F73fb0A70d48da657fEf',
430
+ chainKey: ChainKeys.SONIC_MAINNET,
431
+ hubAsset: '0x000000000eCcFf26B795F73fb0A70d48da657fEf',
432
+ vault: SodaTokens.sodaUSSD.address,
433
+ },
329
434
  ...SodaTokens,
435
+ ...LsodaTokens,
330
436
  };
331
437
  export const redbellySupportedTokens = {
332
438
  RBNT: {
@@ -536,7 +642,7 @@ export const solanaSupportedTokens = {
536
642
  address: 'J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn',
537
643
  chainKey: ChainKeys.SOLANA_MAINNET,
538
644
  hubAsset: '0x942f89a324d2652e447b9fcf08effc9f9776a680',
539
- vault: '0x942f89a324d2652e447b9fcf08effc9f9776a680',
645
+ vault: SodaTokens.sodaJITOSOL.address,
540
646
  },
541
647
  mSOL: {
542
648
  symbol: 'mSOL',
@@ -583,6 +689,78 @@ export const solanaSupportedTokens = {
583
689
  hubAsset: '0x0076b67235bfc69b649d29dd7cb66e5b92b618aa',
584
690
  vault: '0x0076b67235bfc69b649d29dd7cb66e5b92b618aa',
585
691
  },
692
+ CRCLx: {
693
+ symbol: 'CRCLx',
694
+ name: 'Circle xStock',
695
+ decimals: 8,
696
+ address: 'XsueG8BtpquVJX9LVLLEGuViXUungE6WmK5YZ3p3bd1',
697
+ chainKey: ChainKeys.SOLANA_MAINNET,
698
+ hubAsset: '0x64659130a3373b3527146b38fc1fccf017bc0c61',
699
+ vault: '0x64659130a3373b3527146b38fc1fccf017bc0c61',
700
+ },
701
+ TSLAx: {
702
+ symbol: 'TSLAx',
703
+ name: 'Tesla xStock',
704
+ decimals: 8,
705
+ address: 'XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB',
706
+ chainKey: ChainKeys.SOLANA_MAINNET,
707
+ hubAsset: '0x3cc867f6f4d1817b6230b781125301363fce370c',
708
+ vault: '0x3cc867f6f4d1817b6230b781125301363fce370c',
709
+ },
710
+ SPYx: {
711
+ symbol: 'SPYx',
712
+ name: 'SP500 xStock',
713
+ decimals: 8,
714
+ address: 'XsoCS1TfEyfFhfvj8EtZ528L3CaKBDBRqRapnBbDF2W',
715
+ chainKey: ChainKeys.SOLANA_MAINNET,
716
+ hubAsset: '0xea66dbe82ebcb6c3a55b2db3d722b676be63a26e',
717
+ vault: '0xea66dbe82ebcb6c3a55b2db3d722b676be63a26e',
718
+ },
719
+ NVDAx: {
720
+ symbol: 'NVDAx',
721
+ name: 'NVIDIA xStock',
722
+ decimals: 8,
723
+ address: 'Xsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh',
724
+ chainKey: ChainKeys.SOLANA_MAINNET,
725
+ hubAsset: '0x48303c90f4136bc3101b308c8b50c55745aaf317',
726
+ vault: '0x48303c90f4136bc3101b308c8b50c55745aaf317',
727
+ },
728
+ QQQx: {
729
+ symbol: 'QQQx',
730
+ name: 'Nasdaq xStock',
731
+ decimals: 8,
732
+ address: 'Xs8S1uUs1zvS2p7iwtsG3b6fkhpvmwz4GYU3gWAmWHZ',
733
+ chainKey: ChainKeys.SOLANA_MAINNET,
734
+ hubAsset: '0x4448b894740198ab76c83c8850d73f7dc8e4b9b3',
735
+ vault: '0x4448b894740198ab76c83c8850d73f7dc8e4b9b3',
736
+ },
737
+ MSTRx: {
738
+ symbol: 'MSTRx',
739
+ name: 'MicroStrategy xStock',
740
+ decimals: 8,
741
+ address: 'XsP7xzNPvEHS1m6qfanPUGjNmdnmsLKEoNAnHjdxxyZ',
742
+ chainKey: ChainKeys.SOLANA_MAINNET,
743
+ hubAsset: '0xc46c34961802355c5223a115568fdf18a51ad6f6',
744
+ vault: '0xc46c34961802355c5223a115568fdf18a51ad6f6',
745
+ },
746
+ COINx: {
747
+ symbol: 'COINx',
748
+ name: 'Coinbase xStock',
749
+ decimals: 8,
750
+ address: 'Xs7ZdzSHLU9ftNJsii5fCeJhoRWSC32SQGzGQtePxNu',
751
+ chainKey: ChainKeys.SOLANA_MAINNET,
752
+ hubAsset: '0xf444586e95166da0754052f03f344cf1152abe7d',
753
+ vault: '0xf444586e95166da0754052f03f344cf1152abe7d',
754
+ },
755
+ GOOGLx: {
756
+ symbol: 'GOOGLx',
757
+ name: 'Alphabet xStock',
758
+ decimals: 8,
759
+ address: 'XsCPL9dNWBMvFtTmwcCA5v3xWPSMEBCszbQdiLLq6aN',
760
+ chainKey: ChainKeys.SOLANA_MAINNET,
761
+ hubAsset: '0x024230dd63b27df90d988d6f37a69d4de627ce89',
762
+ vault: '0x024230dd63b27df90d988d6f37a69d4de627ce89',
763
+ },
586
764
  };
587
765
  export const avalancheSupportedTokens = {
588
766
  AVAX: {
@@ -740,6 +918,15 @@ export const arbitrumSupportedTokens = {
740
918
  address: '0xddb46999f8891663a8f2828d25298f70416d7610',
741
919
  chainKey: ChainKeys.ARBITRUM_MAINNET,
742
920
  hubAsset: '0x8794A87979efA70bBE29Ed3357e9A93932B48675',
921
+ vault: SodaTokens.sodaSUSDS.address,
922
+ },
923
+ USDS: {
924
+ symbol: 'USDS',
925
+ name: 'USDS Stablecoin',
926
+ decimals: 18,
927
+ address: '0x6491c05A82219b8D1479057361ff1654749b876b',
928
+ chainKey: ChainKeys.ARBITRUM_MAINNET,
929
+ hubAsset: '0x856c02acdD01947788dc5D218A3cb2c4C9BdEed2',
743
930
  vault: SodaTokens.sodaUSDS.address,
744
931
  },
745
932
  ARB: {
@@ -843,6 +1030,15 @@ export const baseSupportedTokens = {
843
1030
  hubAsset: '0x72E852545B024ddCbc5b70C1bCBDAA025164259C',
844
1031
  vault: SodaTokens.sodaUSDC.address,
845
1032
  },
1033
+ USDS: {
1034
+ symbol: 'USDS',
1035
+ name: 'USDS Stablecoin',
1036
+ decimals: 18,
1037
+ address: '0x820C137fa70C8691f0e44Dc420a5e53c168921Dc',
1038
+ chainKey: ChainKeys.BASE_MAINNET,
1039
+ hubAsset: '0xFE9b81eF40419Ef9Ce62cCff197345D78c552945',
1040
+ vault: SodaTokens.sodaUSDS.address,
1041
+ },
846
1042
  wstETH: {
847
1043
  symbol: 'wstETH',
848
1044
  name: 'Wrapped stETH',
@@ -898,6 +1094,15 @@ export const baseSupportedTokens = {
898
1094
  hubAsset: '0xaa81bb5ba3c972ab53605d3ba7e443a3de6d1cb9',
899
1095
  vault: '0xaa81bb5ba3c972ab53605d3ba7e443a3de6d1cb9',
900
1096
  },
1097
+ AERO: {
1098
+ symbol: 'AERO',
1099
+ name: 'Aerodrome Finance',
1100
+ decimals: 18,
1101
+ address: '0x940181a94A35A4569e4529A3CDfB74e38FD98631',
1102
+ chainKey: ChainKeys.BASE_MAINNET,
1103
+ hubAsset: '0x348e086ab6f424dfc575a325c28624ed23973173',
1104
+ vault: '0x348e086ab6f424dfc575a325c28624ed23973173',
1105
+ },
901
1106
  };
902
1107
  export const optimismSupportedTokens = {
903
1108
  ETH: {
@@ -1580,6 +1785,33 @@ export const stellarSupportedTokens = {
1580
1785
  hubAsset: '0xD749B5FfFED7cEDaa3239abDd16D677179C29AEc',
1581
1786
  vault: SodaTokens.sodaSODA.address,
1582
1787
  },
1788
+ sodaETH: {
1789
+ symbol: 'sodaETH',
1790
+ name: 'Soda ETH',
1791
+ decimals: 7,
1792
+ address: 'CDK5EWVTZLGSLI6D5OSES7XUKWZUKBXDRNOWUVDNPP5RJRP5EYWCW7SL',
1793
+ chainKey: ChainKeys.STELLAR_MAINNET,
1794
+ hubAsset: '0x4985a4b72ac723723e9ae82382d12d77e9a715de',
1795
+ vault: SodaTokens.sodaETH.address,
1796
+ },
1797
+ sodaBTC: {
1798
+ symbol: 'sodaBTC',
1799
+ name: 'Soda BTC',
1800
+ decimals: 7,
1801
+ address: 'CD6XWBW74YVFDQQYUM2GALCULMA5MAWGP6NTCWF3ZYXP4Z7MEVY4JKBX',
1802
+ chainKey: ChainKeys.STELLAR_MAINNET,
1803
+ hubAsset: '0xddee01f63c18843e2bac30cb702864d7632c83a2',
1804
+ vault: SodaTokens.sodaBTC.address,
1805
+ },
1806
+ sodaBNB: {
1807
+ symbol: 'sodaBNB',
1808
+ name: 'Soda BNB',
1809
+ decimals: 7,
1810
+ address: 'CCXTXZAFLVNTMORVWYB6BGL7YEW3U3ONDAL2FGBRGDUQH7AGANVQPRS6',
1811
+ chainKey: ChainKeys.STELLAR_MAINNET,
1812
+ hubAsset: '0xa10be5f5c2dea7d272555dc73ea2a7317c3c5b63',
1813
+ vault: SodaTokens.sodaBNB.address,
1814
+ },
1583
1815
  };
1584
1816
  export const suiSupportedTokens = {
1585
1817
  SUI: {
@@ -1860,6 +2092,15 @@ export const ethereumSupportedTokens = {
1860
2092
  hubAsset: '0x46bd0ce9b2b455ac4377cd142ecb8b719715197d',
1861
2093
  vault: SodaTokens.sodaUSDC.address,
1862
2094
  },
2095
+ USDS: {
2096
+ symbol: 'USDS',
2097
+ name: 'USDS Stablecoin',
2098
+ decimals: 18,
2099
+ address: '0xdC035D45d973E3EC169d2276DDab16f1e407384F',
2100
+ chainKey: ChainKeys.ETHEREUM_MAINNET,
2101
+ hubAsset: '0x31D3a9319C76EC4A474721966dA65b94e6bFc9eF',
2102
+ vault: SodaTokens.sodaUSDS.address,
2103
+ },
1863
2104
  LL: {
1864
2105
  symbol: 'LL',
1865
2106
  name: 'LightLink',
@@ -2098,6 +2339,44 @@ export const kaiaSupportedTokens = {
2098
2339
  vault: SodaTokens.sodaSODA.address,
2099
2340
  },
2100
2341
  };
2342
+ export const hederaSupportedTokens = {
2343
+ HBAR: {
2344
+ symbol: 'HBAR',
2345
+ name: 'HBAR',
2346
+ decimals: 8,
2347
+ address: '0x0000000000000000000000000000000000000000',
2348
+ chainKey: ChainKeys.HEDERA_MAINNET,
2349
+ hubAsset: '0x5c18c543b6B6EA97dE739F48C49CfC291B3AD465',
2350
+ vault: SodaTokens.sodaHBAR.address,
2351
+ },
2352
+ bnUSD: {
2353
+ symbol: 'bnUSD',
2354
+ name: 'bnUSD',
2355
+ decimals: 8,
2356
+ address: '0x0000000000000000000000000000000000a0286a',
2357
+ chainKey: ChainKeys.HEDERA_MAINNET,
2358
+ hubAsset: '0x44be1984cd279334a630469fa357305c7dba2837',
2359
+ vault: SodaTokens.bnUSD.address,
2360
+ },
2361
+ SODA: {
2362
+ symbol: 'SODA',
2363
+ name: 'SODAX',
2364
+ decimals: 8,
2365
+ address: '0x0000000000000000000000000000000000a02869',
2366
+ chainKey: ChainKeys.HEDERA_MAINNET,
2367
+ hubAsset: '0x1217721376839dbffe78093ddd5d8e50d0239b3f',
2368
+ vault: SodaTokens.sodaSODA.address,
2369
+ },
2370
+ USDC: {
2371
+ symbol: 'USDC',
2372
+ name: 'USD Coin',
2373
+ decimals: 6,
2374
+ address: '0x000000000000000000000000000000000006f89a',
2375
+ chainKey: ChainKeys.HEDERA_MAINNET,
2376
+ hubAsset: '0xafafae0c1476424c4b81f09095bd7dcb858047c8',
2377
+ vault: SodaTokens.sodaUSDC.address,
2378
+ },
2379
+ };
2101
2380
  export const stacksSupportedTokens = {
2102
2381
  STX: {
2103
2382
  symbol: 'STX',
@@ -2167,4 +2446,5 @@ export const supportedTokensByChain = {
2167
2446
  [ChainKeys.ETHEREUM_MAINNET]: ethereumSupportedTokens,
2168
2447
  [ChainKeys.KAIA_MAINNET]: kaiaSupportedTokens,
2169
2448
  [ChainKeys.STACKS_MAINNET]: stacksSupportedTokens,
2449
+ [ChainKeys.HEDERA_MAINNET]: hederaSupportedTokens,
2170
2450
  };
@@ -227,7 +227,10 @@ export type AssetInfo = {
227
227
  chainId: bigint;
228
228
  spokeAddress: `0x${string}`;
229
229
  };
230
- export type MoneyMarketConfig = {
230
+ export type MoneyMarketOptions = {
231
+ partnerFee?: PartnerFee;
232
+ };
233
+ export type MoneyMarketDefaultConfig = {
231
234
  supportedTokens: Record<SpokeChainKey, readonly XToken[]>;
232
235
  supportedReserveAssets: readonly Address[];
233
236
  uiPoolDataProvider: Address;
@@ -236,8 +239,8 @@ export type MoneyMarketConfig = {
236
239
  bnUSD: Address;
237
240
  bnUSDVault: Address;
238
241
  bnUSDAToken: Address;
239
- partnerFee: PartnerFee | undefined;
240
242
  };
243
+ export type MoneyMarketConfig = Prettify<MoneyMarketDefaultConfig & MoneyMarketOptions>;
241
244
  export type TokenInfo = {
242
245
  decimals: number;
243
246
  depositFee: bigint;
@@ -259,13 +262,18 @@ export type WalletProviderSlot<K extends SpokeChainKey | ChainType, Raw extends
259
262
  walletProvider: GetWalletProviderType<K>;
260
263
  };
261
264
  /**
262
- * Standard exec-mode wrapper for hub/spoke flows: bounded `params`, optional relay toggles,
263
- * plus {@link WalletProviderSlot} (`raw: true` for unsigned payloads, otherwise `walletProvider` required).
264
- * Compose feature-specific extras at the alias site, e.g.
265
- * `SpokeExecActionParams<K, Raw, P> & { fee?: PartnerFee }`.
265
+ * Standard exec-mode wrapper for hub/spoke flows: bounded `params`, optional per-action `extras`,
266
+ * optional relay toggles, plus {@link WalletProviderSlot} (`raw: true` for unsigned payloads,
267
+ * otherwise `walletProvider` required).
268
+ *
269
+ * Per-action data beyond `params` goes in the typed `extras` slot (`E`), parameterized like
270
+ * `params` so a feature can key it off `K`, e.g. `SpokeExecActionParams<K, Raw, P, MyExtras<K>>`.
271
+ * `E` defaults to `never`, so callers that don't opt in get `extras?: never` (effectively absent).
272
+ * Simple one-off modifiers may still be intersected at the alias site instead.
266
273
  */
267
- export type SpokeExecActionParams<K extends SpokeChainKey, Raw extends boolean, P> = {
274
+ export type SpokeExecActionParams<K extends SpokeChainKey, Raw extends boolean, P, E = never> = {
268
275
  params: P;
276
+ extras?: E;
269
277
  skipSimulation?: boolean;
270
278
  timeout?: number;
271
279
  } & WalletProviderSlot<K, Raw>;
@@ -15,11 +15,28 @@ export declare const DEFAULT_BACKEND_API_HEADERS: {
15
15
  };
16
16
  export declare const DEFAULT_RELAYER_API_ENDPOINT = "https://xcall-relay.nw.iconblockchain.xyz";
17
17
  export declare const VAULT_TOKEN_DECIMALS = 18;
18
- export type ApiConfig = {
18
+ export type BaseApiConfig = {
19
19
  baseURL: HttpUrl;
20
20
  timeout: number;
21
21
  headers: Record<string, string>;
22
22
  };
23
+ /** Per-endpoint config for the swaps API. Structurally identical to {@link BaseApiConfig}. */
24
+ export type SwapsApiConfig = BaseApiConfig;
25
+ /**
26
+ * Nested config that points the base (backend) API and the swaps API at independent endpoints.
27
+ * At least one slice must be provided — an empty custom config is meaningless (pass a flat
28
+ * {@link BaseApiConfig} instead). Requiring a slice keeps the two members disjoint from
29
+ * `BaseApiConfig` (which carries `baseURL`), so {@link ApiConfig} can be discriminated by the
30
+ * presence of a `baseApiConfig` / `swapsApiConfig` slice.
31
+ */
32
+ export type CustomApiConfig = {
33
+ baseApiConfig: BaseApiConfig;
34
+ swapsApiConfig?: SwapsApiConfig;
35
+ } | {
36
+ baseApiConfig?: BaseApiConfig;
37
+ swapsApiConfig: SwapsApiConfig;
38
+ };
39
+ export type ApiConfig = BaseApiConfig | CustomApiConfig;
23
40
  export declare const apiConfig: {
24
41
  baseURL: "https://api.sodax.com/v1/be";
25
42
  timeout: number;
@@ -65,5 +82,6 @@ export declare const relayConfig: {
65
82
  readonly redbelly: 726564n;
66
83
  readonly "0x2019.kaia": 27489n;
67
84
  readonly stacks: 60n;
85
+ readonly hedera: 18501n;
68
86
  };
69
87
  };
package/dist/dex/dex.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Address } from '../shared/shared.js';
2
2
  import { StatATokenAddresses } from '../chains/tokens.js';
3
3
  import type { PoolKey } from './pancakeswap-infinity.js';
4
+ import type { Prettify } from '../common/common.js';
4
5
  export type { EncodedPoolKey, PoolKey, Slot0, CLPositionConfig, } from './pancakeswap-infinity.js';
5
6
  export type ConcentratedLiquidityConfig = {
6
7
  permit2: Address;
@@ -134,7 +135,9 @@ export declare const dexPools: {
134
135
  };
135
136
  };
136
137
  };
137
- export type DexConfig = {
138
+ export type DexOptions = {};
139
+ export type DexConfig = Prettify<DexDefaultConfig & DexOptions>;
140
+ export type DexDefaultConfig = {
138
141
  concentratedLiquidityConfig: ConcentratedLiquidityConfig;
139
142
  dexPools: Record<string, PoolKey>;
140
143
  statATokenAddresses: Record<Address, Address> & typeof StatATokenAddresses;
@@ -0,0 +1,42 @@
1
+ import type { Address } from '../shared/shared.js';
2
+ import type { SpokeChainKey } from '../chains/chains.js';
3
+ /**
4
+ * Stable identifier for a deployed delivery-hook contract. The string value is the discriminant
5
+ * used by the SDK's hook resolver (`EvmSolverService.resolveDeliveryHook`) to pick the codec.
6
+ */
7
+ export declare const HookKind: {
8
+ /** Deposits delivered USDC into the recipient's HyperCore perps account (HyperEVM). */
9
+ readonly HYPERCORE_DEPOSIT: "hyperCoreDeposit";
10
+ };
11
+ export type HookKind = (typeof HookKind)[keyof typeof HookKind];
12
+ export type SpokeHookConfig = {
13
+ kind: HookKind;
14
+ /** Deployed hook contract address on the chain it is registered under. */
15
+ address: Address;
16
+ /**
17
+ * Spoke-token addresses (on the hook's own chain) this hook accepts as the delivered output.
18
+ * `undefined` means no token restriction. HyperCore, for example, only credits USDC. Reference
19
+ * the canonical token addresses from `spokeChainConfig` rather than hardcoding literals.
20
+ */
21
+ supportedTokens?: readonly string[];
22
+ };
23
+ /**
24
+ * Deployed delivery hooks, keyed by the chain they live on. Many hooks per chain and many chains
25
+ * are supported — add an entry to grow coverage. `Partial` because most chains have no hooks.
26
+ */
27
+ export declare const spokeHooks: {
28
+ readonly hyper: readonly [{
29
+ readonly kind: "hyperCoreDeposit";
30
+ readonly address: "0xc79224a4DEE653C9a26572B941149d95a88432c4";
31
+ readonly supportedTokens: readonly ["0xb88339CB7199b77E23DB6E890353E22632Ba630f"];
32
+ }];
33
+ };
34
+ /** Returns the deployed hook of the given kind on `chainKey`, or `undefined` if none is registered. */
35
+ export declare const getSpokeHook: (chainKey: SpokeChainKey, kind: HookKind) => SpokeHookConfig | undefined;
36
+ /** Returns every hook deployed on `chainKey` (empty when none). */
37
+ export declare const getSpokeHooks: (chainKey: SpokeChainKey) => readonly SpokeHookConfig[];
38
+ /**
39
+ * Whether a hook of `kind` on `chainKey` accepts `token` (case-insensitive) as the delivered output.
40
+ * `false` when the hook is not deployed there; `true` when the hook has no token restriction.
41
+ */
42
+ export declare const isHookSupportedToken: (chainKey: SpokeChainKey, kind: HookKind, token: string) => boolean;
@@ -0,0 +1,44 @@
1
+ // Delivery-hook registry for solver intents.
2
+ //
3
+ // When an intent's output is delivered on a spoke chain, the `SpokeAssetManager` can call
4
+ // `ISpokeReceiver(dstAddress).hook(token, amount, deliveryData)` instead of transferring the
5
+ // tokens straight to the recipient. Each deployed hook contract is identified here by a stable
6
+ // `HookKind` plus its per-chain address, so consumers never hardcode addresses and the address
7
+ // can never drift from the payload codec that targets it (the codec lives in `@sodax/sdk`).
8
+ import { ChainKeys, spokeChainConfig } from '../chains/chains.js';
9
+ /**
10
+ * Stable identifier for a deployed delivery-hook contract. The string value is the discriminant
11
+ * used by the SDK's hook resolver (`EvmSolverService.resolveDeliveryHook`) to pick the codec.
12
+ */
13
+ export const HookKind = {
14
+ /** Deposits delivered USDC into the recipient's HyperCore perps account (HyperEVM). */
15
+ HYPERCORE_DEPOSIT: 'hyperCoreDeposit',
16
+ };
17
+ /**
18
+ * Deployed delivery hooks, keyed by the chain they live on. Many hooks per chain and many chains
19
+ * are supported — add an entry to grow coverage. `Partial` because most chains have no hooks.
20
+ */
21
+ export const spokeHooks = {
22
+ [ChainKeys.HYPEREVM_MAINNET]: [
23
+ {
24
+ kind: HookKind.HYPERCORE_DEPOSIT,
25
+ address: '0xc79224a4DEE653C9a26572B941149d95a88432c4',
26
+ supportedTokens: [spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDC.address], // USDC on HyperEVM
27
+ },
28
+ ],
29
+ };
30
+ /** Returns the deployed hook of the given kind on `chainKey`, or `undefined` if none is registered. */
31
+ export const getSpokeHook = (chainKey, kind) => spokeHooks[chainKey]?.find(h => h.kind === kind);
32
+ /** Returns every hook deployed on `chainKey` (empty when none). */
33
+ export const getSpokeHooks = (chainKey) => spokeHooks[chainKey] ?? [];
34
+ /**
35
+ * Whether a hook of `kind` on `chainKey` accepts `token` (case-insensitive) as the delivered output.
36
+ * `false` when the hook is not deployed there; `true` when the hook has no token restriction.
37
+ */
38
+ export const isHookSupportedToken = (chainKey, kind, token) => {
39
+ const hook = getSpokeHook(chainKey, kind);
40
+ if (!hook) {
41
+ return false;
42
+ }
43
+ return !hook.supportedTokens || hook.supportedTokens.some(t => t.toLowerCase() === token.toLowerCase());
44
+ };
@@ -0,0 +1 @@
1
+ export * from './hooks.js';
@@ -0,0 +1 @@
1
+ export * from './hooks.js';
package/dist/index.d.ts CHANGED
@@ -6,9 +6,11 @@ export * from './backend/index.js';
6
6
  export * from './bitcoin/index.js';
7
7
  export * from './dex/index.js';
8
8
  export * from './evm/index.js';
9
+ export * from './hooks/index.js';
9
10
  export * from './icon/index.js';
10
11
  export * from './injective/index.js';
11
12
  export * from './moneyMarket/index.js';
13
+ export * from './leverageYield/index.js';
12
14
  export * from './near/index.js';
13
15
  export * from './solana/index.js';
14
16
  export * from './stacks/index.js';
@@ -17,4 +19,4 @@ export * from './sui/index.js';
17
19
  export * from './swap/index.js';
18
20
  export * from './utils/index.js';
19
21
  export * from './wallet/index.js';
20
- export declare const CONFIG_VERSION = 207;
22
+ export declare const CONFIG_VERSION = 220;
package/dist/index.js CHANGED
@@ -6,9 +6,11 @@ export * from './backend/index.js';
6
6
  export * from './bitcoin/index.js';
7
7
  export * from './dex/index.js';
8
8
  export * from './evm/index.js';
9
+ export * from './hooks/index.js';
9
10
  export * from './icon/index.js';
10
11
  export * from './injective/index.js';
11
12
  export * from './moneyMarket/index.js';
13
+ export * from './leverageYield/index.js';
12
14
  export * from './near/index.js';
13
15
  export * from './solana/index.js';
14
16
  export * from './stacks/index.js';
@@ -17,4 +19,4 @@ export * from './sui/index.js';
17
19
  export * from './swap/index.js';
18
20
  export * from './utils/index.js';
19
21
  export * from './wallet/index.js';
20
- export const CONFIG_VERSION = 207; // this value should be incremented (inside release/sdk branch) each time @sodax/types package is updated
22
+ export const CONFIG_VERSION = 220; // this value should be incremented (inside release/sdk branch) each time @sodax/types package is updated
@@ -99,4 +99,8 @@ export interface IInjectiveWalletProvider extends ICoreWallet {
99
99
  readonly chainType: 'INJECTIVE';
100
100
  getWalletAddress: () => Promise<InjectiveEoaAddress>;
101
101
  execute: (senderAddress: InjectiveEoaAddress, contractAddress: string, msg: JsonObject, funds?: InjectiveCoin[]) => Promise<InjectiveExecuteResponse>;
102
+ /** Broadcast an already-signed, proto-encoded Cosmos `TxRaw`. Returns the tx hash. */
103
+ sendTransaction?: (signedTxRaw: Uint8Array) => Promise<string>;
104
+ /** Sign and broadcast an unsigned `InjectiveRawTransaction` (e.g. from the Swaps API). Returns the tx hash. */
105
+ signAndSendTransaction?: (tx: InjectiveRawTransaction) => Promise<string>;
102
106
  }
@@ -0,0 +1 @@
1
+ export * from './leverageYield.js';
@@ -0,0 +1 @@
1
+ export * from './leverageYield.js';