@rabby-wallet/rabby-swap 0.0.47-alpha.2 → 0.0.47-alpha.3
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 +1 -2
- package/dist/consts.js +0 -1
- package/dist/dexs/magpie.js +4 -0
- package/dist/dexs/wrapToken.js +3 -0
- package/dist/list.d.ts +2 -23
- package/dist/list.js +12 -24
- package/dist/quote.js +0 -5
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/dexs/uniswap_api.d.ts +0 -5
- package/dist/dexs/uniswap_api.js +0 -22
package/dist/consts.d.ts
CHANGED
package/dist/consts.js
CHANGED
package/dist/dexs/magpie.js
CHANGED
package/dist/dexs/wrapToken.js
CHANGED
|
@@ -37,6 +37,9 @@ export const SUPPORT_CHAINS = [
|
|
|
37
37
|
CHAINS_ENUM.BLAST,
|
|
38
38
|
CHAINS_ENUM.METIS,
|
|
39
39
|
CHAINS_ENUM.MANTA,
|
|
40
|
+
"TAIKO",
|
|
41
|
+
"INK",
|
|
42
|
+
"BERA",
|
|
40
43
|
];
|
|
41
44
|
export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
45
|
if (!options.chainServerId || !options.nativeTokenAddress) {
|
package/dist/list.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export declare const DEX_SUPPORT_CHAINS: {
|
|
|
34
34
|
ODOS: CHAINS_ENUM[];
|
|
35
35
|
"0xAPIV2": CHAINS_ENUM[];
|
|
36
36
|
Magpie: CHAINS_ENUM[];
|
|
37
|
-
UniswapAPi: CHAINS_ENUM[];
|
|
38
37
|
};
|
|
39
38
|
export declare const DEX_ROUTER_WHITELIST: {
|
|
40
39
|
"1inch": {
|
|
@@ -156,17 +155,7 @@ export declare const DEX_ROUTER_WHITELIST: {
|
|
|
156
155
|
METIS: string;
|
|
157
156
|
SCRL: string;
|
|
158
157
|
ERA: string;
|
|
159
|
-
|
|
160
|
-
UniswapAPi: {
|
|
161
|
-
ETH: string;
|
|
162
|
-
OP: string;
|
|
163
|
-
ARBITRUM: string;
|
|
164
|
-
BSC: string;
|
|
165
|
-
AVAX: string;
|
|
166
|
-
POLYGON: string;
|
|
167
|
-
BASE: string;
|
|
168
|
-
BLAST: string;
|
|
169
|
-
ERA: string;
|
|
158
|
+
LINEA: string;
|
|
170
159
|
};
|
|
171
160
|
};
|
|
172
161
|
export declare const DEX_SPENDER_WHITELIST: {
|
|
@@ -290,16 +279,6 @@ export declare const DEX_SPENDER_WHITELIST: {
|
|
|
290
279
|
METIS: string;
|
|
291
280
|
SCRL: string;
|
|
292
281
|
ERA: string;
|
|
293
|
-
|
|
294
|
-
UniswapAPi: {
|
|
295
|
-
ETH: string;
|
|
296
|
-
OP: string;
|
|
297
|
-
ARBITRUM: string;
|
|
298
|
-
BSC: string;
|
|
299
|
-
AVAX: string;
|
|
300
|
-
POLYGON: string;
|
|
301
|
-
BASE: string;
|
|
302
|
-
BLAST: string;
|
|
303
|
-
ERA: string;
|
|
282
|
+
LINEA: string;
|
|
304
283
|
};
|
|
305
284
|
};
|
package/dist/list.js
CHANGED
|
@@ -9,7 +9,6 @@ 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 uniswapApiSupportChains } from "./dexs/uniswap_api";
|
|
13
12
|
import { DEX_ENUM } from "./consts";
|
|
14
13
|
export const WrapTokenAddressMap = {
|
|
15
14
|
[CHAINS_ENUM.ETH]: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
@@ -36,6 +35,10 @@ export const WrapTokenAddressMap = {
|
|
|
36
35
|
[CHAINS_ENUM.BLAST]: "0x4300000000000000000000000000000000000004",
|
|
37
36
|
[CHAINS_ENUM.METIS]: "0x75cb093e4d61d2a2e65d8e0bbb01de8d89b53481",
|
|
38
37
|
[CHAINS_ENUM.MANTA]: "0x0dc808adce2099a9f62aa87d9670745aba741746",
|
|
38
|
+
["INK"]: "0x4200000000000000000000000000000000000006",
|
|
39
|
+
["TAIKO"]: "0xa51894664a773981c6c112c43ce576f315d5b1b6",
|
|
40
|
+
// bera has not wrapped token
|
|
41
|
+
["BERA"]: "no wrapped token",
|
|
39
42
|
};
|
|
40
43
|
export const DEX_SUPPORT_CHAINS = {
|
|
41
44
|
[DEX_ENUM.WRAPTOKEN]: wrapTokenSupportChains,
|
|
@@ -48,7 +51,6 @@ export const DEX_SUPPORT_CHAINS = {
|
|
|
48
51
|
[DEX_ENUM.ODOS]: odosSupportChains,
|
|
49
52
|
[DEX_ENUM.ZEROXAPIV2]: zeroXV2SupportChains,
|
|
50
53
|
[DEX_ENUM.MAGPIE]: magpieSupportChains,
|
|
51
|
-
[DEX_ENUM.UNISWAP_API]: uniswapApiSupportChains,
|
|
52
54
|
};
|
|
53
55
|
export const DEX_ROUTER_WHITELIST = {
|
|
54
56
|
[DEX_ENUM.ONEINCH]: {
|
|
@@ -170,17 +172,10 @@ export const DEX_ROUTER_WHITELIST = {
|
|
|
170
172
|
[CHAINS_ENUM.METIS]: "0x2b14763c27b9661182c2503f6c9c4d47ba747dd2",
|
|
171
173
|
[CHAINS_ENUM.SCRL]: "0x52bebb970697476313ae2b3383f40d4afd4ad9d3",
|
|
172
174
|
[CHAINS_ENUM.ERA]: "0x38ae1164ca61ee7aa395bb139b3990e347988ce1",
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
[
|
|
176
|
-
[CHAINS_ENUM.
|
|
177
|
-
[CHAINS_ENUM.ARBITRUM]: "0x5E325eDA8064b456f4781070C0738d849c824258",
|
|
178
|
-
[CHAINS_ENUM.BSC]: "0x4Dae2f939ACf50408e13d58534Ff8c2776d45265",
|
|
179
|
-
[CHAINS_ENUM.AVAX]: "0x4Dae2f939ACf50408e13d58534Ff8c2776d45265",
|
|
180
|
-
[CHAINS_ENUM.POLYGON]: "0xec7BE89e9d109e7e3Fec59c222CF297125FEFda2",
|
|
181
|
-
[CHAINS_ENUM.BASE]: "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
|
|
182
|
-
[CHAINS_ENUM.BLAST]: "0x643770E279d5D0733F21d6DC03A8efbABf3255B4",
|
|
183
|
-
[CHAINS_ENUM.ERA]: "0x28731BCC616B5f51dD52CF2e4dF0E78dD1136C06",
|
|
175
|
+
["TAIKO"]: "0x2b14763c27b9661182c2503f6c9c4d47ba747dd2",
|
|
176
|
+
["INK"]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
177
|
+
["BERA"]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
178
|
+
[CHAINS_ENUM.LINEA]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
184
179
|
},
|
|
185
180
|
};
|
|
186
181
|
export const DEX_SPENDER_WHITELIST = {
|
|
@@ -304,16 +299,9 @@ export const DEX_SPENDER_WHITELIST = {
|
|
|
304
299
|
[CHAINS_ENUM.METIS]: "0x2b14763c27b9661182c2503f6c9c4d47ba747dd2",
|
|
305
300
|
[CHAINS_ENUM.SCRL]: "0x52bebb970697476313ae2b3383f40d4afd4ad9d3",
|
|
306
301
|
[CHAINS_ENUM.ERA]: "0x38ae1164ca61ee7aa395bb139b3990e347988ce1",
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
[
|
|
310
|
-
[CHAINS_ENUM.
|
|
311
|
-
[CHAINS_ENUM.ARBITRUM]: "0x5E325eDA8064b456f4781070C0738d849c824258",
|
|
312
|
-
[CHAINS_ENUM.BSC]: "0x4Dae2f939ACf50408e13d58534Ff8c2776d45265",
|
|
313
|
-
[CHAINS_ENUM.AVAX]: "0x4Dae2f939ACf50408e13d58534Ff8c2776d45265",
|
|
314
|
-
[CHAINS_ENUM.POLYGON]: "0xec7BE89e9d109e7e3Fec59c222CF297125FEFda2",
|
|
315
|
-
[CHAINS_ENUM.BASE]: "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
|
|
316
|
-
[CHAINS_ENUM.BLAST]: "0x643770E279d5D0733F21d6DC03A8efbABf3255B4",
|
|
317
|
-
[CHAINS_ENUM.ERA]: "0x28731BCC616B5f51dD52CF2e4dF0E78dD1136C06",
|
|
302
|
+
["TAIKO"]: "0x2b14763c27b9661182c2503f6c9c4d47ba747dd2",
|
|
303
|
+
["INK"]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
304
|
+
["BERA"]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
305
|
+
[CHAINS_ENUM.LINEA]: "0xba7bAC71a8Ee550d89B827FE6d67bc3dCA07b104",
|
|
318
306
|
},
|
|
319
307
|
};
|
package/dist/quote.js
CHANGED
|
@@ -19,7 +19,6 @@ 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 uniswapApiGetQuote, decodeCalldata as uniswapApiDecodeCalldata, } from "./dexs/uniswap_api";
|
|
23
22
|
export const getQuote = (id, params, api) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
23
|
switch (id) {
|
|
25
24
|
case DEX_ENUM.WRAPTOKEN:
|
|
@@ -44,8 +43,6 @@ export const getQuote = (id, params, api) => __awaiter(void 0, void 0, void 0, f
|
|
|
44
43
|
return yield zeroXV2GetQuote(params, api);
|
|
45
44
|
case DEX_ENUM.MAGPIE:
|
|
46
45
|
return yield magpieGetQuote(params, api);
|
|
47
|
-
case DEX_ENUM.UNISWAP_API:
|
|
48
|
-
return yield uniswapApiGetQuote(params, api);
|
|
49
46
|
default:
|
|
50
47
|
throw new Error(`${id} is not supported!`);
|
|
51
48
|
}
|
|
@@ -72,8 +69,6 @@ export const decodeCalldata = (id, tx) => {
|
|
|
72
69
|
return zeroXV2DecodeCalldata(tx);
|
|
73
70
|
case DEX_ENUM.MAGPIE:
|
|
74
71
|
return magpieDecodeCalldata(tx);
|
|
75
|
-
case DEX_ENUM.UNISWAP_API:
|
|
76
|
-
return uniswapApiDecodeCalldata(tx);
|
|
77
72
|
default:
|
|
78
73
|
throw new Error(`${id} is not supported!`);
|
|
79
74
|
}
|
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";
|
|
9
9
|
dex: DEX_ENUM;
|
|
10
10
|
}) => (options: QuoteParams, api: OpenApiService) => Promise<QuoteResult>;
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
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;
|
package/dist/dexs/uniswap_api.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CHAINS_ENUM } from "@debank/common";
|
|
2
|
-
import { generateGetQuote } from "../utils";
|
|
3
|
-
import { DEX_ENUM } from "../consts";
|
|
4
|
-
export const SUPPORT_CHAINS = [
|
|
5
|
-
CHAINS_ENUM.ETH,
|
|
6
|
-
CHAINS_ENUM.OP,
|
|
7
|
-
CHAINS_ENUM.ARBITRUM,
|
|
8
|
-
CHAINS_ENUM.BSC,
|
|
9
|
-
CHAINS_ENUM.AVAX,
|
|
10
|
-
CHAINS_ENUM.POLYGON,
|
|
11
|
-
CHAINS_ENUM.BASE,
|
|
12
|
-
CHAINS_ENUM.BLAST,
|
|
13
|
-
CHAINS_ENUM.ERA,
|
|
14
|
-
];
|
|
15
|
-
export const getQuote = generateGetQuote({
|
|
16
|
-
SUPPORT_CHAINS,
|
|
17
|
-
id: "uni",
|
|
18
|
-
dex: DEX_ENUM.UNISWAP_API,
|
|
19
|
-
});
|
|
20
|
-
export const decodeCalldata = (tx) => {
|
|
21
|
-
return null;
|
|
22
|
-
};
|