@orionprotocol/contracts
Version:
Orion Protocol contracts typings
258 lines (257 loc) • 11.5 kB
TypeScript
/// <reference types="node" />
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 Burn = ContractEventLog<{
owner: string;
recipient: string;
orderId: string;
indexFrom: string;
indexTo: string;
amount: string;
amount0: string;
amount1: string;
0: string;
1: string;
2: string;
3: string;
4: string;
5: string;
6: string;
7: string;
}>;
export type Collect = ContractEventLog<{
owner: string;
recipient: string;
orderId: string;
indexFrom: string;
indexTo: string;
amount0: string;
0: string;
1: string;
2: string;
3: string;
4: string;
5: string;
}>;
export type CollectProtocol = ContractEventLog<{
sender: string;
recipient: string;
amount0: string;
0: string;
1: string;
2: string;
}>;
export type Initialize = ContractEventLog<{
index: string;
0: string;
}>;
export type Mint = ContractEventLog<{
sender: string;
recipient: string;
orderId: string;
indexFrom: string;
indexTo: string;
amount: string;
amount0: string;
amount1: string;
time: string;
0: string;
1: string;
2: string;
3: string;
4: string;
5: string;
6: string;
7: string;
8: string;
}>;
export type Swap = ContractEventLog<{
sender: string;
recipient: string;
amount0: string;
amount1: string;
liquidity: string;
index: string;
0: string;
1: string;
2: string;
3: string;
4: string;
5: string;
}>;
export interface OrionV3Pool extends BaseContract {
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): OrionV3Pool;
clone(): OrionV3Pool;
methods: {
GetAvgRate(from: number | string | BN, to: number | string | BN): NonPayableTransactionObject<string>;
MAX_AMOUNT(): NonPayableTransactionObject<string>;
MAX_TICK(): NonPayableTransactionObject<string>;
addCounter(index: number | string | BN): NonPayableTransactionObject<void>;
addLiqByIndex(amount0: number | string | BN, indexFrom: number | string | BN, indexTo: number | string | BN): NonPayableTransactionObject<void>;
addLiqToTick(index: number | string | BN, addAmount: number | string | BN): NonPayableTransactionObject<void>;
addTickAmount(index: number | string | BN, addAmount: number | string | BN): NonPayableTransactionObject<void>;
burn(recipient: string, orderIndex: number | string | BN): NonPayableTransactionObject<{
liquidity: string;
amount0: string;
amount1: string;
0: string;
1: string;
2: string;
}>;
calcAmount0(index: number | string | BN): NonPayableTransactionObject<string>;
calcAmount1(index: number | string | BN): NonPayableTransactionObject<string>;
calcAmounts(amount: number | string | BN, indexFrom: number | string | BN, indexTo: number | string | BN): NonPayableTransactionObject<{
amount0: string;
amount1: string;
0: string;
1: string;
}>;
collect(recipient: string, orderIndex: number | string | BN): NonPayableTransactionObject<string>;
collectProtocol(recipient: string): NonPayableTransactionObject<string>;
decreaseLiquidity(recipient: string, orderIndex: number | string | BN, amount: number | string | BN): NonPayableTransactionObject<{
liquidity: string;
amount0: string;
amount1: string;
0: string;
1: string;
2: string;
}>;
doTestLog2(x: number | string | BN): NonPayableTransactionObject<void>;
doTestLog3(x: number | string | BN): NonPayableTransactionObject<void>;
do_calcAmount0(index: number | string | BN): NonPayableTransactionObject<void>;
do_calcAmount1(index: number | string | BN): NonPayableTransactionObject<void>;
factory(): NonPayableTransactionObject<string>;
getCurrent(): NonPayableTransactionObject<[
string,
string,
string,
string,
string,
string,
string,
string
]>;
getExp2(x: number | string | BN): NonPayableTransactionObject<string>;
getExp3(x: number | string | BN): NonPayableTransactionObject<string>;
getExp3_2(x: number | string | BN): NonPayableTransactionObject<string>;
getIndex(rate: number | string | BN): NonPayableTransactionObject<string>;
getIndexByRate(rate: number | string | BN): NonPayableTransactionObject<string>;
getIntegralRate128(from: number | string | BN, to: number | string | BN): NonPayableTransactionObject<string>;
getLog2(x: number | string | BN): NonPayableTransactionObject<string>;
getLog3(x: number | string | BN): NonPayableTransactionObject<string>;
getLog4(x: number | string | BN): NonPayableTransactionObject<string>;
getMagic_a1(): NonPayableTransactionObject<string>;
getMagic_math(): NonPayableTransactionObject<string>;
getMapBits(index: number | string | BN): NonPayableTransactionObject<string>;
getNextTick(index: number | string | BN, direct: number | string | BN): NonPayableTransactionObject<string>;
getOracle(secondsAgo: number | string | BN): NonPayableTransactionObject<string>;
getOrder(owner: string, index: number | string | BN): NonPayableTransactionObject<[
string,
string,
string,
string,
string,
string,
string,
string,
string
]>;
getPoolInfo(): NonPayableTransactionObject<[
string,
string,
string,
string,
string,
string
]>;
getPriceTick(): NonPayableTransactionObject<string>;
getRateByIndex(index: number | string | BN): NonPayableTransactionObject<string>;
getRateByIndex128(index: number | string | BN): NonPayableTransactionObject<string>;
getRootBits(): NonPayableTransactionObject<string>;
getTWAP(): NonPayableTransactionObject<[string, string]>;
getTWAPPos(): NonPayableTransactionObject<string>;
increaseLiquidity(recipient: string, orderIndex: number | string | BN, amount: number | string | BN, data: string | number[]): NonPayableTransactionObject<{
amount0: string;
amount1: string;
0: string;
1: string;
}>;
initialize(index: number | string | BN): NonPayableTransactionObject<void>;
isInit(): NonPayableTransactionObject<boolean>;
isLock(): NonPayableTransactionObject<string>;
listAmount(from: number | string | BN, to: number | string | BN): NonPayableTransactionObject<string[]>;
listBitmap(from: number | string | BN, to: number | string | BN): NonPayableTransactionObject<string[]>;
listCumulFee(from: number | string | BN, to: number | string | BN): NonPayableTransactionObject<string[]>;
listFee(from: number | string | BN, to: number | string | BN): NonPayableTransactionObject<string[]>;
listOrder(owner: string, indexFrom: number | string | BN, count: number | string | BN): NonPayableTransactionObject<[
string,
string,
string,
string,
string,
string
][]>;
listTWAP(indexFrom: number | string | BN, count: number | string | BN): NonPayableTransactionObject<[string, string][]>;
mint(recipient: string, indexFrom: number | string | BN, indexTo: number | string | BN, amount: number | string | BN, data: string | number[]): NonPayableTransactionObject<{
amount0: string;
amount1: string;
id: string;
0: string;
1: string;
2: string;
}>;
removeCounter(index: number | string | BN): NonPayableTransactionObject<void>;
removeLiq(orderIndex: number | string | BN): NonPayableTransactionObject<void>;
removeLiqFromTick(index: number | string | BN, removeAmount: number | string | BN): NonPayableTransactionObject<void>;
setFee(fee: number | string | BN): NonPayableTransactionObject<void>;
setTickAmount(index: number | string | BN, addAmount: number | string | BN): NonPayableTransactionObject<void>;
speed_Integral(arg0: number | string | BN): NonPayableTransactionObject<void>;
speed_getIndex(rate0: number | string | BN): NonPayableTransactionObject<void>;
speed_getNextTick(index: number | string | BN, direct: number | string | BN): NonPayableTransactionObject<string>;
speed_getRate(index: number | string | BN): NonPayableTransactionObject<void>;
swap(recipient: string, zeroForOne: boolean, amountSpecified: number | string | BN, data: string | number[]): NonPayableTransactionObject<{
amount0: string;
amount1: string;
0: string;
1: string;
}>;
swap1(amount0: number | string | BN, direct: number | string | BN): NonPayableTransactionObject<void>;
swap2(amount0: number | string | BN, amount1: number | string | BN, direct: number | string | BN): NonPayableTransactionObject<void>;
totalFee(): NonPayableTransactionObject<string>;
};
events: {
Burn(cb?: Callback<Burn>): EventEmitter;
Burn(options?: EventOptions, cb?: Callback<Burn>): EventEmitter;
Collect(cb?: Callback<Collect>): EventEmitter;
Collect(options?: EventOptions, cb?: Callback<Collect>): EventEmitter;
CollectProtocol(cb?: Callback<CollectProtocol>): EventEmitter;
CollectProtocol(options?: EventOptions, cb?: Callback<CollectProtocol>): EventEmitter;
Initialize(cb?: Callback<Initialize>): EventEmitter;
Initialize(options?: EventOptions, cb?: Callback<Initialize>): EventEmitter;
Mint(cb?: Callback<Mint>): EventEmitter;
Mint(options?: EventOptions, cb?: Callback<Mint>): EventEmitter;
Swap(cb?: Callback<Swap>): EventEmitter;
Swap(options?: EventOptions, cb?: Callback<Swap>): EventEmitter;
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
};
once(event: "Burn", cb: Callback<Burn>): void;
once(event: "Burn", options: EventOptions, cb: Callback<Burn>): void;
once(event: "Collect", cb: Callback<Collect>): void;
once(event: "Collect", options: EventOptions, cb: Callback<Collect>): void;
once(event: "CollectProtocol", cb: Callback<CollectProtocol>): void;
once(event: "CollectProtocol", options: EventOptions, cb: Callback<CollectProtocol>): void;
once(event: "Initialize", cb: Callback<Initialize>): void;
once(event: "Initialize", options: EventOptions, cb: Callback<Initialize>): void;
once(event: "Mint", cb: Callback<Mint>): void;
once(event: "Mint", options: EventOptions, cb: Callback<Mint>): void;
once(event: "Swap", cb: Callback<Swap>): void;
once(event: "Swap", options: EventOptions, cb: Callback<Swap>): void;
}