Skip to content

Commit 3ea8066

Browse files
committed
change return value to undefined
1 parent dae15e4 commit 3ea8066

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lib/agent/lockup/positionsCreate.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@ import { TransactionResponse } from '@ethersproject/abstract-provider'
22
import { getLockupContract } from './common'
33
import { Provider } from '@ethersproject/abstract-provider'
44
import { FallbackableOverrides } from '../../common/utils/execute'
5+
import { Wallet } from 'ethers'
6+
57

68
export type Options = {
7-
readonly provider: Provider
9+
readonly wallet: Wallet
810
readonly propertyAddress: string
911
readonly amount: string
1012
readonly overrides?: FallbackableOverrides
1113
}
1214

1315
type PositionsCreate = (
1416
options: Options
15-
) => Promise<TransactionResponse | Error>
17+
) => Promise<TransactionResponse | undefined>
1618

1719
export const positionsCreate: PositionsCreate = async (
1820
options: Options
19-
): Promise<TransactionResponse | Error> => {
20-
const lockupContract = await getLockupContract(options.provider)
21+
): Promise<TransactionResponse | undefined> => {
22+
const lockupContract = await getLockupContract(options.wallet)
2123

2224
return lockupContract
2325
? await lockupContract.depositToProperty(
2426
options.propertyAddress,
2527
options.amount
2628
)
27-
: new Error('network is not valid')
29+
: undefined
2830
}

0 commit comments

Comments
 (0)