@rabby-wallet/rabby-swap 0.0.47-alpha.4 → 0.0.48
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/consts.d.ts +2 -1
- package/dist/consts.js +1 -0
- package/dist/dexs/rabby.d.ts +5 -0
- package/dist/dexs/rabby.js +13 -0
- package/dist/list.d.ts +7 -0
- package/dist/list.js +8 -0
- package/dist/quote.js +5 -0
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/consts.d.ts
CHANGED
package/dist/consts.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CHAINS_ENUM } from "@debank/common";
|
|
2
|
+
import { TxWithChainId, DecodeCalldataResult } from "../quote";
|
|
3
|
+
export declare const SUPPORT_CHAINS: CHAINS_ENUM[];
|
|
4
|
+
export declare const getQuote: (options: import("../quote").QuoteParams, api: import("@rabby-wallet/rabby-api").OpenApiService) => Promise<import("../quote").QuoteResult>;
|
|
5
|
+
export declare const decodeCalldata: (tx: TxWithChainId) => DecodeCalldataResult | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CHAINS_ENUM } from "@debank/common";
|
|
2
|
+
import { generateGetQuote } from "../utils";
|
|
3
|
+
import { DEX_ENUM } from "../consts";
|
|
4
|
+
const NATIVE_TOKEN = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
5
|
+
export const SUPPORT_CHAINS = [CHAINS_ENUM.ETH];
|
|
6
|
+
export const getQuote = generateGetQuote({
|
|
7
|
+
SUPPORT_CHAINS,
|
|
8
|
+
id: "rabby",
|
|
9
|
+
dex: DEX_ENUM.RABBY,
|
|
10
|
+
});
|
|
11
|
+
export const decodeCalldata = (tx) => {
|
|
12
|
+
return null;
|
|
13
|
+
};
|
package/dist/list.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare const DEX_SUPPORT_CHAINS: {
|
|
|
34
34
|
ODOS: CHAINS_ENUM[];
|
|
35
35
|
"0xAPIV2": CHAINS_ENUM[];
|
|
36
36
|
Magpie: CHAINS_ENUM[];
|
|
37
|
+
Rabby: CHAINS_ENUM[];
|
|
37
38
|
};
|
|
38
39
|
export declare const DEX_ROUTER_WHITELIST: {
|
|
39
40
|
"1inch": {
|
|
@@ -157,6 +158,9 @@ export declare const DEX_ROUTER_WHITELIST: {
|
|
|
157
158
|
ERA: string;
|
|
158
159
|
LINEA: string;
|
|
159
160
|
};
|
|
161
|
+
Rabby: {
|
|
162
|
+
LINEA: string;
|
|
163
|
+
};
|
|
160
164
|
};
|
|
161
165
|
export declare const DEX_SPENDER_WHITELIST: {
|
|
162
166
|
"1inch": {
|
|
@@ -281,4 +285,7 @@ export declare const DEX_SPENDER_WHITELIST: {
|
|
|
281
285
|
ERA: string;
|
|
282
286
|
LINEA: string;
|
|
283
287
|
};
|
|
288
|
+
Rabby: {
|
|
289
|
+
LINEA: string;
|
|
290
|
+
};
|
|
284
291
|
};
|
package/dist/list.js
CHANGED
|
@@ -9,6 +9,7 @@ import { SUPPORT_CHAINS as openOceanSupportChains } from "./dexs/openocean";
|
|
|
9
9
|
import { SUPPORT_CHAINS as odosSupportChains } from "./dexs/odos";
|
|
10
10
|
import { SUPPORT_CHAINS as zeroXV2SupportChains } from "./dexs/0xapi_v2";
|
|
11
11
|
import { SUPPORT_CHAINS as magpieSupportChains } from "./dexs/magpie";
|
|
12
|
+
import { SUPPORT_CHAINS as rabbySupportChains } from "./dexs/rabby";
|
|
12
13
|
import { DEX_ENUM } from "./consts";
|
|
13
14
|
export const WrapTokenAddressMap = {
|
|
14
15
|
[CHAINS_ENUM.ETH]: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
@@ -50,6 +51,7 @@ export const DEX_SUPPORT_CHAINS = {
|
|
|
50
51
|
[DEX_ENUM.ODOS]: odosSupportChains,
|
|
51
52
|
[DEX_ENUM.ZEROXAPIV2]: zeroXV2SupportChains,
|
|
52
53
|
[DEX_ENUM.MAGPIE]: magpieSupportChains,
|
|
54
|
+
[DEX_ENUM.RABBY]: rabbySupportChains,
|
|
53
55
|
};
|
|
54
56
|
export const DEX_ROUTER_WHITELIST = {
|
|
55
57
|
[DEX_ENUM.ONEINCH]: {
|
|
@@ -176,6 +178,9 @@ export const DEX_ROUTER_WHITELIST = {
|
|
|
176
178
|
["BERA"]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
177
179
|
[CHAINS_ENUM.LINEA]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
178
180
|
},
|
|
181
|
+
[DEX_ENUM.RABBY]: {
|
|
182
|
+
[CHAINS_ENUM.LINEA]: "0x7fd9cfeef127451918c688c49e9905e47da3e985",
|
|
183
|
+
},
|
|
179
184
|
};
|
|
180
185
|
export const DEX_SPENDER_WHITELIST = {
|
|
181
186
|
[DEX_ENUM.ONEINCH]: {
|
|
@@ -303,4 +308,7 @@ export const DEX_SPENDER_WHITELIST = {
|
|
|
303
308
|
["BERA"]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
304
309
|
[CHAINS_ENUM.LINEA]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
305
310
|
},
|
|
311
|
+
[DEX_ENUM.RABBY]: {
|
|
312
|
+
[CHAINS_ENUM.LINEA]: "0x7fd9cfeef127451918c688c49e9905e47da3e985",
|
|
313
|
+
},
|
|
306
314
|
};
|
package/dist/quote.js
CHANGED
|
@@ -19,6 +19,7 @@ import { getQuote as paraSwapV6GetQuote, decodeCalldata as paraSwapV6DecodeCalld
|
|
|
19
19
|
import { getQuote as odosGetQuote, decodeCalldata as odosDecodeCalldata, } from "./dexs/odos";
|
|
20
20
|
import { getQuote as zeroXV2GetQuote, decodeCalldata as zeroXV2DecodeCalldata, } from "./dexs/0xapi_v2";
|
|
21
21
|
import { getQuote as magpieGetQuote, decodeCalldata as magpieDecodeCalldata, } from "./dexs/magpie";
|
|
22
|
+
import { getQuote as rabbyGetQuote, decodeCalldata as rabbyDecodeCalldata, } from "./dexs/rabby";
|
|
22
23
|
export const getQuote = (id, params, api) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
24
|
switch (id) {
|
|
24
25
|
case DEX_ENUM.WRAPTOKEN:
|
|
@@ -43,6 +44,8 @@ export const getQuote = (id, params, api) => __awaiter(void 0, void 0, void 0, f
|
|
|
43
44
|
return yield zeroXV2GetQuote(params, api);
|
|
44
45
|
case DEX_ENUM.MAGPIE:
|
|
45
46
|
return yield magpieGetQuote(params, api);
|
|
47
|
+
case DEX_ENUM.RABBY:
|
|
48
|
+
return yield rabbyGetQuote(params, api);
|
|
46
49
|
default:
|
|
47
50
|
throw new Error(`${id} is not supported!`);
|
|
48
51
|
}
|
|
@@ -69,6 +72,8 @@ export const decodeCalldata = (id, tx) => {
|
|
|
69
72
|
return zeroXV2DecodeCalldata(tx);
|
|
70
73
|
case DEX_ENUM.MAGPIE:
|
|
71
74
|
return magpieDecodeCalldata(tx);
|
|
75
|
+
case DEX_ENUM.RABBY:
|
|
76
|
+
return rabbyDecodeCalldata(tx);
|
|
72
77
|
default:
|
|
73
78
|
throw new Error(`${id} is not supported!`);
|
|
74
79
|
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ import { DEX_ENUM } from "./consts";
|
|
|
5
5
|
export declare const isSameAddress: (addr1: string, addr2: string) => boolean;
|
|
6
6
|
export declare const generateGetQuote: ({ SUPPORT_CHAINS, id, dex, }: {
|
|
7
7
|
SUPPORT_CHAINS: CHAINS_ENUM[];
|
|
8
|
-
id: "uniswap3" | "matcha" | "matcha_v2" | "openocean" | "1inch_v6" | "paraswap" | "kyberswap" | "odos" | "paraswap_v6" | "magpie";
|
|
8
|
+
id: "uniswap3" | "matcha" | "matcha_v2" | "openocean" | "1inch_v6" | "paraswap" | "kyberswap" | "odos" | "paraswap_v6" | "magpie" | "rabby";
|
|
9
9
|
dex: DEX_ENUM;
|
|
10
10
|
}) => (options: QuoteParams, api: OpenApiService) => Promise<QuoteResult>;
|