@orbs-network/twap 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/artifacts/contracts/TWAP.sol/TWAP.json +849 -0
- package/dist/artifacts/contracts/periphery/Lens.sol/Lens.json +488 -0
- package/dist/src/configs.d.ts +20 -0
- package/dist/src/configs.js +64 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +19 -0
- package/dist/src/lib.d.ts +130 -0
- package/dist/src/lib.js +194 -0
- package/dist/src/paraswap.d.ts +33 -0
- package/dist/src/paraswap.js +73 -0
- package/dist/typechain-hardhat/contracts/IExchange.d.ts +23 -0
- package/dist/typechain-hardhat/contracts/IExchange.js +5 -0
- package/dist/typechain-hardhat/contracts/TWAP.d.ts +204 -0
- package/dist/typechain-hardhat/contracts/TWAP.js +5 -0
- package/dist/typechain-hardhat/contracts/exchange/IParaswap.d.ts +20 -0
- package/dist/typechain-hardhat/contracts/exchange/IParaswap.js +5 -0
- package/dist/typechain-hardhat/contracts/exchange/IUniswapV2.d.ts +24 -0
- package/dist/typechain-hardhat/contracts/exchange/IUniswapV2.js +5 -0
- package/dist/typechain-hardhat/contracts/exchange/ParaswapExchange.d.ts +24 -0
- package/dist/typechain-hardhat/contracts/exchange/ParaswapExchange.js +5 -0
- package/dist/typechain-hardhat/contracts/exchange/UniswapV2Exchange.d.ts +24 -0
- package/dist/typechain-hardhat/contracts/exchange/UniswapV2Exchange.js +5 -0
- package/dist/typechain-hardhat/contracts/exchange/index.d.ts +4 -0
- package/dist/typechain-hardhat/contracts/exchange/index.js +2 -0
- package/dist/typechain-hardhat/contracts/index.d.ts +8 -0
- package/dist/typechain-hardhat/contracts/index.js +2 -0
- package/dist/typechain-hardhat/contracts/periphery/IWETH.d.ts +22 -0
- package/dist/typechain-hardhat/contracts/periphery/IWETH.js +5 -0
- package/dist/typechain-hardhat/contracts/periphery/Lens.d.ts +104 -0
- package/dist/typechain-hardhat/contracts/periphery/Lens.js +5 -0
- package/dist/typechain-hardhat/contracts/periphery/Taker.d.ts +39 -0
- package/dist/typechain-hardhat/contracts/periphery/Taker.js +5 -0
- package/dist/typechain-hardhat/contracts/periphery/index.d.ts +3 -0
- package/dist/typechain-hardhat/contracts/periphery/index.js +2 -0
- package/dist/typechain-hardhat/contracts/test/MockDeflationaryToken.d.ts +56 -0
- package/dist/typechain-hardhat/contracts/test/MockDeflationaryToken.js +5 -0
- package/dist/typechain-hardhat/contracts/test/MockExchange.d.ts +25 -0
- package/dist/typechain-hardhat/contracts/test/MockExchange.js +5 -0
- package/dist/typechain-hardhat/contracts/test/index.d.ts +2 -0
- package/dist/typechain-hardhat/contracts/test/index.js +2 -0
- package/dist/typechain-hardhat/types.d.ts +55 -0
- package/dist/typechain-hardhat/types.js +5 -0
- package/package.json +33 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
3
|
+
import type { EventLog } from "web3-core";
|
|
4
|
+
import type { EventEmitter } from "events";
|
|
5
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "../../types";
|
|
6
|
+
export interface EventOptions {
|
|
7
|
+
filter?: object;
|
|
8
|
+
fromBlock?: BlockType;
|
|
9
|
+
topics?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface IParaswap extends BaseContract {
|
|
12
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): IParaswap;
|
|
13
|
+
clone(): IParaswap;
|
|
14
|
+
methods: {
|
|
15
|
+
getTokenTransferProxy(): NonPayableTransactionObject<string>;
|
|
16
|
+
};
|
|
17
|
+
events: {
|
|
18
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface IUniswapV2 extends BaseContract {
|
|
14
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): IUniswapV2;
|
|
15
|
+
clone(): IUniswapV2;
|
|
16
|
+
methods: {
|
|
17
|
+
getAmountsOut(amountIn: number | string | BN | BigNumber, path: string[]): NonPayableTransactionObject<string[]>;
|
|
18
|
+
swapExactTokensForTokens(amountIn: number | string | BN | BigNumber, amountOutMin: number | string | BN | BigNumber, path: string[], to: string, deadline: number | string | BN | BigNumber): NonPayableTransactionObject<string[]>;
|
|
19
|
+
swapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn: number | string | BN | BigNumber, amountOutMin: number | string | BN | BigNumber, path: string[], to: string, deadline: number | string | BN | BigNumber): NonPayableTransactionObject<void>;
|
|
20
|
+
};
|
|
21
|
+
events: {
|
|
22
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface ParaswapExchange extends BaseContract {
|
|
14
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): ParaswapExchange;
|
|
15
|
+
clone(): ParaswapExchange;
|
|
16
|
+
methods: {
|
|
17
|
+
getAmountOut(arg0: string, arg1: string, arg2: number | string | BN | BigNumber, data: string | number[]): NonPayableTransactionObject<string>;
|
|
18
|
+
paraswap(): NonPayableTransactionObject<string>;
|
|
19
|
+
swap(_srcToken: string, _dstToken: string, amountIn: number | string | BN | BigNumber, amountOutMin: number | string | BN | BigNumber, data: string | number[]): NonPayableTransactionObject<void>;
|
|
20
|
+
};
|
|
21
|
+
events: {
|
|
22
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface UniswapV2Exchange extends BaseContract {
|
|
14
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): UniswapV2Exchange;
|
|
15
|
+
clone(): UniswapV2Exchange;
|
|
16
|
+
methods: {
|
|
17
|
+
getAmountOut(arg0: string, arg1: string, amountIn: number | string | BN | BigNumber, data: string | number[]): NonPayableTransactionObject<string>;
|
|
18
|
+
swap(_srcToken: string, arg1: string, amountIn: number | string | BN | BigNumber, amountOutMin: number | string | BN | BigNumber, data: string | number[]): NonPayableTransactionObject<void>;
|
|
19
|
+
uniswap(): NonPayableTransactionObject<string>;
|
|
20
|
+
};
|
|
21
|
+
events: {
|
|
22
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as exchange from "./exchange";
|
|
2
|
+
export type { exchange };
|
|
3
|
+
import type * as periphery from "./periphery";
|
|
4
|
+
export type { periphery };
|
|
5
|
+
import type * as test from "./test";
|
|
6
|
+
export type { test };
|
|
7
|
+
export type { IExchange } from "./IExchange";
|
|
8
|
+
export type { TWAP } from "./TWAP";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface IWETH extends BaseContract {
|
|
14
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): IWETH;
|
|
15
|
+
clone(): IWETH;
|
|
16
|
+
methods: {
|
|
17
|
+
withdraw(wad: number | string | BN | BigNumber): NonPayableTransactionObject<void>;
|
|
18
|
+
};
|
|
19
|
+
events: {
|
|
20
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface Lens extends BaseContract {
|
|
14
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): Lens;
|
|
15
|
+
clone(): Lens;
|
|
16
|
+
methods: {
|
|
17
|
+
length(): NonPayableTransactionObject<string>;
|
|
18
|
+
makerOrders(maker: string): NonPayableTransactionObject<[
|
|
19
|
+
string,
|
|
20
|
+
string,
|
|
21
|
+
string,
|
|
22
|
+
string,
|
|
23
|
+
[
|
|
24
|
+
string,
|
|
25
|
+
string,
|
|
26
|
+
string,
|
|
27
|
+
string,
|
|
28
|
+
string,
|
|
29
|
+
string,
|
|
30
|
+
string,
|
|
31
|
+
string,
|
|
32
|
+
string,
|
|
33
|
+
string,
|
|
34
|
+
string
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
string,
|
|
38
|
+
string,
|
|
39
|
+
string,
|
|
40
|
+
string,
|
|
41
|
+
string,
|
|
42
|
+
string
|
|
43
|
+
]
|
|
44
|
+
][]>;
|
|
45
|
+
takerBiddableOrders(taker: string, lastIndex: number | string | BN | BigNumber, pageSize: number | string | BN | BigNumber): NonPayableTransactionObject<[
|
|
46
|
+
string,
|
|
47
|
+
string,
|
|
48
|
+
string,
|
|
49
|
+
string,
|
|
50
|
+
[
|
|
51
|
+
string,
|
|
52
|
+
string,
|
|
53
|
+
string,
|
|
54
|
+
string,
|
|
55
|
+
string,
|
|
56
|
+
string,
|
|
57
|
+
string,
|
|
58
|
+
string,
|
|
59
|
+
string,
|
|
60
|
+
string,
|
|
61
|
+
string
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
string,
|
|
65
|
+
string,
|
|
66
|
+
string,
|
|
67
|
+
string,
|
|
68
|
+
string,
|
|
69
|
+
string
|
|
70
|
+
]
|
|
71
|
+
][]>;
|
|
72
|
+
takerFillableOrders(taker: string, lastIndex: number | string | BN | BigNumber, pageSize: number | string | BN | BigNumber): NonPayableTransactionObject<[
|
|
73
|
+
string,
|
|
74
|
+
string,
|
|
75
|
+
string,
|
|
76
|
+
string,
|
|
77
|
+
[
|
|
78
|
+
string,
|
|
79
|
+
string,
|
|
80
|
+
string,
|
|
81
|
+
string,
|
|
82
|
+
string,
|
|
83
|
+
string,
|
|
84
|
+
string,
|
|
85
|
+
string,
|
|
86
|
+
string,
|
|
87
|
+
string,
|
|
88
|
+
string
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
string,
|
|
92
|
+
string,
|
|
93
|
+
string,
|
|
94
|
+
string,
|
|
95
|
+
string,
|
|
96
|
+
string
|
|
97
|
+
]
|
|
98
|
+
][]>;
|
|
99
|
+
twap(): NonPayableTransactionObject<string>;
|
|
100
|
+
};
|
|
101
|
+
events: {
|
|
102
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare type OwnershipTransferred = ContractEventLog<{
|
|
14
|
+
previousOwner: string;
|
|
15
|
+
newOwner: string;
|
|
16
|
+
0: string;
|
|
17
|
+
1: string;
|
|
18
|
+
}>;
|
|
19
|
+
export interface Taker extends BaseContract {
|
|
20
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): Taker;
|
|
21
|
+
clone(): Taker;
|
|
22
|
+
methods: {
|
|
23
|
+
bid(id: number | string | BN | BigNumber, exchange: string, dstFee: number | string | BN | BigNumber, slippagePercent: number | string | BN | BigNumber, data: string | number[]): NonPayableTransactionObject<void>;
|
|
24
|
+
fill(id: number | string | BN | BigNumber, feeExchange: string, feeMinAmountOut: number | string | BN | BigNumber, feeData: string | number[]): NonPayableTransactionObject<void>;
|
|
25
|
+
owner(): NonPayableTransactionObject<string>;
|
|
26
|
+
renounceOwnership(): NonPayableTransactionObject<void>;
|
|
27
|
+
rescue(token: string): NonPayableTransactionObject<void>;
|
|
28
|
+
transferOwnership(newOwner: string): NonPayableTransactionObject<void>;
|
|
29
|
+
twap(): NonPayableTransactionObject<string>;
|
|
30
|
+
weth(): NonPayableTransactionObject<string>;
|
|
31
|
+
};
|
|
32
|
+
events: {
|
|
33
|
+
OwnershipTransferred(cb?: Callback<OwnershipTransferred>): EventEmitter;
|
|
34
|
+
OwnershipTransferred(options?: EventOptions, cb?: Callback<OwnershipTransferred>): EventEmitter;
|
|
35
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
36
|
+
};
|
|
37
|
+
once(event: "OwnershipTransferred", cb: Callback<OwnershipTransferred>): void;
|
|
38
|
+
once(event: "OwnershipTransferred", options: EventOptions, cb: Callback<OwnershipTransferred>): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare type Approval = ContractEventLog<{
|
|
14
|
+
owner: string;
|
|
15
|
+
spender: string;
|
|
16
|
+
value: string;
|
|
17
|
+
0: string;
|
|
18
|
+
1: string;
|
|
19
|
+
2: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare type Transfer = ContractEventLog<{
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
value: string;
|
|
25
|
+
0: string;
|
|
26
|
+
1: string;
|
|
27
|
+
2: string;
|
|
28
|
+
}>;
|
|
29
|
+
export interface MockDeflationaryToken extends BaseContract {
|
|
30
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): MockDeflationaryToken;
|
|
31
|
+
clone(): MockDeflationaryToken;
|
|
32
|
+
methods: {
|
|
33
|
+
allowance(owner: string, spender: string): NonPayableTransactionObject<string>;
|
|
34
|
+
approve(spender: string, amount: number | string | BN | BigNumber): NonPayableTransactionObject<boolean>;
|
|
35
|
+
balanceOf(account: string): NonPayableTransactionObject<string>;
|
|
36
|
+
decimals(): NonPayableTransactionObject<string>;
|
|
37
|
+
decreaseAllowance(spender: string, subtractedValue: number | string | BN | BigNumber): NonPayableTransactionObject<boolean>;
|
|
38
|
+
increaseAllowance(spender: string, addedValue: number | string | BN | BigNumber): NonPayableTransactionObject<boolean>;
|
|
39
|
+
name(): NonPayableTransactionObject<string>;
|
|
40
|
+
symbol(): NonPayableTransactionObject<string>;
|
|
41
|
+
totalSupply(): NonPayableTransactionObject<string>;
|
|
42
|
+
transfer(to: string, amount: number | string | BN | BigNumber): NonPayableTransactionObject<boolean>;
|
|
43
|
+
transferFrom(from: string, to: string, amount: number | string | BN | BigNumber): NonPayableTransactionObject<boolean>;
|
|
44
|
+
};
|
|
45
|
+
events: {
|
|
46
|
+
Approval(cb?: Callback<Approval>): EventEmitter;
|
|
47
|
+
Approval(options?: EventOptions, cb?: Callback<Approval>): EventEmitter;
|
|
48
|
+
Transfer(cb?: Callback<Transfer>): EventEmitter;
|
|
49
|
+
Transfer(options?: EventOptions, cb?: Callback<Transfer>): EventEmitter;
|
|
50
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
51
|
+
};
|
|
52
|
+
once(event: "Approval", cb: Callback<Approval>): void;
|
|
53
|
+
once(event: "Approval", options: EventOptions, cb: Callback<Approval>): void;
|
|
54
|
+
once(event: "Transfer", cb: Callback<Transfer>): void;
|
|
55
|
+
once(event: "Transfer", options: EventOptions, cb: Callback<Transfer>): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
5
|
+
import type { EventLog } from "web3-core";
|
|
6
|
+
import type { EventEmitter } from "events";
|
|
7
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "../../types";
|
|
8
|
+
export interface EventOptions {
|
|
9
|
+
filter?: object;
|
|
10
|
+
fromBlock?: BlockType;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface MockExchange extends BaseContract {
|
|
14
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): MockExchange;
|
|
15
|
+
clone(): MockExchange;
|
|
16
|
+
methods: {
|
|
17
|
+
amounts(arg0: number | string | BN | BigNumber): NonPayableTransactionObject<string>;
|
|
18
|
+
getAmountOut(arg0: string, arg1: string, arg2: number | string | BN | BigNumber, arg3: string | number[]): NonPayableTransactionObject<string>;
|
|
19
|
+
setMockAmounts(_amounts: (number | string | BN | BigNumber)[]): NonPayableTransactionObject<void>;
|
|
20
|
+
swap(_srcToken: string, _dstToken: string, amountIn: number | string | BN | BigNumber, arg3: number | string | BN | BigNumber, arg4: string | number[]): NonPayableTransactionObject<void>;
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type BigNumber from "bignumber.js";
|
|
4
|
+
import type { EventEmitter } from "events";
|
|
5
|
+
import type { EventLog, PromiEvent, TransactionReceipt } from "web3-core/types";
|
|
6
|
+
import type { Contract } from "web3-eth-contract";
|
|
7
|
+
export interface EstimateGasOptions {
|
|
8
|
+
from?: string;
|
|
9
|
+
gas?: number;
|
|
10
|
+
value?: number | string | BN | BigNumber;
|
|
11
|
+
}
|
|
12
|
+
export interface EventOptions {
|
|
13
|
+
filter?: object;
|
|
14
|
+
fromBlock?: BlockType;
|
|
15
|
+
topics?: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare type Callback<T> = (error: Error, result: T) => void;
|
|
18
|
+
export interface ContractEventLog<T> extends EventLog {
|
|
19
|
+
returnValues: T;
|
|
20
|
+
}
|
|
21
|
+
export interface ContractEventEmitter<T> extends EventEmitter {
|
|
22
|
+
on(event: "connected", listener: (subscriptionId: string) => void): this;
|
|
23
|
+
on(event: "data" | "changed", listener: (event: ContractEventLog<T>) => void): this;
|
|
24
|
+
on(event: "error", listener: (error: Error) => void): this;
|
|
25
|
+
}
|
|
26
|
+
export interface NonPayableTx {
|
|
27
|
+
nonce?: string | number | BN | BigNumber;
|
|
28
|
+
chainId?: string | number | BN | BigNumber;
|
|
29
|
+
from?: string;
|
|
30
|
+
to?: string;
|
|
31
|
+
data?: string;
|
|
32
|
+
gas?: string | number | BN | BigNumber;
|
|
33
|
+
maxPriorityFeePerGas?: string | number | BN | BigNumber;
|
|
34
|
+
maxFeePerGas?: string | number | BN | BigNumber;
|
|
35
|
+
gasPrice?: string | number | BN | BigNumber;
|
|
36
|
+
}
|
|
37
|
+
export interface PayableTx extends NonPayableTx {
|
|
38
|
+
value?: string | number | BN | BigNumber;
|
|
39
|
+
}
|
|
40
|
+
export interface NonPayableTransactionObject<T> {
|
|
41
|
+
arguments: any[];
|
|
42
|
+
call(tx?: NonPayableTx, block?: BlockType): Promise<T>;
|
|
43
|
+
send(tx?: NonPayableTx): PromiEvent<TransactionReceipt>;
|
|
44
|
+
estimateGas(tx?: NonPayableTx): Promise<number>;
|
|
45
|
+
encodeABI(): string;
|
|
46
|
+
}
|
|
47
|
+
export interface PayableTransactionObject<T> {
|
|
48
|
+
arguments: any[];
|
|
49
|
+
call(tx?: PayableTx, block?: BlockType): Promise<T>;
|
|
50
|
+
send(tx?: PayableTx): PromiEvent<TransactionReceipt>;
|
|
51
|
+
estimateGas(tx?: PayableTx): Promise<number>;
|
|
52
|
+
encodeABI(): string;
|
|
53
|
+
}
|
|
54
|
+
export declare type BlockType = "latest" | "pending" | "genesis" | "earliest" | number | BN | BigNumber;
|
|
55
|
+
export declare type BaseContract = Omit<Contract, "clone" | "once">;
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orbs-network/twap",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/orbs-network/twap.git"
|
|
7
|
+
},
|
|
8
|
+
"author": "Orbs",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@defi.org/web3-candies": "4.x"
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/src/index.js",
|
|
14
|
+
"types": "./dist/src/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"./dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"clean": "rm -rf artifacts cache typechain-hardhat dist",
|
|
20
|
+
"prettier": "prettier --write '{test,src,contracts}/**/*.{ts,js,json,sol}'",
|
|
21
|
+
"typechain": "npm run clean && hardhat typechain",
|
|
22
|
+
"prebuild": "npm run prettier && npm run typechain",
|
|
23
|
+
"build": "hardhat compile && solhint 'contracts/**/*.sol' && tsc",
|
|
24
|
+
"test:logs": "for t in eth ftm poly; do DEBUG=web3-candies npm run test:$t -- --logs; done",
|
|
25
|
+
"test": "for t in eth ftm poly; do npm run test:$t; done",
|
|
26
|
+
"test:eth": "NETWORK=ETH BLOCK=14908980 hardhat test",
|
|
27
|
+
"test:ftm": "NETWORK=FTM BLOCK=39838819 hardhat test",
|
|
28
|
+
"test:poly": "NETWORK=POLY BLOCK=29194866 hardhat test"
|
|
29
|
+
},
|
|
30
|
+
"prettier": {
|
|
31
|
+
"printWidth": 120
|
|
32
|
+
}
|
|
33
|
+
}
|