@lido-sdk/react
Version:
This project is being slowly deprecated and may not receive further updates. Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Li
16 lines (15 loc) • 738 B
TypeScript
import { ContractTransaction, ContractReceipt } from '@ethersproject/contracts';
import { BigNumber } from '@ethersproject/bignumber';
declare type TransactionCallback = () => Promise<ContractTransaction>;
export declare type UseApproveResponse = {
approve: () => Promise<void>;
approving: boolean;
needsApprove: boolean;
initialLoading: boolean;
allowance: BigNumber;
loading: boolean;
error: unknown;
};
export declare type UseApproveWrapper = (callback: TransactionCallback) => Promise<ContractReceipt | undefined>;
export declare const useApprove: (amount: BigNumber, token: string, spender: string, owner?: string | undefined, wrapper?: UseApproveWrapper) => UseApproveResponse;
export {};