@rabby-wallet/rabby-swap 0.0.80-alpha.0 → 0.0.80-alpha.2
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/dexs/kyberswap.js +1 -0
- package/dist/dexs/openocean.js +1 -0
- package/dist/dexs/uni.js +2 -0
- package/dist/list.js +6 -0
- package/dist/tokenPools.d.ts +3 -4
- package/dist/tokenPools.js +6 -14
- package/package.json +1 -1
package/dist/dexs/kyberswap.js
CHANGED
package/dist/dexs/openocean.js
CHANGED
package/dist/dexs/uni.js
CHANGED
|
@@ -15,6 +15,7 @@ export const SUPPORT_CHAINS = [
|
|
|
15
15
|
"UNI",
|
|
16
16
|
"TEMPO",
|
|
17
17
|
"MONAD",
|
|
18
|
+
"HOOD",
|
|
18
19
|
];
|
|
19
20
|
export const UNI_NATIVE_TO_ADDRESSES = {
|
|
20
21
|
[CHAINS_ENUM.ETH]: "0x66a9893cC07D91D95644AEDD05D03f95e1dBA8Af",
|
|
@@ -30,6 +31,7 @@ export const UNI_NATIVE_TO_ADDRESSES = {
|
|
|
30
31
|
["UNI"]: "0xEf740bf23aCaE26f6492B10de645D6B98dC8Eaf3",
|
|
31
32
|
["TEMPO"]: "0x1FEbB76Be10aAf3A1402F04e8E835f2c382F7914",
|
|
32
33
|
["MONAD"]: "0x0d97dc33264bfc1c226207428a79b26757fb9dc3",
|
|
34
|
+
["HOOD"]: "0x8876789976decbfcbbbe364623c63652db8c0904",
|
|
33
35
|
};
|
|
34
36
|
export const getQuote = generateGetQuote({
|
|
35
37
|
SUPPORT_CHAINS,
|
package/dist/list.js
CHANGED
|
@@ -176,6 +176,7 @@ export const DEX_ROUTER_WHITELIST = {
|
|
|
176
176
|
["PLASMA"]: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
|
|
177
177
|
["MONAD"]: "0x6352a56caadc4f1e25cd6c75970fa768a3304e64",
|
|
178
178
|
[CHAINS_ENUM.RSK]: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
|
|
179
|
+
["HOOD"]: "0x6352a56caadc4f1e25cd6c75970fa768a3304e64",
|
|
179
180
|
},
|
|
180
181
|
[DEX_ENUM.KYBERSWAP]: {
|
|
181
182
|
[CHAINS_ENUM.ETH]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
|
|
@@ -200,6 +201,7 @@ export const DEX_ROUTER_WHITELIST = {
|
|
|
200
201
|
["HYPER"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
201
202
|
["UNI"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
202
203
|
["PLASMA"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
204
|
+
["HOOD"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
203
205
|
},
|
|
204
206
|
[DEX_ENUM.PARASWAPV6]: {
|
|
205
207
|
[CHAINS_ENUM.ETH]: "0x6A000F20005980200259B80c5102003040001068",
|
|
@@ -294,6 +296,7 @@ export const DEX_ROUTER_WHITELIST = {
|
|
|
294
296
|
["UNI"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
295
297
|
["TEMPO"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
296
298
|
["MONAD"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
299
|
+
["HOOD"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
297
300
|
},
|
|
298
301
|
};
|
|
299
302
|
export const DEX_SPENDER_WHITELIST = {
|
|
@@ -402,6 +405,7 @@ export const DEX_SPENDER_WHITELIST = {
|
|
|
402
405
|
["PLASMA"]: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
|
|
403
406
|
["MONAD"]: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
|
|
404
407
|
[CHAINS_ENUM.RSK]: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
|
|
408
|
+
["HOOD"]: "0x6352a56caadc4f1e25cd6c75970fa768a3304e64",
|
|
405
409
|
},
|
|
406
410
|
[DEX_ENUM.KYBERSWAP]: {
|
|
407
411
|
[CHAINS_ENUM.ETH]: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
|
|
@@ -426,6 +430,7 @@ export const DEX_SPENDER_WHITELIST = {
|
|
|
426
430
|
["HYPER"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
427
431
|
["UNI"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
428
432
|
["PLASMA"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
433
|
+
["HOOD"]: "0x6131b5fae19ea4f9d964eac0408e4408b66337b5",
|
|
429
434
|
},
|
|
430
435
|
[DEX_ENUM.PARASWAPV6]: {
|
|
431
436
|
[CHAINS_ENUM.ETH]: "0x6A000F20005980200259B80c5102003040001068",
|
|
@@ -520,5 +525,6 @@ export const DEX_SPENDER_WHITELIST = {
|
|
|
520
525
|
["UNI"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
521
526
|
["TEMPO"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
522
527
|
["MONAD"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
528
|
+
["HOOD"]: "0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9",
|
|
523
529
|
},
|
|
524
530
|
};
|
package/dist/tokenPools.d.ts
CHANGED
|
@@ -13,10 +13,9 @@ export declare const STABLE_TOKEN_POOL: readonly TokenPoolToken[];
|
|
|
13
13
|
export declare const NATIVE_AND_DERIVATIVE_TOKEN_POOL: readonly TokenPoolToken[];
|
|
14
14
|
/**
|
|
15
15
|
* Returns true when both tokens form a same-type pair in the same pool:
|
|
16
|
-
* either two stablecoins, or
|
|
17
|
-
* native-equivalent/derivative pair.
|
|
16
|
+
* either two stablecoins, or two native/derivative tokens.
|
|
18
17
|
*
|
|
19
|
-
* Lookup is O(1) after module initialization. Tokens from different pools
|
|
20
|
-
*
|
|
18
|
+
* Lookup is O(1) after module initialization. Tokens from different pools do
|
|
19
|
+
* not match.
|
|
21
20
|
*/
|
|
22
21
|
export declare const isSameTypeTokenPair: (tokenA: TokenPoolLookupToken | null | undefined, tokenB: TokenPoolLookupToken | null | undefined) => boolean;
|
package/dist/tokenPools.js
CHANGED
|
@@ -115,10 +115,9 @@ export const STABLE_TOKEN_POOL = [
|
|
|
115
115
|
{ chain: "xlayer", id: "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34" }, // USDe
|
|
116
116
|
];
|
|
117
117
|
/**
|
|
118
|
-
* Native-equivalent and derivative
|
|
118
|
+
* Native-equivalent and derivative tokens.
|
|
119
119
|
*
|
|
120
|
-
*
|
|
121
|
-
* ETH <-> stETH and WETH <-> stETH while rejecting stETH <-> cbETH.
|
|
120
|
+
* Any two tokens in this pool form a same-type pair on the same chain.
|
|
122
121
|
*/
|
|
123
122
|
const ETH_NATIVE_TOKEN = { chain: "eth", id: "eth" }; // ETH
|
|
124
123
|
const ETH_WRAPPED_NATIVE_TOKEN = {
|
|
@@ -148,14 +147,12 @@ const isTokenPoolLookupToken = (token) => !!token &&
|
|
|
148
147
|
const getTokenKey = (token) => `${token.chain.toLowerCase()}${TOKEN_KEY_SEPARATOR}${token.id.toLowerCase()}`;
|
|
149
148
|
const stableTokenKeySet = new Set(STABLE_TOKEN_POOL.map(getTokenKey));
|
|
150
149
|
const nativeAndDerivativeTokenKeySet = new Set(NATIVE_AND_DERIVATIVE_TOKEN_POOL.map(getTokenKey));
|
|
151
|
-
const nativeEquivalentTokenKeySet = new Set([ETH_NATIVE_TOKEN, ETH_WRAPPED_NATIVE_TOKEN].map(getTokenKey));
|
|
152
150
|
/**
|
|
153
151
|
* Returns true when both tokens form a same-type pair in the same pool:
|
|
154
|
-
* either two stablecoins, or
|
|
155
|
-
* native-equivalent/derivative pair.
|
|
152
|
+
* either two stablecoins, or two native/derivative tokens.
|
|
156
153
|
*
|
|
157
|
-
* Lookup is O(1) after module initialization. Tokens from different pools
|
|
158
|
-
*
|
|
154
|
+
* Lookup is O(1) after module initialization. Tokens from different pools do
|
|
155
|
+
* not match.
|
|
159
156
|
*/
|
|
160
157
|
export const isSameTypeTokenPair = (tokenA, tokenB) => {
|
|
161
158
|
if (!isTokenPoolLookupToken(tokenA) || !isTokenPoolLookupToken(tokenB)) {
|
|
@@ -170,11 +167,6 @@ export const isSameTypeTokenPair = (tokenA, tokenB) => {
|
|
|
170
167
|
stableTokenKeySet.has(tokenBKey)) {
|
|
171
168
|
return true;
|
|
172
169
|
}
|
|
173
|
-
if (tokenAKey === tokenBKey) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
170
|
return (nativeAndDerivativeTokenKeySet.has(tokenAKey) &&
|
|
177
|
-
nativeAndDerivativeTokenKeySet.has(tokenBKey)
|
|
178
|
-
(nativeEquivalentTokenKeySet.has(tokenAKey) ||
|
|
179
|
-
nativeEquivalentTokenKeySet.has(tokenBKey)));
|
|
171
|
+
nativeAndDerivativeTokenKeySet.has(tokenBKey));
|
|
180
172
|
};
|