@electra.finance/contracts
Version:
Electra Finance contracts typings
40 lines (39 loc) • 2.15 kB
TypeScript
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, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
export interface EventOptions {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
}
export type OwnershipTransferred = ContractEventLog<{
previousOwner: string;
newOwner: string;
0: string;
1: string;
}>;
export interface CFDPriceOracle extends BaseContract {
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CFDPriceOracle;
clone(): CFDPriceOracle;
methods: {
changePriceProviderAuthorization(priceProviders: string[]): NonPayableTransactionObject<void>;
getPrice(index: number | string | BN): NonPayableTransactionObject<string>;
getPrices(length: number | string | BN): NonPayableTransactionObject<string[]>;
owner(): NonPayableTransactionObject<string>;
priceProviderAuthorization(arg0: string): NonPayableTransactionObject<boolean>;
renounceOwnership(): NonPayableTransactionObject<void>;
setPrice(index: number | string | BN, price: number | string | BN): NonPayableTransactionObject<void>;
setPrices(prices: (string | number[])[]): NonPayableTransactionObject<void>;
setPricesWithCallBack(indexes: (number | string | BN)[], prices_: (number | string | BN)[], cfd: string, data: string | number[]): NonPayableTransactionObject<void>;
transferOwnership(newOwner: string): NonPayableTransactionObject<void>;
};
events: {
OwnershipTransferred(cb?: Callback<OwnershipTransferred>): EventEmitter;
OwnershipTransferred(options?: EventOptions, cb?: Callback<OwnershipTransferred>): EventEmitter;
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
};
once(event: "OwnershipTransferred", cb: Callback<OwnershipTransferred>): void;
once(event: "OwnershipTransferred", options: EventOptions, cb: Callback<OwnershipTransferred>): void;
}