@openocean.finance/widget 1.0.43 → 1.0.44

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 (145) hide show
  1. package/dist/esm/App.js.map +1 -1
  2. package/dist/esm/AppDrawer.style.d.ts +1 -1
  3. package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
  4. package/dist/esm/components/AmountInput/AmountInput.style.d.ts +1 -1
  5. package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
  6. package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +37 -33
  7. package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
  8. package/dist/esm/components/Avatar/Avatar.style.d.ts +1 -1
  9. package/dist/esm/components/Avatar/SmallAvatar.d.ts +1 -1
  10. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +1 -1
  11. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
  12. package/dist/esm/components/ButtonTertiary.d.ts +1 -1
  13. package/dist/esm/components/Card/CardHeader.d.ts +1 -1
  14. package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
  15. package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +1 -1
  16. package/dist/esm/components/Header/Header.style.d.ts +2 -2
  17. package/dist/esm/components/Header/SettingsButton.style.d.ts +2 -2
  18. package/dist/esm/components/ListItem/ListItem.d.ts +1 -1
  19. package/dist/esm/components/Messages/WarningMessages.js +1 -0
  20. package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
  21. package/dist/esm/components/Messages/useMessageQueue.js +1 -1
  22. package/dist/esm/components/Messages/useMessageQueue.js.map +1 -1
  23. package/dist/esm/components/Search/SearchInput.style.d.ts +1 -1
  24. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  25. package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  26. package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +2 -2
  27. package/dist/esm/components/StepActions/StepActions.style.d.ts +1 -1
  28. package/dist/esm/components/Tabs/Tabs.style.d.ts +2 -2
  29. package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -2
  30. package/dist/esm/components/TransactionDetails.js +1 -1
  31. package/dist/esm/components/TransactionDetails.js.map +1 -1
  32. package/dist/esm/config/defaultChainIds.js +3 -0
  33. package/dist/esm/config/defaultChainIds.js.map +1 -1
  34. package/dist/esm/config/version.d.ts +1 -1
  35. package/dist/esm/config/version.js +1 -1
  36. package/dist/esm/cross/adapters/AcrossAdapter.js +21 -22
  37. package/dist/esm/cross/adapters/AcrossAdapter.js.map +1 -1
  38. package/dist/esm/cross/adapters/BaseSwapAdapter.d.ts +17 -9
  39. package/dist/esm/cross/adapters/BaseSwapAdapter.js +15 -4
  40. package/dist/esm/cross/adapters/BaseSwapAdapter.js.map +1 -1
  41. package/dist/esm/cross/adapters/DebridgeAdapter.js +8 -7
  42. package/dist/esm/cross/adapters/DebridgeAdapter.js.map +1 -1
  43. package/dist/esm/cross/adapters/LifiAdapter.js +7 -6
  44. package/dist/esm/cross/adapters/LifiAdapter.js.map +1 -1
  45. package/dist/esm/cross/adapters/MayanAdapter.js +1 -2
  46. package/dist/esm/cross/adapters/MayanAdapter.js.map +1 -1
  47. package/dist/esm/cross/adapters/NearIntentsAdapter.d.ts +13 -6
  48. package/dist/esm/cross/adapters/NearIntentsAdapter.js +252 -75
  49. package/dist/esm/cross/adapters/NearIntentsAdapter.js.map +1 -1
  50. package/dist/esm/cross/adapters/OptimexAdapter.js +2 -1
  51. package/dist/esm/cross/adapters/OptimexAdapter.js.map +1 -1
  52. package/dist/esm/cross/adapters/OrbiterAdapter.js +9 -8
  53. package/dist/esm/cross/adapters/OrbiterAdapter.js.map +1 -1
  54. package/dist/esm/cross/adapters/RelayAdapter.js +46 -15
  55. package/dist/esm/cross/adapters/RelayAdapter.js.map +1 -1
  56. package/dist/esm/cross/adapters/SymbiosisAdapter.js +13 -14
  57. package/dist/esm/cross/adapters/SymbiosisAdapter.js.map +1 -1
  58. package/dist/esm/cross/adapters/XYFinanceAdapter.js +13 -17
  59. package/dist/esm/cross/adapters/XYFinanceAdapter.js.map +1 -1
  60. package/dist/esm/cross/adapters/index.d.ts +2 -0
  61. package/dist/esm/cross/adapters/index.js +2 -1
  62. package/dist/esm/cross/adapters/index.js.map +1 -1
  63. package/dist/esm/cross/constants/index.d.ts +3 -1
  64. package/dist/esm/cross/constants/index.js +2 -0
  65. package/dist/esm/cross/constants/index.js.map +1 -1
  66. package/dist/esm/cross/crossChainQuote.d.ts +1 -1
  67. package/dist/esm/cross/crossChainQuote.js +22 -12
  68. package/dist/esm/cross/crossChainQuote.js.map +1 -1
  69. package/dist/esm/cross/factory.d.ts +3 -1
  70. package/dist/esm/cross/factory.js +10 -12
  71. package/dist/esm/cross/factory.js.map +1 -1
  72. package/dist/esm/cross/registry.d.ts +1 -1
  73. package/dist/esm/hooks/useAvailableChains.js +47 -40
  74. package/dist/esm/hooks/useAvailableChains.js.map +1 -1
  75. package/dist/esm/hooks/useChains.js.map +1 -1
  76. package/dist/esm/hooks/useRoutes.js +11 -3
  77. package/dist/esm/hooks/useRoutes.js.map +1 -1
  78. package/dist/esm/hooks/useTokenAddressBalance.js.map +1 -1
  79. package/dist/esm/hooks/useTokens.d.ts +1 -0
  80. package/dist/esm/hooks/useTokens.js +14 -0
  81. package/dist/esm/hooks/useTokens.js.map +1 -1
  82. package/dist/esm/index.js.map +1 -1
  83. package/dist/esm/pages/MainPage/MainWarningMessages.js.map +1 -1
  84. package/dist/esm/pages/SendToWallet/BookmarksPage.js +1 -1
  85. package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
  86. package/dist/esm/pages/SendToWallet/RecentWalletsPage.js +2 -2
  87. package/dist/esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -1
  88. package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js +2 -2
  89. package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js.map +1 -1
  90. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +4 -4
  91. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
  92. package/dist/esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
  93. package/dist/esm/services/ExecuteRoute.js +218 -9
  94. package/dist/esm/services/ExecuteRoute.js.map +1 -1
  95. package/dist/esm/services/OpenOceanService.js +30 -4
  96. package/dist/esm/services/OpenOceanService.js.map +1 -1
  97. package/dist/esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
  98. package/dist/esm/utils/chainType.d.ts +1 -0
  99. package/dist/esm/utils/chainType.js +15 -0
  100. package/dist/esm/utils/chainType.js.map +1 -1
  101. package/dist/esm/utils/getPriceImpact.js +3 -3
  102. package/dist/esm/utils/getPriceImpact.js.map +1 -1
  103. package/package.json +18 -6
  104. package/src/App.tsx +0 -1
  105. package/src/components/AmountInput/AmountInputEndAdornment.tsx +39 -34
  106. package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +3 -2
  107. package/src/components/Messages/WarningMessages.tsx +1 -0
  108. package/src/components/Messages/useMessageQueue.ts +1 -1
  109. package/src/components/TransactionDetails.tsx +4 -4
  110. package/src/config/defaultChainIds.ts +3 -0
  111. package/src/config/version.ts +1 -1
  112. package/src/cross/adapters/AcrossAdapter.ts +21 -22
  113. package/src/cross/adapters/BaseSwapAdapter.ts +24 -8
  114. package/src/cross/adapters/DebridgeAdapter.ts +11 -11
  115. package/src/cross/adapters/LifiAdapter.ts +11 -10
  116. package/src/cross/adapters/MayanAdapter.ts +1 -2
  117. package/src/cross/adapters/NearIntentsAdapter.ts +303 -129
  118. package/src/cross/adapters/OptimexAdapter.ts +12 -11
  119. package/src/cross/adapters/OrbiterAdapter.ts +17 -16
  120. package/src/cross/adapters/RelayAdapter.ts +50 -17
  121. package/src/cross/adapters/SymbiosisAdapter.ts +13 -14
  122. package/src/cross/adapters/XYFinanceAdapter.ts +15 -19
  123. package/src/cross/adapters/index.ts +2 -1
  124. package/src/cross/constants/index.ts +4 -0
  125. package/src/cross/crossChainQuote.ts +27 -21
  126. package/src/cross/factory.ts +12 -12
  127. package/src/cross/registry.ts +1 -1
  128. package/src/hooks/useAvailableChains.ts +50 -43
  129. package/src/hooks/useChains.ts +0 -1
  130. package/src/hooks/useExplorer.ts +6 -6
  131. package/src/hooks/useRoutes.ts +12 -4
  132. package/src/hooks/useTokenAddressBalance.ts +1 -1
  133. package/src/hooks/useTokens.ts +20 -5
  134. package/src/index.ts +0 -1
  135. package/src/pages/MainPage/MainWarningMessages.tsx +0 -1
  136. package/src/pages/SendToWallet/BookmarksPage.tsx +1 -1
  137. package/src/pages/SendToWallet/RecentWalletsPage.tsx +2 -2
  138. package/src/pages/SendToWallet/SendToConfiguredWalletPage.tsx +2 -2
  139. package/src/providers/WidgetProvider/WidgetProvider.tsx +0 -1
  140. package/src/services/ExecuteRoute.ts +315 -64
  141. package/src/services/OpenOceanService.ts +31 -7
  142. package/src/stores/bookmarks/createBookmarkStore.ts +15 -15
  143. package/src/utils/chainType.ts +25 -1
  144. package/src/utils/getPriceImpact.ts +3 -3
  145. package/dist/tsconfig.tsbuildinfo +0 -1
