on df0c310 help sign in
bridge/src/views/Release/useTransferLockup.ts
24 lines 717 B history raw
1import useEthereumTransaction from 'lib/useEthereumTransaction';
2import { useCallback } from 'react';
3import { useNetwork } from 'store/network';
4import * as need from 'lib/need';
5import { conditionalSR, linearSR } from 'azimuth-js';
7export function useTransferLockup(kind: any) {
8 const { contracts }: any = useNetwork();
10 return useEthereumTransaction(
11 useCallback(
12 (to: string) => {
13 const _contracts = need.contracts(contracts);
14 if (kind === 'conditional') {
15 return conditionalSR.approveCommitmentTransfer(_contracts, to);
16 } else {
17 return linearSR.approveBatchTransfer(_contracts, to);
18 }
19 },
20 [kind, contracts]
21 ),
22 () => {}
23 );