Skip to content

Commit 5b5a603

Browse files
committed
fix typing issue
1 parent 54d28d5 commit 5b5a603

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/agent/positionsCreateWithEthForPolygon.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type PositionsCreateWithEthForPolygon = (options: {
2626
}>
2727

2828
export 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
})

0 commit comments

Comments
 (0)