File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ type PositionsCreateWithEthForPolygon = (options: {
2626} >
2727
2828export const positionsCreateWithEth : PositionsCreateWithEthForPolygon = async (
29- options
29+ options ,
3030) => {
3131 const [ , l2 , weth ] = await clientsUtilsSwapForStake ( options . provider )
3232
@@ -60,7 +60,9 @@ export const positionsCreateWithEth: PositionsCreateWithEthForPolygon = async (
6060 callback : async ( ) => {
6161 const deadline = options . deadline
6262 ? 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
6466 return options . gatewayAddress &&
6567 typeof options . gatewayBasisPoints === 'number'
6668 ? l2 . swapEthAndStakeDevPolygonCaller (
@@ -70,14 +72,14 @@ export const positionsCreateWithEth: PositionsCreateWithEthForPolygon = async (
7072 options . payload ?? ZeroHash ,
7173 _overrides ,
7274 options . gatewayAddress ,
73- String ( options . gatewayBasisPoints )
75+ String ( options . gatewayBasisPoints ) ,
7476 )
7577 : l2 . swapEthAndStakeDevPolygonCaller (
7678 options . destination ,
7779 ethAmount ,
7880 deadline ,
7981 options . payload ?? ZeroHash ,
80- _overrides
82+ _overrides ,
8183 )
8284 } ,
8385 } )
You can’t perform that action at this time.
0 commit comments