Skip to content

Commit 96de6d5

Browse files
committed
add withdrawByPosition for L1 and L2
1 parent 1eea6fa commit 96de6d5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { getLockupContract } from './common'
2+
import { Provider } from '@ethersproject/abstract-provider'
3+
4+
type Options = {
5+
readonly provider: Provider
6+
readonly positionTokenId: string
7+
readonly amount: string
8+
}
9+
10+
export const withdrawByPosition = async (
11+
options: Options
12+
): Promise<boolean | undefined> => {
13+
const lockupContract = await getLockupContract(options.provider)
14+
return lockupContract
15+
? await lockupContract.withdrawByPosition(
16+
options.positionTokenId,
17+
options.amount
18+
)
19+
: undefined
20+
}

0 commit comments

Comments
 (0)