@rabby-wallet/rabby-swap 0.0.19 → 0.0.21
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/abi.d.ts +144 -0
- package/dist/abi.js +766 -0
- package/dist/consts.d.ts +96 -0
- package/dist/consts.js +127 -0
- package/dist/dexs/0xapi.d.ts +5 -0
- package/dist/dexs/0xapi.js +124 -0
- package/dist/dexs/1inch.d.ts +5 -0
- package/dist/dexs/1inch.js +112 -0
- package/dist/dexs/openocean.d.ts +5 -0
- package/dist/dexs/openocean.js +165 -0
- package/dist/dexs/paraswap.d.ts +5 -0
- package/dist/dexs/paraswap.js +180 -0
- package/dist/dexs/wrapToken.d.ts +4 -0
- package/dist/dexs/wrapToken.js +71 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/quote.d.ts +45 -0
- package/dist/quote.js +44 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +5 -0
- package/package.json +47 -44
- package/__tests__/decodeCalldata.ts +0 -338
- package/babel.config.json +0 -3
- package/jest.config.ts +0 -10
- package/src/abi.ts +0 -769
- package/src/consts.ts +0 -132
- package/src/dexs/0xapi.ts +0 -158
- package/src/dexs/1inch.ts +0 -165
- package/src/dexs/openocean.ts +0 -217
- package/src/dexs/paraswap.ts +0 -280
- package/src/dexs/wrapToken.ts +0 -74
- package/src/index.ts +0 -17
- package/src/quote.ts +0 -85
- package/src/utils.ts +0 -4
- package/svgTransform.js +0 -11
- package/tsconfig.json +0 -14
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import axios from "axios";
|
|
11
|
+
import { Interface } from "@ethersproject/abi";
|
|
12
|
+
import { CHAINS_ENUM, CHAINS } from "@debank/common";
|
|
13
|
+
import { isSameAddress } from "../utils";
|
|
14
|
+
import { ParaSwapABI } from "../abi";
|
|
15
|
+
import { DEX_ENUM, DEX_SPENDER_WHITELIST } from "../consts";
|
|
16
|
+
const NATIVE_TOKEN = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
17
|
+
const request = axios.create({
|
|
18
|
+
baseURL: "https://apiv5.paraswap.io",
|
|
19
|
+
});
|
|
20
|
+
request.interceptors.response.use((response) => {
|
|
21
|
+
var _a, _b, _c;
|
|
22
|
+
const code = (_a = response.data) === null || _a === void 0 ? void 0 : _a.statusCode;
|
|
23
|
+
const msg = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.description) || ((_c = response.data) === null || _c === void 0 ? void 0 : _c.error);
|
|
24
|
+
if (code && code !== 200) {
|
|
25
|
+
if (msg) {
|
|
26
|
+
let err;
|
|
27
|
+
try {
|
|
28
|
+
err = new Error(JSON.parse(msg));
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
err = new Error(msg);
|
|
32
|
+
}
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
throw new Error(response.data);
|
|
36
|
+
}
|
|
37
|
+
return response;
|
|
38
|
+
});
|
|
39
|
+
export const SUPPORT_CHAINS = [
|
|
40
|
+
CHAINS_ENUM.ETH,
|
|
41
|
+
CHAINS_ENUM.POLYGON,
|
|
42
|
+
CHAINS_ENUM.BSC,
|
|
43
|
+
CHAINS_ENUM.AVAX,
|
|
44
|
+
CHAINS_ENUM.OP,
|
|
45
|
+
CHAINS_ENUM.ARBITRUM,
|
|
46
|
+
CHAINS_ENUM.FTM,
|
|
47
|
+
];
|
|
48
|
+
const getPriceRoute = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
const { data } = yield request.get("/prices", {
|
|
50
|
+
params,
|
|
51
|
+
});
|
|
52
|
+
return data;
|
|
53
|
+
});
|
|
54
|
+
export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
+
const chainId = CHAINS[options.chain].id;
|
|
56
|
+
if (!SUPPORT_CHAINS.includes(options.chain)) {
|
|
57
|
+
throw new Error(`${CHAINS[options.chain]} is not support on 1inch`);
|
|
58
|
+
}
|
|
59
|
+
const { priceRoute } = yield getPriceRoute({
|
|
60
|
+
srcDecimals: options.fromTokenDecimals,
|
|
61
|
+
srcToken: options.fromToken === CHAINS[options.chain].nativeTokenAddress
|
|
62
|
+
? NATIVE_TOKEN
|
|
63
|
+
: options.fromToken,
|
|
64
|
+
destToken: options.toToken === CHAINS[options.chain].nativeTokenAddress
|
|
65
|
+
? NATIVE_TOKEN
|
|
66
|
+
: options.toToken,
|
|
67
|
+
amount: options.amount,
|
|
68
|
+
userAddress: options.userAddress,
|
|
69
|
+
network: chainId,
|
|
70
|
+
includeContractMethods: "simpleSwap,multiSwap,megaSwap",
|
|
71
|
+
excludeDEXS: "ParaSwapPool,ParaSwapLimitOrders,Hashflow",
|
|
72
|
+
partner: "Rabby",
|
|
73
|
+
});
|
|
74
|
+
const params = {
|
|
75
|
+
srcToken: options.fromToken === CHAINS[options.chain].nativeTokenAddress
|
|
76
|
+
? NATIVE_TOKEN
|
|
77
|
+
: options.fromToken,
|
|
78
|
+
srcDecimals: options.fromTokenDecimals,
|
|
79
|
+
destToken: options.toToken === CHAINS[options.chain].nativeTokenAddress
|
|
80
|
+
? NATIVE_TOKEN
|
|
81
|
+
: options.toToken,
|
|
82
|
+
srcAmount: options.amount,
|
|
83
|
+
userAddress: options.userAddress,
|
|
84
|
+
slippage: Math.floor(options.slippage * 100),
|
|
85
|
+
priceRoute: priceRoute,
|
|
86
|
+
partner: "Rabby",
|
|
87
|
+
deadline: Math.floor(Date.now() / 1000) + 21600,
|
|
88
|
+
};
|
|
89
|
+
if (options.feeRate !== null && options.feeRate !== undefined) {
|
|
90
|
+
params.partnerFeeBps = (options.feeRate * 100).toString();
|
|
91
|
+
params.partnerAddress = options.feeAddress;
|
|
92
|
+
}
|
|
93
|
+
const { data } = yield request.post(`/transactions/${chainId}`, params, {
|
|
94
|
+
params: {
|
|
95
|
+
ignoreChecks: true,
|
|
96
|
+
ignoreGasEstimate: true,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
return {
|
|
100
|
+
tx: data,
|
|
101
|
+
fromToken: priceRoute.srcToken === NATIVE_TOKEN
|
|
102
|
+
? CHAINS[options.chain].nativeTokenAddress
|
|
103
|
+
: priceRoute.srcToken,
|
|
104
|
+
fromTokenAmount: priceRoute.srcAmount,
|
|
105
|
+
fromTokenDecimals: priceRoute.srcDecimals,
|
|
106
|
+
toToken: priceRoute.destToken === NATIVE_TOKEN
|
|
107
|
+
? CHAINS[options.chain].nativeTokenAddress
|
|
108
|
+
: priceRoute.destToken,
|
|
109
|
+
toTokenAmount: priceRoute.destAmount,
|
|
110
|
+
toTokenDecimals: priceRoute.destDecimals,
|
|
111
|
+
spender: DEX_SPENDER_WHITELIST[DEX_ENUM.PARASWAP][options.chain],
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
export const decodeCalldata = (tx) => {
|
|
115
|
+
const chain = Object.values(CHAINS).find((item) => item.id === tx.chainId);
|
|
116
|
+
const nullAddress = "0x0000000000000000000000000000000000000000";
|
|
117
|
+
if (!chain)
|
|
118
|
+
return null;
|
|
119
|
+
const contractInterface = new Interface(ParaSwapABI);
|
|
120
|
+
const result = contractInterface.parseTransaction({
|
|
121
|
+
data: tx.data,
|
|
122
|
+
});
|
|
123
|
+
switch (result.name) {
|
|
124
|
+
case "simpleSwap": {
|
|
125
|
+
const [data] = result.args;
|
|
126
|
+
const [fromToken, toToken, fromAmount, toAmount, expectedAmount, callees, exchangeData, startIndexes, values, beneficiary,] = data;
|
|
127
|
+
if (!fromToken || !toToken || !fromAmount || !toAmount)
|
|
128
|
+
return null;
|
|
129
|
+
return {
|
|
130
|
+
fromToken: isSameAddress(fromToken, NATIVE_TOKEN)
|
|
131
|
+
? chain.nativeTokenAddress
|
|
132
|
+
: fromToken,
|
|
133
|
+
fromTokenAmount: fromAmount.toString(),
|
|
134
|
+
toToken: isSameAddress(toToken, NATIVE_TOKEN)
|
|
135
|
+
? chain.nativeTokenAddress
|
|
136
|
+
: toToken,
|
|
137
|
+
minReceiveToTokenAmount: toAmount.toString(),
|
|
138
|
+
toTokenReceiver: beneficiary === nullAddress ? tx.from : beneficiary,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
case "multiSwap": {
|
|
142
|
+
const [data] = result.args;
|
|
143
|
+
const [fromToken, fromAmount, toAmount, expectedAmount, beneficiary, path,] = data;
|
|
144
|
+
if (!fromToken || !fromAmount || !toAmount || !path || path.length <= 0)
|
|
145
|
+
return null;
|
|
146
|
+
const [toToken] = path[path.length - 1];
|
|
147
|
+
return {
|
|
148
|
+
fromToken: isSameAddress(fromToken, NATIVE_TOKEN)
|
|
149
|
+
? chain.nativeTokenAddress
|
|
150
|
+
: fromToken,
|
|
151
|
+
fromTokenAmount: fromAmount.toString(),
|
|
152
|
+
toToken: isSameAddress(toToken, NATIVE_TOKEN)
|
|
153
|
+
? chain.nativeTokenAddress
|
|
154
|
+
: toToken,
|
|
155
|
+
minReceiveToTokenAmount: toAmount.toString(),
|
|
156
|
+
toTokenReceiver: beneficiary === nullAddress ? tx.from : beneficiary,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
case "megaSwap":
|
|
160
|
+
const [data] = result.args;
|
|
161
|
+
const [fromToken, fromAmount, toAmount, expectedAmount, beneficiary, path,] = data;
|
|
162
|
+
if (!fromToken || !fromAmount || !toAmount || !path || path.length <= 0)
|
|
163
|
+
return null;
|
|
164
|
+
const [fromAmountPercent, swapPath] = path[0];
|
|
165
|
+
const [toToken] = swapPath[swapPath.length - 1];
|
|
166
|
+
return {
|
|
167
|
+
fromToken: isSameAddress(fromToken, NATIVE_TOKEN)
|
|
168
|
+
? chain.nativeTokenAddress
|
|
169
|
+
: fromToken,
|
|
170
|
+
fromTokenAmount: fromAmount.toString(),
|
|
171
|
+
toToken: isSameAddress(toToken, NATIVE_TOKEN)
|
|
172
|
+
? chain.nativeTokenAddress
|
|
173
|
+
: toToken,
|
|
174
|
+
minReceiveToTokenAmount: toAmount.toString(),
|
|
175
|
+
toTokenReceiver: beneficiary === nullAddress ? tx.from : beneficiary,
|
|
176
|
+
};
|
|
177
|
+
default:
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import abiCoder from "web3-eth-abi";
|
|
11
|
+
import { CHAINS_ENUM, CHAINS } from "@debank/common";
|
|
12
|
+
import { WrapTokenAddressMap } from "../consts";
|
|
13
|
+
import { isSameAddress } from "../utils";
|
|
14
|
+
export const SUPPORT_CHAINS = [
|
|
15
|
+
CHAINS_ENUM.ETH,
|
|
16
|
+
CHAINS_ENUM.POLYGON,
|
|
17
|
+
CHAINS_ENUM.BSC,
|
|
18
|
+
CHAINS_ENUM.OP,
|
|
19
|
+
CHAINS_ENUM.FTM,
|
|
20
|
+
CHAINS_ENUM.AVAX,
|
|
21
|
+
CHAINS_ENUM.ARBITRUM,
|
|
22
|
+
CHAINS_ENUM.KLAY,
|
|
23
|
+
CHAINS_ENUM.GNOSIS,
|
|
24
|
+
CHAINS_ENUM.CELO,
|
|
25
|
+
];
|
|
26
|
+
export const getQuote = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
const chain = CHAINS[options.chain];
|
|
28
|
+
if (!SUPPORT_CHAINS.includes(options.chain)) {
|
|
29
|
+
throw new Error(`${CHAINS[options.chain]} is not support on 1inch`);
|
|
30
|
+
}
|
|
31
|
+
const wrapTokenAddress = WrapTokenAddressMap[options.chain];
|
|
32
|
+
let calldata = "";
|
|
33
|
+
let value = "0";
|
|
34
|
+
if (options.fromToken === chain.nativeTokenAddress &&
|
|
35
|
+
isSameAddress(options.toToken, wrapTokenAddress)) {
|
|
36
|
+
calldata = abiCoder.encodeFunctionCall({
|
|
37
|
+
constant: false,
|
|
38
|
+
inputs: [],
|
|
39
|
+
name: "deposit",
|
|
40
|
+
outputs: [],
|
|
41
|
+
payable: true,
|
|
42
|
+
stateMutability: "payable",
|
|
43
|
+
type: "function",
|
|
44
|
+
}, []);
|
|
45
|
+
value = options.amount;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
calldata = abiCoder.encodeFunctionCall({
|
|
49
|
+
constant: false,
|
|
50
|
+
inputs: [{ name: "wad", type: "uint256" }],
|
|
51
|
+
name: "withdraw",
|
|
52
|
+
outputs: [],
|
|
53
|
+
payable: false,
|
|
54
|
+
stateMutability: "nonpayable",
|
|
55
|
+
type: "function",
|
|
56
|
+
}, [options.amount]);
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
tx: {
|
|
60
|
+
from: options.userAddress,
|
|
61
|
+
to: wrapTokenAddress,
|
|
62
|
+
value,
|
|
63
|
+
data: calldata,
|
|
64
|
+
},
|
|
65
|
+
fromToken: options.fromToken,
|
|
66
|
+
fromTokenAmount: options.amount,
|
|
67
|
+
toToken: options.toToken,
|
|
68
|
+
toTokenAmount: options.amount,
|
|
69
|
+
spender: wrapTokenAddress,
|
|
70
|
+
};
|
|
71
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WrapTokenAddressMap, DEX_ENUM, DEX_SUPPORT_CHAINS, DEX_ROUTER_WHITELIST, DEX_SPENDER_WHITELIST } from "./consts";
|
|
2
|
+
import { getQuote } from "./quote";
|
|
3
|
+
export { WrapTokenAddressMap, DEX_ENUM, DEX_SUPPORT_CHAINS, getQuote, DEX_ROUTER_WHITELIST, DEX_SPENDER_WHITELIST, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WrapTokenAddressMap, DEX_ENUM, DEX_SUPPORT_CHAINS, DEX_ROUTER_WHITELIST, DEX_SPENDER_WHITELIST, } from "./consts";
|
|
2
|
+
import { getQuote } from "./quote";
|
|
3
|
+
export { WrapTokenAddressMap, DEX_ENUM, DEX_SUPPORT_CHAINS, getQuote, DEX_ROUTER_WHITELIST, DEX_SPENDER_WHITELIST, };
|
package/dist/quote.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CHAINS_ENUM } from '@debank/common';
|
|
2
|
+
import { DEX_ENUM } from './consts';
|
|
3
|
+
export interface QuoteParams {
|
|
4
|
+
fromToken: string;
|
|
5
|
+
fromTokenDecimals: number;
|
|
6
|
+
toToken: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
userAddress: string;
|
|
9
|
+
slippage: number;
|
|
10
|
+
feeRate?: number;
|
|
11
|
+
feeAddress?: string;
|
|
12
|
+
gasPrice?: number;
|
|
13
|
+
chain: CHAINS_ENUM;
|
|
14
|
+
}
|
|
15
|
+
export interface Tx {
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
data: string;
|
|
19
|
+
value: string;
|
|
20
|
+
chainId?: number;
|
|
21
|
+
gas?: number;
|
|
22
|
+
gasPrice?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface TxWithChainId extends Tx {
|
|
25
|
+
chainId: number;
|
|
26
|
+
}
|
|
27
|
+
export interface QuoteResult {
|
|
28
|
+
tx: Tx;
|
|
29
|
+
fromToken: string;
|
|
30
|
+
fromTokenDecimals?: number;
|
|
31
|
+
fromTokenAmount: string;
|
|
32
|
+
toToken: string;
|
|
33
|
+
toTokenDecimals?: number;
|
|
34
|
+
toTokenAmount: string;
|
|
35
|
+
spender: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const getQuote: (id: DEX_ENUM, params: QuoteParams) => Promise<QuoteResult>;
|
|
38
|
+
export interface DecodeCalldataResult {
|
|
39
|
+
fromToken: string;
|
|
40
|
+
fromTokenAmount: string;
|
|
41
|
+
toToken: string;
|
|
42
|
+
minReceiveToTokenAmount: string;
|
|
43
|
+
toTokenReceiver: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const decodeCalldata: (id: DEX_ENUM, tx: TxWithChainId) => DecodeCalldataResult | null;
|
package/dist/quote.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { DEX_ENUM } from './consts';
|
|
11
|
+
import { getQuote as wrapTokenGetQuote } from './dexs/wrapToken';
|
|
12
|
+
import { getQuote as zeroXGetQuote, decodeCalldata as zeroXDecodeCalldata } from './dexs/0xapi';
|
|
13
|
+
import { getQuote as paraSwapGetQuote, decodeCalldata as paraSwapDecodeCalldata } from './dexs/paraswap';
|
|
14
|
+
import { getQuote as openOceanGetQuote, decodeCalldata as openOceanDecodeCalldata } from './dexs/openocean';
|
|
15
|
+
export const getQuote = (id, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
switch (id) {
|
|
17
|
+
case DEX_ENUM.WRAPTOKEN:
|
|
18
|
+
return yield wrapTokenGetQuote(params);
|
|
19
|
+
// case DEX_ENUM.ONEINCH:
|
|
20
|
+
// return await oneInchGetQuote(params);
|
|
21
|
+
case DEX_ENUM.PARASWAP:
|
|
22
|
+
return yield paraSwapGetQuote(params);
|
|
23
|
+
case DEX_ENUM.ZEROXAPI:
|
|
24
|
+
return yield zeroXGetQuote(params);
|
|
25
|
+
case DEX_ENUM.OPENOCEAN:
|
|
26
|
+
return yield openOceanGetQuote(params);
|
|
27
|
+
default:
|
|
28
|
+
throw new Error(`${id} is not supported!`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export const decodeCalldata = (id, tx) => {
|
|
32
|
+
switch (id) {
|
|
33
|
+
// case DEX_ENUM.ONEINCH:
|
|
34
|
+
// return oneInchDecodeCalldata(tx);
|
|
35
|
+
case DEX_ENUM.PARASWAP:
|
|
36
|
+
return paraSwapDecodeCalldata(tx);
|
|
37
|
+
case DEX_ENUM.ZEROXAPI:
|
|
38
|
+
return zeroXDecodeCalldata(tx);
|
|
39
|
+
case DEX_ENUM.OPENOCEAN:
|
|
40
|
+
return openOceanDecodeCalldata(tx);
|
|
41
|
+
default:
|
|
42
|
+
throw new Error(`${id} is not supported!`);
|
|
43
|
+
}
|
|
44
|
+
};
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isSameAddress: (addr1: string, addr2: string) => boolean;
|
package/dist/utils.js
ADDED
package/package.json
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@rabby-wallet/rabby-swap",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "jest",
|
|
8
|
-
"build": "rimraf dist && tsc",
|
|
9
|
-
"preversion": "npm run build"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/RabbyHub/rabby-swap.git"
|
|
14
|
-
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@rabby-wallet/rabby-swap",
|
|
3
|
+
"version": "0.0.21",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "jest",
|
|
8
|
+
"build": "rimraf dist && tsc",
|
|
9
|
+
"preversion": "npm run build"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/RabbyHub/rabby-swap.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@debank/common": "^0.3.0",
|
|
20
|
+
"@ethersproject/abi": "^5.7.0",
|
|
21
|
+
"axios": "^0.27.2",
|
|
22
|
+
"bignumber.js": "^9.1.1",
|
|
23
|
+
"web3-eth-abi": "^1.8.1"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@babel/preset-env": "^7.19.1",
|
|
27
|
+
"@types/jest": "^29.0.3",
|
|
28
|
+
"@types/node": "^18.7.18",
|
|
29
|
+
"axios-mock-adapter": "^1.21.2",
|
|
30
|
+
"babel-jest": "^29.0.3",
|
|
31
|
+
"jest": "^29.0.3",
|
|
32
|
+
"jest-mock-axios": "^4.7.0-beta",
|
|
33
|
+
"rimraf": "^3.0.2",
|
|
34
|
+
"ts-jest": "^29.0.1",
|
|
35
|
+
"ts-node": "^10.9.1",
|
|
36
|
+
"typescript": "^4.8.3"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@debank/common": ">= 0.3.x"
|
|
40
|
+
},
|
|
41
|
+
"author": "vvvvvv1vvvvvv",
|
|
42
|
+
"license": "ISC",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/RabbyHub/rabby-swap/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/RabbyHub/rabby-swap#readme"
|
|
47
|
+
}
|