UNPKG

@sharwa.finance/hegic-stop-orders-sdk

Version:

HegicStopOrdersSDK is a specialized SDK package designed to facilitate interaction with HegicStopOrders contracts. It enables the automatic execution of options based on time and price triggers.

39 lines (36 loc) 1.82 kB
import { Signer, Provider, Contract, Interface, TransactionResponse } from 'ethers'; type TakeProfitData = { tokenId: bigint; upperStopPrice: number; lowerStopPrice: number; blockNumber: number; }; declare class TakeProfitSharwaFinance { signer: Signer; provider: Provider; take_profit: Contract; positions_manager: Contract; operational_treasury: Contract; iface: Interface; constructor(provider: Provider, signer: Signer); setTakeProfit(tokenId: bigint, upperStopPrice: bigint, lowerStopPrice: bigint): Promise<TransactionResponse>; deleteTakeProfit(tokenId: bigint): Promise<TransactionResponse>; enableAutoExecutionForAllOptions(): Promise<TransactionResponse>; disableAutoExecutionForAllOptions(): Promise<TransactionResponse>; enableAutoExecutionForOption(tokenId: bigint): Promise<TransactionResponse>; disableAutoExecutionForOption(tokenId: bigint): Promise<TransactionResponse>; filterOptionsWithAutoExecutionEnabled(user: string, arrAcivaOptions: bigint[]): Promise<bigint[]>; filterOptionsWithTakeProfits(arrAcivaOptions: bigint[]): Promise<Map<bigint, TakeProfitData>>; getAutoExecutedOptions(arrAcivaOptions: bigint[]): Promise<bigint[]>; isAutoExecutionEnabledForOption(tokenId: bigint): Promise<boolean>; isAutoExecutionEnabledForAllOptions(user: string): Promise<boolean>; _getActiveTakeProfits(user: string): Promise<Map<bigint, TakeProfitData>>; _getAllTakeProfits(user: string): Promise<Map<bigint, TakeProfitData>>; _getExecuteTakeProfits(user: string): Promise<bigint[]>; _getUserSetLogs(user: string): Promise<TakeProfitData[]>; private _isApprovalForAllData; private _uniqArrayData; private _uniqTransferData; private _uniqTakeProfitData; } export { TakeProfitSharwaFinance };