Skip to content

Commit 32b0e5d

Browse files
authored
Update mainnet 1inch api version (#3934)
1 parent 9599631 commit 32b0e5d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

actions/aave-like/helpers/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function swapCall(
7272
NetworkIds.BASEMAINNET,
7373
].includes(network)
7474
? 'v5.0'
75-
: 'v4.0'
75+
: 'v4.1'
7676
return getOneInchCall(swapAddress, network, oneInchVersion)
7777
}
7878

features/exchange/exchange.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { Dictionary } from 'ts-essentials'
1212

1313
import { amountFromWei, amountToWei } from '@oasisdex/utils/lib/src/utils'
1414

15-
const PROXY_API_ENDPOINT_SWAP = `/api/exchange/v4.0/1/swap`
15+
const PROXY_API_ENDPOINT_SWAP = `/api/exchange/v4.1/1/swap`
1616

1717
interface Response {
1818
fromToken: TokenDescriptor

features/omni-kit/constants.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ export const omniSwapProtocolsMap: NetworkIdsWithValues<string[]> = {
4949
[NetworkIds.GOERLI]: [],
5050
}
5151

52-
export const omniSwapVersionMap: NetworkIdsWithValues<'v4.0' | 'v5.0'> = {
53-
[NetworkIds.MAINNET]: 'v4.0',
52+
export const omniSwapVersionMap: NetworkIdsWithValues<'v4.1' | 'v5.0'> = {
53+
[NetworkIds.MAINNET]: 'v4.1',
5454
[NetworkIds.BASEMAINNET]: 'v5.0',
5555
[NetworkIds.OPTIMISMMAINNET]: 'v5.0',
5656
[NetworkIds.ARBITRUMMAINNET]: 'v5.0',
57-
[NetworkIds.GOERLI]: 'v4.0', // doesn't matter
57+
[NetworkIds.GOERLI]: 'v4.1', // doesn't matter
5858
}
5959

6060
export const omniNetworkMap: NetworkIdsWithValues<Network> = {

helpers/swap.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function swapOneInchTokens(
1717
recipient: string,
1818
slippage: string,
1919
chainId: number,
20-
oneInchVersion: 'v4.0' | 'v5.0',
20+
oneInchVersion: 'v4.1' | 'v5.0',
2121
protocols: string[] = [],
2222
): Promise<any> {
2323
const url = formatOneInchSwapUrl(
@@ -43,7 +43,7 @@ function formatOneInchSwapUrl(
4343
slippage: string,
4444
recepient: string,
4545
chainId: number,
46-
oneInchVersion: 'v4.0' | 'v5.0',
46+
oneInchVersion: 'v4.1' | 'v5.0',
4747
protocols: string[] = [],
4848
) {
4949
const protocolsParam = !protocols?.length ? '' : `&protocols=${protocols.join(',')}`
@@ -84,7 +84,7 @@ export async function oneInchCallMock(
8484
export function getOneInchCall(
8585
swapAddress: string,
8686
networkId: NetworkIds = NetworkIds.MAINNET,
87-
oneInchVersion: 'v4.0' | 'v5.0' = 'v4.0',
87+
oneInchVersion: 'v4.1' | 'v5.0' = 'v4.1',
8888
debug?: true,
8989
) {
9090
return async (

0 commit comments

Comments
 (0)