package/src/App.tsx CHANGED
@@ -25,7 +25,6 @@ export const App = forwardRef<WidgetDrawer, WidgetProps>((props, ref) => {
25
25
  },
26
26
  }
27
27
  }
28
-
29
28
  // config.subvariant = 'bridge'
30
29
  // config.subvariantOptions = {
31
30
  // custom: 'checkout',
@@ -66,6 +66,9 @@ export const AmountInputEndAdornment = ({ formType }: FormTypeProps) => {
66
66
  ) {
67
67
  return 0n
68
68
  }
69
+ if(!token){
70
+ return 0n
71
+ }
69
72
  let srcChainTokenInAmount: any = token.amount || 0
70
73
  const asUsd =
71
74
  Number(token.priceUSD) * (Number(token.amount) / 10 ** token.decimals)
@@ -99,42 +102,44 @@ export const AmountInputEndAdornment = ({ formType }: FormTypeProps) => {
99
102
 
100
103
  const chain = getChainById(fromChainId)
101
104
  let maxAmount = token.amount
102
-
103
105
  let gas = 0n
104
- // if (
105
- // state === 'bridge' &&
106
- // fromChainId !== toChainId &&
107
- // fromTokenAddress &&
108
- // toTokenAddress
109
- // ) {
110
- // if (routes) {
111
- // const router: any = routes[0] || {
112
- // toAmount: 0,
113
- // toToken: { decimals: 18 },
114
- // }
115
- // if (
116
- // router &&
117
- // router.data &&
118
- // router.data.prependedOperatingExpenseCost
119
- // ) {
120
- // prependedOperatingExpenseCost =
121
- // router.data.prependedOperatingExpenseCost
122
- // }
123
- // }
106
+ if (
107
+ state === 'bridge' &&
108
+ fromChainId !== toChainId &&
109
+ fromTokenAddress &&
110
+ toTokenAddress
111
+ ) {
112
+ // if(fromChainId === 20000000000001) {
113
+ // gas = 22000n
114
+ // }
115
+ // if (routes) {
116
+ // const router: any = routes[0] || {
117
+ // toAmount: 0,
118
+ // toToken: { decimals: 18 },
119
+ // }
120
+ // if (
121
+ // router &&
122
+ // router.data &&
123
+ // router.data.prependedOperatingExpenseCost
124
+ // ) {
125
+ // prependedOperatingExpenseCost =
126
+ // router.data.prependedOperatingExpenseCost
127
+ // }
128
+ // }
124
129
 
125
- // gas = BigInt(
126
- // Number.parseInt(
127
- // (1.15 * Number(prependedOperatingExpenseCost)).toString()
128
- // )
129
- // )
130
- // if (chain?.nativeToken?.address === fromTokenAddress) {
131
- // if (fromChainId === 1151111081099710) {
132
- // gas += 15000000n + (8157120n + 4000000n + 890880n)
133
- // } else if (fromChainId === 8453) {
134
- // gas += 1000000000000000n + 1000000000000n
135
- // }
136
- // }
137
- // }
130
+ // gas = BigInt(
131
+ // Number.parseInt(
132
+ // (1.15 * Number(prependedOperatingExpenseCost)).toString()
133
+ // )
134
+ // )
135
+ // if (chain?.nativeToken?.address === fromTokenAddress) {
136
+ // if (fromChainId === 1151111081099710) {
137
+ // gas += 15000000n + (8157120n + 4000000n + 890880n)
138
+ // } else if (fromChainId === 8453) {
139
+ // gas += 1000000000000000n + 1000000000000n
140
+ // }
141
+ // }
142
+ }
138
143
 
139
144
  if (state === 'swap' || fromChainId === toChainId) {
140
145
  if (
@@ -18,14 +18,15 @@ export const BaseTransactionButton: React.FC<BaseTransactionButtonProps> = ({
18
18
  const [fromChainId] = useFieldValues('fromChain')
19
19
  const { chain } = useChain(fromChainId)
20
20
  const { account } = useAccount({ chainType: chain?.chainType })
21
-
22
21
  const handleClick = async () => {
23
22
  if (account.isConnected) {
24
23
  onClick?.()
25
24
  } else if (walletConfig?.onConnect) {
26
25
  walletConfig.onConnect()
27
26
  } else {
28
- openWalletMenu()
27
+ openWalletMenu(
28
+ chain?.chainType ? { chainType: chain.chainType } : undefined
29
+ )
29
30
  }
30
31
  }
31
32
 
@@ -52,6 +52,7 @@ export const WarningMessages: React.FC<WarningMessagesProps> = ({
52
52
  />
53
53
  )
54
54
  case 'TO_ADDRESS_REQUIRED':
55
+ // return <ToAddressRequiredMessage {...props} />
55
56
  const fromChainId = route?.fromChainId
56
57
  const toChainId = route?.toChainId
57
58
  if (fromChainId && toChainId && fromChainId !== toChainId) {
@@ -12,7 +12,7 @@ import { useServerErrorStore } from '../../stores/useServerErrorStore.js'
12
12
  export const useStorePriceImpactAcknowledged = create((set) => ({
13
13
  priceImpactAcknowledged: false,
14
14
  setPriceImpactAcknowledged: (v: boolean) =>
15
- set((state) => {
15
+ set(() => {
16
16
  return {
17
17
  priceImpactAcknowledged: v,
18
18
  }
@@ -68,10 +68,10 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
68
68
  }
69
69
 
70
70
  let gasCostUSD = 0
71
- const feeCosts = []
71
+ const feeCosts:any = []
72
72
  const combinedFeesUSD =
73
- gasCostUSD + feeCosts.reduce((sum, fee) => sum + fee.costUSD, 0)
74
- const feeCostUSD = feeCosts.reduce((sum, fee) => sum + fee.costUSD, 0)
73
+ gasCostUSD + feeCosts.reduce((sum:number, fee:any) => sum + fee.costUSD, 0)
74
+ const feeCostUSD = feeCosts.reduce((sum:number, fee:any) => sum + fee.costUSD, 0)
75
75
  const estimatedGas =
76
76
  (route as any)?.estimatedGas || (route as any)?.data?.estimatedGas
77
77
  if (token && gasPrice && estimatedGas) {
@@ -317,7 +317,7 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
317
317
  </Typography>
318
318
  <Typography variant="body2" sx={{ fontWeight: 600 }}>
319
319
  {t('format.percent', {
320
- value: route.steps[0].action.slippage / 100,
320
+ value: route.steps[0]?.action?.slippage ? route.steps[0].action.slippage / 100 : 0,
321
321
  })}
322
322
  </Typography>
323
323
  </Box>
@@ -40,4 +40,7 @@ export const DEFAULT_CHAIN_IDS = [
40
40
  9745, // Plasma
41
41
  98866, // Plume
42
42
  239, // Tac
43
+ 143, // Monad
44
+ 20000000000001, // Bitcoin
45
+ 20000000000006, // Near
43
46
  ];
@@ -1,2 +1,2 @@
1
1
  export const name = '@openocean.finance/widget'
2
- export const version = '1.0.43'
2
+ export const version = '1.0.44'
@@ -22,19 +22,19 @@ import {
22
22
  const transferFunction = 'function transfer(address to, uint256 amount)'
23
23
 
24
24
  // Create Interface instances
25
- const erc20Interface = new ethers.utils.Interface([transferFunction])
25
+ const erc20Interface = new ethers.Interface([transferFunction])
26
26
 
27
27
  const multicalHandlerContract: Record<string, `0x${string}`> = {
28
- [ChainId.MAINNET]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
29
- [ChainId.ARBITRUM]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
30
- [ChainId.OPTIMISM]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
31
- [ChainId.LINEA]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
32
- [ChainId.MATIC]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
33
- [ChainId.ZKSYNC]: '0x863859ef502F0Ee9676626ED5B418037252eFeb2',
34
- [ChainId.BASE]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
35
- [ChainId.SCROLL]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
36
- [ChainId.BLAST]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
37
- [ChainId.UNICHAIN]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
28
+ [ChainId.ETH]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
29
+ [ChainId.ARB]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
30
+ [ChainId.OPT]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
31
+ [ChainId.LNA]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
32
+ [ChainId.POL]: '0x924a9f036260DdD5808007E1AA95f08eD08aA569',
33
+ // [ChainId.ZKSYNC]: '0x863859ef502F0Ee9676626ED5B418037252eFeb2',
34
+ [ChainId.BAS]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
35
+ [ChainId.SCL]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
36
+ [ChainId.BLS]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
37
+ [ChainId.UNI]: '0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB',
38
38
  }
39
39
 
40
40
  export class AcrossAdapter extends BaseSwapAdapter {
@@ -46,7 +46,7 @@ export class AcrossAdapter extends BaseSwapAdapter {
46
46
  integratorId: `0x008a`,
47
47
  chains: [mainnet, arbitrum, optimism, linea, polygon, zksync, base, scroll, blast, unichain],
48
48
  rpcUrls: {
49
- [ChainId.BASE]: 'https://base.drpc.org',
49
+ [ChainId.BAS]: 'https://base.drpc.org',
50
50
  },
51
51
  })
52
52
  }
@@ -59,16 +59,15 @@ export class AcrossAdapter extends BaseSwapAdapter {
59
59
  }
60
60
  getSupportedChains(): Chain[] {
61
61
  return [
62
- ChainId.MAINNET,
63
- ChainId.ARBITRUM,
64
- ChainId.OPTIMISM,
65
- ChainId.LINEA,
66
- ChainId.MATIC,
67
- ChainId.ZKSYNC,
68
- ChainId.BASE,
69
- ChainId.SCROLL,
70
- ChainId.BLAST,
71
- ChainId.UNICHAIN,
62
+ ChainId.ETH,
63
+ ChainId.ARB,
64
+ ChainId.OPT,
65
+ ChainId.LNA,
66
+ ChainId.POL,
67
+ ChainId.BAS,
68
+ ChainId.SCL,
69
+ ChainId.BLS,
70
+ ChainId.UNI,
72
71
  ]
73
72
  }
74
73
 
@@ -1,6 +1,6 @@
1
1
  import type { useWalletSelector } from '@near-wallet-selector/react-hook'
2
2
  import { ChainId } from '@openocean.finance/widget-sdk'
3
- import type { AdaptedWallet } from '@reservoir0x/relay-sdk'
3
+ // import type { AdaptedWallet } from '@relayprotocol/relay-sdk'
4
4
  import type { WalletAdapterProps } from '@solana/wallet-adapter-base'
5
5
  import type { Connection } from '@solana/web3.js'
6
6
  import type { WalletClient } from 'viem'
@@ -14,10 +14,14 @@ import type {
14
14
  import type { Quote } from '../registry.js'
15
15
 
16
16
  export enum NonEvmChain {
17
- Near = 'near',
17
+ Near = 20000000000006,
18
18
  Bitcoin = 20000000000001,
19
19
  Solana = 1151111081099710,
20
+ }
21
+
22
+ export enum NewEvmChain {
20
23
  Plasma = 9745,
24
+ Monad = 143,
21
25
  }
22
26
 
23
27
  export const BitcoinToken = {
@@ -27,7 +31,7 @@ export const BitcoinToken = {
27
31
  logo: 'https://storage.googleapis.com/ks-setting-1d682dca/285205e7-a16d-421c-a794-67439cd6b54f1751515894455.png',
28
32
  }
29
33
 
30
- export type Chain = ChainId | NonEvmChain
34
+ export type Chain = ChainId | NonEvmChain | NewEvmChain
31
35
  export type Currency =
32
36
  | EvmCurrency
33
37
  | NearToken
@@ -49,12 +53,22 @@ export const NonEvmChainInfo: {
49
53
  name: 'Solana',
50
54
  icon: 'https://solana.com/favicon.png',
51
55
  },
52
- [NonEvmChain.Plasma]: {
56
+ }
57
+
58
+ export const NewEvmChainInfo: {
59
+ [key in NewEvmChain]: { name: string; icon: string }
60
+ } = {
61
+ [NewEvmChain.Plasma]: {
53
62
  name: 'Plasma',
54
63
  icon: 'https://storage.googleapis.com/ks-setting-1d682dca/285205e7-a16d-421c-a794-67439cd6b54f1751515894455.png',
55
64
  },
65
+ [NewEvmChain.Monad]: {
66
+ name: 'Monad',
67
+ icon: 'https://storage.googleapis.com/ks-setting-1d682dca/285205e7-a16d-421c-a794-67439cd6b54f1751515894455.png',
68
+ },
56
69
  }
57
70
 
71
+
58
72
  export const NOT_SUPPORTED_CHAINS_PRICE_SERVICE = [
59
73
  ChainId.FTM,
60
74
  ChainId.SCL,
@@ -64,7 +78,8 @@ export const NOT_SUPPORTED_CHAINS_PRICE_SERVICE = [
64
78
  NonEvmChain.Solana,
65
79
  NonEvmChain.Bitcoin,
66
80
  NonEvmChain.Near,
67
- NonEvmChain.Plasma,
81
+ NewEvmChain.Plasma,
82
+ NewEvmChain.Monad,
68
83
  ]
69
84
 
70
85
  export interface QuoteParams {
@@ -75,12 +90,13 @@ export interface QuoteParams {
75
90
  toToken: Currency
76
91
  amount: string
77
92
  slippage: number
78
- walletClient?: AdaptedWallet | WalletClient
93
+ walletClient?: WalletClient
79
94
  tokenInUsd: number
80
95
  tokenOutUsd: number
81
96
  sender: string
82
97
  recipient: string
83
98
  publicKey?: string
99
+ isNative: boolean
84
100
  }
85
101
 
86
102
  export interface EvmQuoteParams extends QuoteParams {
@@ -89,7 +105,7 @@ export interface EvmQuoteParams extends QuoteParams {
89
105
  }
90
106
 
91
107
  export interface NearQuoteParams extends QuoteParams {
92
- nearTokens: NearToken[]
108
+ // nearTokens: NearToken[]
93
109
  }
94
110
 
95
111
  export interface NormalizedQuote {
@@ -111,7 +127,7 @@ export interface NormalizedQuote {
111
127
 
112
128
  rawQuote: any
113
129
 
114
- protocolFee: number
130
+ protocolFee: string | number
115
131
  protocolFeeString?: string
116
132
  platformFeePercent: number
117
133
  }
@@ -107,7 +107,7 @@ export class DeBridgeAdapter extends BaseSwapAdapter {
107
107
  let p: Record<string, string | boolean | number> = {
108
108
  srcChainId: mappingChainId[params.fromChain] || params.fromChain,
109
109
  srcChainTokenIn:
110
- params.fromChain === 'solana'
110
+ params.fromChain === 1151111081099710
111
111
  ? (params.fromToken as SolanaToken).id
112
112
  : fromToken.isNative
113
113
  ? ZERO_ADDRESS
@@ -117,7 +117,7 @@ export class DeBridgeAdapter extends BaseSwapAdapter {
117
117
 
118
118
  dstChainId: mappingChainId[params.toChain] || params.toChain,
119
119
  dstChainTokenOut:
120
- params.toChain === 'solana'
120
+ params.toChain === 1151111081099710
121
121
  ? (params.toToken as SolanaToken).id
122
122
  : toToken.isNative
123
123
  ? ZERO_ADDRESS
@@ -131,7 +131,7 @@ export class DeBridgeAdapter extends BaseSwapAdapter {
131
131
  referralCode: 31982,
132
132
  affiliateFeePercent: (params.feeBps * 100) / 10_000,
133
133
  affiliateFeeRecipient:
134
- params.fromChain === 'solana'
134
+ params.fromChain === 1151111081099710
135
135
  ? CROSS_CHAIN_FEE_RECEIVER_SOLANA
136
136
  : CROSS_CHAIN_FEE_RECEIVER,
137
137
  }
@@ -202,16 +202,15 @@ export class DeBridgeAdapter extends BaseSwapAdapter {
202
202
  })
203
203
 
204
204
  const nativeDecimals =
205
- params.fromChain === 'solana'
205
+ params.fromChain === 1151111081099710
206
206
  ? 9
207
207
  : NativeCurrencies[params.fromChain as ChainId].decimals
208
208
  const protocolFee =
209
209
  Number(nativePrice) * (Number(fixFee) / 10 ** nativeDecimals)
210
- const protocolFeeString = `${Number(fixFee) / 10 ** nativeDecimals} ${
211
- params.fromChain === 'solana'
212
- ? 'SOL'
213
- : NativeCurrencies[params.fromChain as ChainId].symbol
214
- }`
210
+ const protocolFeeString = `${Number(fixFee) / 10 ** nativeDecimals} ${params.fromChain === 1151111081099710
211
+ ? 'SOL'
212
+ : NativeCurrencies[params.fromChain as ChainId].symbol
213
+ }`
215
214
 
216
215
  return {
217
216
  quoteParams: params,
@@ -250,7 +249,7 @@ export class DeBridgeAdapter extends BaseSwapAdapter {
250
249
  sendSolanaFn?: WalletAdapterProps['sendTransaction'],
251
250
  solanaConnection?: Connection
252
251
  ): Promise<NormalizedTxResponse> {
253
- if (quote.quoteParams.fromChain === 'solana') {
252
+ if (quote.quoteParams.fromChain === 1151111081099710) {
254
253
  if (!solanaConnection || !sendSolanaFn)
255
254
  throw new Error('Connection is not defined for Solana swap')
256
255
  const txBuffer = Buffer.from(quote.rawQuote.tx.data.slice(2), 'hex')
@@ -343,10 +342,11 @@ export class DeBridgeAdapter extends BaseSwapAdapter {
343
342
 
344
343
  const tx = await walletClient.sendTransaction({
345
344
  chain: undefined,
346
- account,
345
+ account: account as `0x${string}`,
347
346
  to: quote.rawQuote.tx.to,
348
347
  value: BigInt(quote.rawQuote.tx.value),
349
348
  data: quote.rawQuote.tx.data,
349
+ kzg: undefined,
350
350
  })
351
351
  return {
352
352
  sender: quote.quoteParams.sender,
@@ -41,23 +41,23 @@ export class LifiAdapter extends BaseSwapAdapter {
41
41
 
42
42
  async getQuote(params: QuoteParams): Promise<NormalizedQuote> {
43
43
  const r = await getQuote({
44
- fromChain: params.fromChain === 'solana' ? 'SOL' : +params.fromChain, // Arbitrum
44
+ fromChain: params.fromChain === 1151111081099710 ? 'SOL' : +params.fromChain, // Arbitrum
45
45
  fromToken:
46
- params.fromChain === 'solana'
46
+ params.fromChain === 1151111081099710
47
47
  ? (params.fromToken as SolanaToken).id
48
48
  : (params.fromToken as any).isNative
49
- ? ZERO_ADDRESS
50
- : (params.fromToken as any).wrapped.address,
49
+ ? ZERO_ADDRESS
50
+ : (params.fromToken as any).wrapped.address,
51
51
  fromAmount: params.amount,
52
52
  fromAddress: params.sender === ZERO_ADDRESS ? CROSS_CHAIN_FEE_RECEIVER : params.sender,
53
53
 
54
- toChain: params.toChain === 'solana' ? 'SOL' : +params.toChain,
54
+ toChain: params.toChain === 1151111081099710 ? 'SOL' : +params.toChain,
55
55
  toToken:
56
- params.toChain === 'solana'
56
+ params.toChain === 1151111081099710
57
57
  ? (params.toToken as SolanaToken).id
58
58
  : (params.toToken as any).isNative
59
- ? ZERO_ADDRESS
60
- : (params.toToken as any).wrapped.address,
59
+ ? ZERO_ADDRESS
60
+ : (params.toToken as any).wrapped.address,
61
61
  toAddress: params.recipient,
62
62
  fee: params.feeBps / 10_000,
63
63
  })
@@ -181,6 +181,7 @@ export class LifiAdapter extends BaseSwapAdapter {
181
181
  to: quote.rawQuote.transactionRequest.to,
182
182
  value: BigInt(quote.rawQuote.transactionRequest.value),
183
183
  data: quote.rawQuote.transactionRequest.data,
184
+ kzg: undefined,
184
185
  })
185
186
 
186
187
  return {
@@ -200,8 +201,8 @@ export class LifiAdapter extends BaseSwapAdapter {
200
201
 
201
202
  async getTransactionStatus(p: NormalizedTxResponse): Promise<SwapStatus> {
202
203
  const res = await getStatus({
203
- fromChain: p.sourceChain === 'solana' ? 'SOL' : +p.sourceChain,
204
- toChain: p.targetChain === 'solana' ? 'SOL' : +p.targetChain,
204
+ fromChain: p.sourceChain === 1151111081099710 ? 'SOL' : +p.sourceChain,
205
+ toChain: p.targetChain === 1151111081099710 ? 'SOL' : +p.targetChain,
205
206
  txHash: p.sourceTxHash,
206
207
  })
207
208
 
@@ -110,7 +110,7 @@ export class MayanAdapter extends BaseSwapAdapter {
110
110
  contractAddress: addresses.MAYAN_FORWARDER_CONTRACT,
111
111
  rawQuote: quotes[0],
112
112
 
113
- protocolFee: quotes[0].clientRelayerFeeSuccess,
113
+ protocolFee: quotes[0].clientRelayerFeeSuccess || 0,
114
114
  platformFeePercent: (params.feeBps * 100) / 10_000,
115
115
  }
116
116
  }
@@ -142,7 +142,6 @@ export class MayanAdapter extends BaseSwapAdapter {
142
142
  // slippageBps: quote.quoteParams.slippage,
143
143
  // referrerAddress: CROSS_CHAIN_FEE_RECEIVER,
144
144
  // })
145
- // debugger
146
145
  } else {
147
146
  const res = getSwapFromEvmTxPayload(
148
147
  quote.rawQuote as MayanQuote,