@luxfi/exchange 0.2.0 → 1.0.1
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/chains/lux.d.ts +6 -116
- package/dist/chains/lux.d.ts.map +1 -1
- package/dist/contracts/abis/amm-v2-factory.d.ts +148 -0
- package/dist/contracts/abis/amm-v2-factory.d.ts.map +1 -0
- package/dist/contracts/abis/{uniswap-v2-factory.js → amm-v2-factory.js} +5 -2
- package/dist/contracts/abis/amm-v2-pair.d.ts +236 -0
- package/dist/contracts/abis/amm-v2-pair.d.ts.map +1 -0
- package/dist/contracts/abis/{uniswap-v2-pair.js → amm-v2-pair.js} +5 -2
- package/dist/contracts/abis/amm-v2-router.d.ts +496 -0
- package/dist/contracts/abis/amm-v2-router.d.ts.map +1 -0
- package/dist/contracts/abis/{uniswap-v2-router.js → amm-v2-router.js} +5 -2
- package/dist/contracts/abis/amm-v3-factory.d.ts +152 -0
- package/dist/contracts/abis/amm-v3-factory.d.ts.map +1 -0
- package/dist/contracts/abis/{uniswap-v3-factory.js → amm-v3-factory.js} +5 -2
- package/dist/contracts/abis/amm-v3-pool.d.ts +254 -0
- package/dist/contracts/abis/amm-v3-pool.d.ts.map +1 -0
- package/dist/contracts/abis/{uniswap-v3-pool.js → amm-v3-pool.js} +5 -2
- package/dist/contracts/abis/index.d.ts +8 -5
- package/dist/contracts/abis/index.d.ts.map +1 -1
- package/dist/contracts/abis/index.js +13 -6
- package/dist/contracts/abis/pool-manager.d.ts +1 -1
- package/dist/contracts/abis/pool-manager.js +1 -1
- package/dist/contracts/addresses.d.ts +30 -42
- package/dist/contracts/addresses.d.ts.map +1 -1
- package/dist/contracts/addresses.js +49 -50
- package/dist/hooks/use-pools.d.ts.map +1 -1
- package/dist/hooks/use-pools.js +8 -6
- package/dist/hooks/use-swap.js +1 -1
- package/dist/hooks/use-token-allowance.d.ts +1 -1
- package/dist/tokens/index.d.ts +31 -3
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +136 -32
- package/package.json +2 -2
- package/src/contracts/abis/{uniswap-v2-factory.ts → amm-v2-factory.ts} +6 -2
- package/src/contracts/abis/{uniswap-v2-pair.ts → amm-v2-pair.ts} +6 -2
- package/src/contracts/abis/{uniswap-v2-router.ts → amm-v2-router.ts} +6 -2
- package/src/contracts/abis/{uniswap-v3-factory.ts → amm-v3-factory.ts} +6 -2
- package/src/contracts/abis/{uniswap-v3-pool.ts → amm-v3-pool.ts} +6 -2
- package/src/contracts/abis/index.ts +16 -6
- package/src/contracts/abis/pool-manager.ts +1 -1
- package/src/contracts/addresses.ts +53 -52
- package/src/hooks/use-pools.ts +8 -6
- package/src/hooks/use-positions.ts +3 -3
- package/src/hooks/use-swap-quote.ts +1 -1
- package/src/hooks/use-swap.ts +1 -1
- package/src/tokens/index.ts +148 -32
- package/dist/contracts/abis/uniswap-v2-factory.d.ts +0 -75
- package/dist/contracts/abis/uniswap-v2-factory.d.ts.map +0 -1
- package/dist/contracts/abis/uniswap-v2-pair.d.ts +0 -119
- package/dist/contracts/abis/uniswap-v2-pair.d.ts.map +0 -1
- package/dist/contracts/abis/uniswap-v2-router.d.ts +0 -249
- package/dist/contracts/abis/uniswap-v2-router.d.ts.map +0 -1
- package/dist/contracts/abis/uniswap-v3-factory.d.ts +0 -77
- package/dist/contracts/abis/uniswap-v3-factory.d.ts.map +0 -1
- package/dist/contracts/abis/uniswap-v3-pool.d.ts +0 -128
- package/dist/contracts/abis/uniswap-v3-pool.d.ts.map +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AMM V2 Pair ABI
|
|
3
|
+
* Compatible with Lux V2 Pair interface
|
|
4
|
+
*/
|
|
5
|
+
export declare const AMM_V2_PAIR_ABI: readonly [{
|
|
6
|
+
readonly type: "function";
|
|
7
|
+
readonly name: "token0";
|
|
8
|
+
readonly inputs: readonly [];
|
|
9
|
+
readonly outputs: readonly [{
|
|
10
|
+
readonly type: "address";
|
|
11
|
+
}];
|
|
12
|
+
readonly stateMutability: "view";
|
|
13
|
+
}, {
|
|
14
|
+
readonly type: "function";
|
|
15
|
+
readonly name: "token1";
|
|
16
|
+
readonly inputs: readonly [];
|
|
17
|
+
readonly outputs: readonly [{
|
|
18
|
+
readonly type: "address";
|
|
19
|
+
}];
|
|
20
|
+
readonly stateMutability: "view";
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "function";
|
|
23
|
+
readonly name: "getReserves";
|
|
24
|
+
readonly inputs: readonly [];
|
|
25
|
+
readonly outputs: readonly [{
|
|
26
|
+
readonly name: "reserve0";
|
|
27
|
+
readonly type: "uint112";
|
|
28
|
+
}, {
|
|
29
|
+
readonly name: "reserve1";
|
|
30
|
+
readonly type: "uint112";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "blockTimestampLast";
|
|
33
|
+
readonly type: "uint32";
|
|
34
|
+
}];
|
|
35
|
+
readonly stateMutability: "view";
|
|
36
|
+
}, {
|
|
37
|
+
readonly type: "function";
|
|
38
|
+
readonly name: "totalSupply";
|
|
39
|
+
readonly inputs: readonly [];
|
|
40
|
+
readonly outputs: readonly [{
|
|
41
|
+
readonly type: "uint256";
|
|
42
|
+
}];
|
|
43
|
+
readonly stateMutability: "view";
|
|
44
|
+
}, {
|
|
45
|
+
readonly type: "function";
|
|
46
|
+
readonly name: "balanceOf";
|
|
47
|
+
readonly inputs: readonly [{
|
|
48
|
+
readonly name: "owner";
|
|
49
|
+
readonly type: "address";
|
|
50
|
+
}];
|
|
51
|
+
readonly outputs: readonly [{
|
|
52
|
+
readonly type: "uint256";
|
|
53
|
+
}];
|
|
54
|
+
readonly stateMutability: "view";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "function";
|
|
57
|
+
readonly name: "price0CumulativeLast";
|
|
58
|
+
readonly inputs: readonly [];
|
|
59
|
+
readonly outputs: readonly [{
|
|
60
|
+
readonly type: "uint256";
|
|
61
|
+
}];
|
|
62
|
+
readonly stateMutability: "view";
|
|
63
|
+
}, {
|
|
64
|
+
readonly type: "function";
|
|
65
|
+
readonly name: "price1CumulativeLast";
|
|
66
|
+
readonly inputs: readonly [];
|
|
67
|
+
readonly outputs: readonly [{
|
|
68
|
+
readonly type: "uint256";
|
|
69
|
+
}];
|
|
70
|
+
readonly stateMutability: "view";
|
|
71
|
+
}, {
|
|
72
|
+
readonly type: "function";
|
|
73
|
+
readonly name: "kLast";
|
|
74
|
+
readonly inputs: readonly [];
|
|
75
|
+
readonly outputs: readonly [{
|
|
76
|
+
readonly type: "uint256";
|
|
77
|
+
}];
|
|
78
|
+
readonly stateMutability: "view";
|
|
79
|
+
}, {
|
|
80
|
+
readonly type: "event";
|
|
81
|
+
readonly name: "Swap";
|
|
82
|
+
readonly inputs: readonly [{
|
|
83
|
+
readonly name: "sender";
|
|
84
|
+
readonly type: "address";
|
|
85
|
+
readonly indexed: true;
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "amount0In";
|
|
88
|
+
readonly type: "uint256";
|
|
89
|
+
readonly indexed: false;
|
|
90
|
+
}, {
|
|
91
|
+
readonly name: "amount1In";
|
|
92
|
+
readonly type: "uint256";
|
|
93
|
+
readonly indexed: false;
|
|
94
|
+
}, {
|
|
95
|
+
readonly name: "amount0Out";
|
|
96
|
+
readonly type: "uint256";
|
|
97
|
+
readonly indexed: false;
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "amount1Out";
|
|
100
|
+
readonly type: "uint256";
|
|
101
|
+
readonly indexed: false;
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "to";
|
|
104
|
+
readonly type: "address";
|
|
105
|
+
readonly indexed: true;
|
|
106
|
+
}];
|
|
107
|
+
}, {
|
|
108
|
+
readonly type: "event";
|
|
109
|
+
readonly name: "Sync";
|
|
110
|
+
readonly inputs: readonly [{
|
|
111
|
+
readonly name: "reserve0";
|
|
112
|
+
readonly type: "uint112";
|
|
113
|
+
readonly indexed: false;
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "reserve1";
|
|
116
|
+
readonly type: "uint112";
|
|
117
|
+
readonly indexed: false;
|
|
118
|
+
}];
|
|
119
|
+
}];
|
|
120
|
+
/** @deprecated Use AMM_V2_PAIR_ABI instead */
|
|
121
|
+
export declare const LUX_V2_PAIR_ABI: readonly [{
|
|
122
|
+
readonly type: "function";
|
|
123
|
+
readonly name: "token0";
|
|
124
|
+
readonly inputs: readonly [];
|
|
125
|
+
readonly outputs: readonly [{
|
|
126
|
+
readonly type: "address";
|
|
127
|
+
}];
|
|
128
|
+
readonly stateMutability: "view";
|
|
129
|
+
}, {
|
|
130
|
+
readonly type: "function";
|
|
131
|
+
readonly name: "token1";
|
|
132
|
+
readonly inputs: readonly [];
|
|
133
|
+
readonly outputs: readonly [{
|
|
134
|
+
readonly type: "address";
|
|
135
|
+
}];
|
|
136
|
+
readonly stateMutability: "view";
|
|
137
|
+
}, {
|
|
138
|
+
readonly type: "function";
|
|
139
|
+
readonly name: "getReserves";
|
|
140
|
+
readonly inputs: readonly [];
|
|
141
|
+
readonly outputs: readonly [{
|
|
142
|
+
readonly name: "reserve0";
|
|
143
|
+
readonly type: "uint112";
|
|
144
|
+
}, {
|
|
145
|
+
readonly name: "reserve1";
|
|
146
|
+
readonly type: "uint112";
|
|
147
|
+
}, {
|
|
148
|
+
readonly name: "blockTimestampLast";
|
|
149
|
+
readonly type: "uint32";
|
|
150
|
+
}];
|
|
151
|
+
readonly stateMutability: "view";
|
|
152
|
+
}, {
|
|
153
|
+
readonly type: "function";
|
|
154
|
+
readonly name: "totalSupply";
|
|
155
|
+
readonly inputs: readonly [];
|
|
156
|
+
readonly outputs: readonly [{
|
|
157
|
+
readonly type: "uint256";
|
|
158
|
+
}];
|
|
159
|
+
readonly stateMutability: "view";
|
|
160
|
+
}, {
|
|
161
|
+
readonly type: "function";
|
|
162
|
+
readonly name: "balanceOf";
|
|
163
|
+
readonly inputs: readonly [{
|
|
164
|
+
readonly name: "owner";
|
|
165
|
+
readonly type: "address";
|
|
166
|
+
}];
|
|
167
|
+
readonly outputs: readonly [{
|
|
168
|
+
readonly type: "uint256";
|
|
169
|
+
}];
|
|
170
|
+
readonly stateMutability: "view";
|
|
171
|
+
}, {
|
|
172
|
+
readonly type: "function";
|
|
173
|
+
readonly name: "price0CumulativeLast";
|
|
174
|
+
readonly inputs: readonly [];
|
|
175
|
+
readonly outputs: readonly [{
|
|
176
|
+
readonly type: "uint256";
|
|
177
|
+
}];
|
|
178
|
+
readonly stateMutability: "view";
|
|
179
|
+
}, {
|
|
180
|
+
readonly type: "function";
|
|
181
|
+
readonly name: "price1CumulativeLast";
|
|
182
|
+
readonly inputs: readonly [];
|
|
183
|
+
readonly outputs: readonly [{
|
|
184
|
+
readonly type: "uint256";
|
|
185
|
+
}];
|
|
186
|
+
readonly stateMutability: "view";
|
|
187
|
+
}, {
|
|
188
|
+
readonly type: "function";
|
|
189
|
+
readonly name: "kLast";
|
|
190
|
+
readonly inputs: readonly [];
|
|
191
|
+
readonly outputs: readonly [{
|
|
192
|
+
readonly type: "uint256";
|
|
193
|
+
}];
|
|
194
|
+
readonly stateMutability: "view";
|
|
195
|
+
}, {
|
|
196
|
+
readonly type: "event";
|
|
197
|
+
readonly name: "Swap";
|
|
198
|
+
readonly inputs: readonly [{
|
|
199
|
+
readonly name: "sender";
|
|
200
|
+
readonly type: "address";
|
|
201
|
+
readonly indexed: true;
|
|
202
|
+
}, {
|
|
203
|
+
readonly name: "amount0In";
|
|
204
|
+
readonly type: "uint256";
|
|
205
|
+
readonly indexed: false;
|
|
206
|
+
}, {
|
|
207
|
+
readonly name: "amount1In";
|
|
208
|
+
readonly type: "uint256";
|
|
209
|
+
readonly indexed: false;
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "amount0Out";
|
|
212
|
+
readonly type: "uint256";
|
|
213
|
+
readonly indexed: false;
|
|
214
|
+
}, {
|
|
215
|
+
readonly name: "amount1Out";
|
|
216
|
+
readonly type: "uint256";
|
|
217
|
+
readonly indexed: false;
|
|
218
|
+
}, {
|
|
219
|
+
readonly name: "to";
|
|
220
|
+
readonly type: "address";
|
|
221
|
+
readonly indexed: true;
|
|
222
|
+
}];
|
|
223
|
+
}, {
|
|
224
|
+
readonly type: "event";
|
|
225
|
+
readonly name: "Sync";
|
|
226
|
+
readonly inputs: readonly [{
|
|
227
|
+
readonly name: "reserve0";
|
|
228
|
+
readonly type: "uint112";
|
|
229
|
+
readonly indexed: false;
|
|
230
|
+
}, {
|
|
231
|
+
readonly name: "reserve1";
|
|
232
|
+
readonly type: "uint112";
|
|
233
|
+
readonly indexed: false;
|
|
234
|
+
}];
|
|
235
|
+
}];
|
|
236
|
+
//# sourceMappingURL=amm-v2-pair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amm-v2-pair.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/amm-v2-pair.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFlB,CAAA;AAEV,8CAA8C;AAC9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkB,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* AMM V2 Pair ABI
|
|
3
|
+
* Compatible with Lux V2 Pair interface
|
|
3
4
|
*/
|
|
4
|
-
export const
|
|
5
|
+
export const AMM_V2_PAIR_ABI = [
|
|
5
6
|
{
|
|
6
7
|
type: 'function',
|
|
7
8
|
name: 'token0',
|
|
@@ -83,3 +84,5 @@ export const UNISWAP_V2_PAIR_ABI = [
|
|
|
83
84
|
],
|
|
84
85
|
},
|
|
85
86
|
];
|
|
87
|
+
/** @deprecated Use AMM_V2_PAIR_ABI instead */
|
|
88
|
+
export const LUX_V2_PAIR_ABI = AMM_V2_PAIR_ABI;
|