This repository was archived by the owner on Jun 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
2
2
import { TransactionResponse } from '@ethersproject/providers'
3
3
import { Percent } from '@uniswap/sdk-core'
4
4
import { SwapRouter , UNIVERSAL_ROUTER_ADDRESS } from '@uniswap/universal-router-sdk'
5
- import { FeeOptions } from '@uniswap/v3-sdk'
5
+ import { FeeOptions , toHex } from '@uniswap/v3-sdk'
6
6
import { useWeb3React } from '@web3-react/core'
7
7
import { useCallback } from 'react'
8
8
import { InterfaceTrade } from 'state/routing/types'
@@ -35,19 +35,13 @@ export function useUniversalRouterSwapCallback(trade: InterfaceTrade | undefined
35
35
inputTokenPermit : options . permit ,
36
36
fee : options . feeOptions ,
37
37
} )
38
- const tx =
39
- value && ! isZero ( value )
40
- ? {
41
- from : account ,
42
- to : UNIVERSAL_ROUTER_ADDRESS ( chainId ) ,
43
- data,
44
- value,
45
- }
46
- : {
47
- from : account ,
48
- to : UNIVERSAL_ROUTER_ADDRESS ( chainId ) ,
49
- data,
50
- }
38
+ const tx = {
39
+ from : account ,
40
+ to : UNIVERSAL_ROUTER_ADDRESS ( chainId ) ,
41
+ data,
42
+ // TODO: universal-router-sdk returns a non-hexlified value.
43
+ ...( value && ! isZero ( value ) ? { value : toHex ( value ) } : { } ) ,
44
+ }
51
45
52
46
let gasEstimate : BigNumber
53
47
try {
You can’t perform that action at this time.
0 commit comments