Skip to content

Commit 7735190

Browse files
committed
add calculateWithdrawableInterestAmountByPosition function for L1 and L2
1 parent d44a19b commit 7735190

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
}
8+
9+
export const calculateWithdrawableInterestAmountByPosition = async (
10+
options: Options
11+
): Promise<string | undefined> => {
12+
const lockupContract = await getLockupContract(options.provider)
13+
return lockupContract
14+
? lockupContract.calculateWithdrawableInterestAmountByPosition(
15+
options.positionTokenId
16+
)
17+
: undefined
18+
}

0 commit comments

Comments
 (0)