UNPKG

@electra.finance/contracts

Version:
66 lines (65 loc) 3.01 kB
import type BN from "bn.js"; import type { ContractOptions } from "web3-eth-contract"; import type { EventLog } from "web3-core"; import type { EventEmitter } from "events"; import type { Callback, PayableTransactionObject, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types"; export interface EventOptions { filter?: object; fromBlock?: BlockType; topics?: string[]; } export type Initialized = ContractEventLog<{ version: string; 0: string; }>; export type OwnershipTransferred = ContractEventLog<{ previousOwner: string; newOwner: string; 0: string; 1: string; }>; export interface ElectraConverter extends BaseContract { constructor(jsonInterface: any[], address?: string, options?: ContractOptions): ElectraConverter; clone(): ElectraConverter; methods: { collateral(): NonPayableTransactionObject<string>; delegatedAction(trader: string, call_data: string | number[]): NonPayableTransactionObject<string>; electra(): NonPayableTransactionObject<string>; exchange(): NonPayableTransactionObject<string>; getDelegateStorage(): NonPayableTransactionObject<string>; getSenderOverride(): NonPayableTransactionObject<string>; initialize(electra_: string, exchange_: string): NonPayableTransactionObject<void>; owner(): NonPayableTransactionObject<string>; renounceOwnership(): NonPayableTransactionObject<void>; setBasicParams(electra_: string, exchange_: string): NonPayableTransactionObject<void>; setDelegateStorage(delegateStorage_: string): NonPayableTransactionObject<void>; swap(executor: string, desc: [ string, string, string, string, number | string | BN, number | string | BN, number | string | BN ], permit: string | number[], data: string | number[]): PayableTransactionObject<{ returnAmount: string; spentAmount: string; gasLeft: string; 0: string; 1: string; 2: string; }>; transferOwnership(newOwner: string): NonPayableTransactionObject<void>; }; events: { Initialized(cb?: Callback<Initialized>): EventEmitter; Initialized(options?: EventOptions, cb?: Callback<Initialized>): EventEmitter; OwnershipTransferred(cb?: Callback<OwnershipTransferred>): EventEmitter; OwnershipTransferred(options?: EventOptions, cb?: Callback<OwnershipTransferred>): EventEmitter; allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter; }; once(event: "Initialized", cb: Callback<Initialized>): void; once(event: "Initialized", options: EventOptions, cb: Callback<Initialized>): void; once(event: "OwnershipTransferred", cb: Callback<OwnershipTransferred>): void; once(event: "OwnershipTransferred", options: EventOptions, cb: Callback<OwnershipTransferred>): void; }