File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ type PositionsCreateWithEthForPolygon = (options: {
26
26
} >
27
27
28
28
export const positionsCreateWithEth : PositionsCreateWithEthForPolygon = async (
29
- options
29
+ options ,
30
30
) => {
31
31
const [ , l2 , weth ] = await clientsUtilsSwapForStake ( options . provider )
32
32
@@ -60,7 +60,9 @@ export const positionsCreateWithEth: PositionsCreateWithEthForPolygon = async (
60
60
callback : async ( ) => {
61
61
const deadline = options . deadline
62
62
? options . deadline
63
- : ( await options . provider . getBlock ( 'latest' ) ) . timestamp + 300
63
+ : ( ( await options . provider . provider ?. getBlock ( 'latest' ) )
64
+ ?. timestamp ?? Math . floor ( new Date ( ) . getTime ( ) / 1000 ) ) +
65
+ 300
64
66
return options . gatewayAddress &&
65
67
typeof options . gatewayBasisPoints === 'number'
66
68
? l2 . swapEthAndStakeDevPolygonCaller (
@@ -70,14 +72,14 @@ export const positionsCreateWithEth: PositionsCreateWithEthForPolygon = async (
70
72
options . payload ?? ZeroHash ,
71
73
_overrides ,
72
74
options . gatewayAddress ,
73
- String ( options . gatewayBasisPoints )
75
+ String ( options . gatewayBasisPoints ) ,
74
76
)
75
77
: l2 . swapEthAndStakeDevPolygonCaller (
76
78
options . destination ,
77
79
ethAmount ,
78
80
deadline ,
79
81
options . payload ?? ZeroHash ,
80
- _overrides
82
+ _overrides ,
81
83
)
82
84
} ,
83
85
} )
You can’t perform that action at this time.
0 commit comments