@dolomite-exchange/zap-sdk 0.3.35 → 0.3.37
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/dist/src/abis/Multicall.json +157 -0
- package/dist/src/abis/types/Multicall.d.ts +44 -0
- package/dist/src/abis/types/Multicall.js +3 -0
- package/dist/src/abis/types/Multicall.js.map +1 -0
- package/dist/src/lib/Constants.d.ts +1 -0
- package/dist/src/lib/Constants.js +192 -156
- package/dist/src/lib/Constants.js.map +1 -1
- package/dist/src/lib/estimators/GlvEstimator.d.ts +1 -0
- package/dist/src/lib/estimators/GlvEstimator.js +115 -52
- package/dist/src/lib/estimators/GlvEstimator.js.map +1 -1
- package/dist/src/lib/estimators/GmxV2GmEstimator.d.ts +1 -0
- package/dist/src/lib/estimators/GmxV2GmEstimator.js +85 -48
- package/dist/src/lib/estimators/GmxV2GmEstimator.js.map +1 -1
- package/package.json +1 -1
- package/src/abis/Multicall.json +157 -0
- package/src/abis/types/Multicall.ts +67 -0
- package/src/lib/Constants.ts +37 -0
- package/src/lib/estimators/GlvEstimator.ts +117 -22
- package/src/lib/estimators/GmxV2GmEstimator.ts +74 -29
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"constant": false,
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"components": [
|
|
7
|
+
{
|
|
8
|
+
"internalType": "address",
|
|
9
|
+
"name": "target",
|
|
10
|
+
"type": "address"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"internalType": "bytes",
|
|
14
|
+
"name": "callData",
|
|
15
|
+
"type": "bytes"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"internalType": "struct MultiCall.Call[]",
|
|
19
|
+
"name": "calls",
|
|
20
|
+
"type": "tuple[]"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"name": "aggregate",
|
|
24
|
+
"outputs": [
|
|
25
|
+
{
|
|
26
|
+
"internalType": "uint256",
|
|
27
|
+
"name": "blockNumber",
|
|
28
|
+
"type": "uint256"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"internalType": "bytes[]",
|
|
32
|
+
"name": "returnData",
|
|
33
|
+
"type": "bytes[]"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"payable": false,
|
|
37
|
+
"stateMutability": "nonpayable",
|
|
38
|
+
"type": "function"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"constant": true,
|
|
42
|
+
"inputs": [
|
|
43
|
+
{
|
|
44
|
+
"internalType": "address",
|
|
45
|
+
"name": "addr",
|
|
46
|
+
"type": "address"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"name": "getEthBalance",
|
|
50
|
+
"outputs": [
|
|
51
|
+
{
|
|
52
|
+
"internalType": "uint256",
|
|
53
|
+
"name": "balance",
|
|
54
|
+
"type": "uint256"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"payable": false,
|
|
58
|
+
"stateMutability": "view",
|
|
59
|
+
"type": "function"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"constant": true,
|
|
63
|
+
"inputs": [
|
|
64
|
+
{
|
|
65
|
+
"internalType": "uint256",
|
|
66
|
+
"name": "blockNumber",
|
|
67
|
+
"type": "uint256"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"name": "getBlockHash",
|
|
71
|
+
"outputs": [
|
|
72
|
+
{
|
|
73
|
+
"internalType": "bytes32",
|
|
74
|
+
"name": "blockHash",
|
|
75
|
+
"type": "bytes32"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"payable": false,
|
|
79
|
+
"stateMutability": "view",
|
|
80
|
+
"type": "function"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"constant": true,
|
|
84
|
+
"inputs": [],
|
|
85
|
+
"name": "getLastBlockHash",
|
|
86
|
+
"outputs": [
|
|
87
|
+
{
|
|
88
|
+
"internalType": "bytes32",
|
|
89
|
+
"name": "blockHash",
|
|
90
|
+
"type": "bytes32"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"payable": false,
|
|
94
|
+
"stateMutability": "view",
|
|
95
|
+
"type": "function"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"constant": true,
|
|
99
|
+
"inputs": [],
|
|
100
|
+
"name": "getCurrentBlockTimestamp",
|
|
101
|
+
"outputs": [
|
|
102
|
+
{
|
|
103
|
+
"internalType": "uint256",
|
|
104
|
+
"name": "timestamp",
|
|
105
|
+
"type": "uint256"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"payable": false,
|
|
109
|
+
"stateMutability": "view",
|
|
110
|
+
"type": "function"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"constant": true,
|
|
114
|
+
"inputs": [],
|
|
115
|
+
"name": "getCurrentBlockDifficulty",
|
|
116
|
+
"outputs": [
|
|
117
|
+
{
|
|
118
|
+
"internalType": "uint256",
|
|
119
|
+
"name": "difficulty",
|
|
120
|
+
"type": "uint256"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"payable": false,
|
|
124
|
+
"stateMutability": "view",
|
|
125
|
+
"type": "function"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"constant": true,
|
|
129
|
+
"inputs": [],
|
|
130
|
+
"name": "getCurrentBlockGasLimit",
|
|
131
|
+
"outputs": [
|
|
132
|
+
{
|
|
133
|
+
"internalType": "uint256",
|
|
134
|
+
"name": "gaslimit",
|
|
135
|
+
"type": "uint256"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"payable": false,
|
|
139
|
+
"stateMutability": "view",
|
|
140
|
+
"type": "function"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"constant": true,
|
|
144
|
+
"inputs": [],
|
|
145
|
+
"name": "getCurrentBlockCoinbase",
|
|
146
|
+
"outputs": [
|
|
147
|
+
{
|
|
148
|
+
"internalType": "address",
|
|
149
|
+
"name": "coinbase",
|
|
150
|
+
"type": "address"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"payable": false,
|
|
154
|
+
"stateMutability": "view",
|
|
155
|
+
"type": "function"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { FunctionFragment, Result } from '@ethersproject/abi';
|
|
2
|
+
import type { Listener, Provider } from '@ethersproject/providers';
|
|
3
|
+
import type { BaseContract, BigNumber, BytesLike, CallOverrides, PopulatedTransaction, Signer, utils } from 'ethers';
|
|
4
|
+
export interface MulticallInterface extends utils.Interface {
|
|
5
|
+
functions: {
|
|
6
|
+
'aggregate((address,bytes)[])': FunctionFragment;
|
|
7
|
+
};
|
|
8
|
+
getFunction(nameOrSignatureOrTopic: 'aggregate'): FunctionFragment;
|
|
9
|
+
decodeFunctionResult(functionFragment: 'aggregate', data: BytesLike): Result;
|
|
10
|
+
}
|
|
11
|
+
export interface Multicall__CallStruct {
|
|
12
|
+
target: string;
|
|
13
|
+
callData: string;
|
|
14
|
+
}
|
|
15
|
+
export interface Multicall extends BaseContract {
|
|
16
|
+
interface: MulticallInterface;
|
|
17
|
+
functions: {
|
|
18
|
+
aggregate(calls: Multicall__CallStruct[], overrides?: CallOverrides): Promise<[BigNumber, string[]] & {
|
|
19
|
+
blockNumber: BigNumber;
|
|
20
|
+
returnData: string[];
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
callStatic: {
|
|
24
|
+
aggregate(calls: Multicall__CallStruct[], overrides?: CallOverrides): Promise<[BigNumber, string[]] & {
|
|
25
|
+
blockNumber: BigNumber;
|
|
26
|
+
returnData: string[];
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
estimateGas: {
|
|
30
|
+
aggregate(calls: Multicall__CallStruct[], overrides?: CallOverrides): Promise<BigNumber>;
|
|
31
|
+
};
|
|
32
|
+
populateTransaction: {
|
|
33
|
+
aggregate(calls: Multicall__CallStruct[], overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
34
|
+
};
|
|
35
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
36
|
+
attach(addressOrName: string): this;
|
|
37
|
+
deployed(): Promise<this>;
|
|
38
|
+
listeners(eventName?: string): Array<Listener>;
|
|
39
|
+
removeAllListeners(eventName?: string): this;
|
|
40
|
+
aggregate(calls: Multicall__CallStruct[], overrides?: CallOverrides): Promise<[BigNumber, string[]] & {
|
|
41
|
+
blockNumber: BigNumber;
|
|
42
|
+
returnData: string[];
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Multicall.js","sourceRoot":"","sources":["../../../../src/abis/types/Multicall.ts"],"names":[],"mappings":""}
|
|
@@ -46,6 +46,7 @@ export declare const GLV_READER_MAP: Record<Network, Address | undefined>;
|
|
|
46
46
|
export declare const GMX_V2_DATA_STORE_MAP: Record<Network, Address | undefined>;
|
|
47
47
|
export declare const GMX_V2_READER_MAP: Record<Network, Address | undefined>;
|
|
48
48
|
export declare const METH_MAP: Record<Network, Address | undefined>;
|
|
49
|
+
export declare const MULTICALL_MAP: Record<Network, Address>;
|
|
49
50
|
export declare const WE_ETH_MAP: Record<Network, Address | undefined>;
|
|
50
51
|
export declare const WMNT_MAP: Record<Network, Address | undefined>;
|
|
51
52
|
export declare const ISOLATION_MODE_CONVERSION_MARKET_ID_MAP: Record<Network, Record<string, ApiMarketConverter | undefined>>;
|