@rabby-wallet/rabby-swap 0.0.86-alpha.0 → 0.0.86-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.
@@ -40,6 +40,7 @@ export const SUPPORT_CHAINS = [
40
40
  "BERA",
41
41
  "TAIKO",
42
42
  "KATANA",
43
+ "HOOD",
43
44
  ];
44
45
  export const getQuote = generateGetQuote({
45
46
  SUPPORT_CHAINS,
package/dist/list.js CHANGED
@@ -115,6 +115,7 @@ export const DEX_ROUTER_WHITELIST = {
115
115
  ["BERA"]: "0xac4c6e212a361c968f1725b4d055b47e63f80b75",
116
116
  ["TAIKO"]: "0xac4c6e212a361c968f1725b4d055b47e63f80b75",
117
117
  ["KATANA"]: "0xac4c6e212a361c968f1725b4d055b47e63f80b75",
118
+ ["HOOD"]: "0x8e6fd69a77e88ee20ba4b4fbd59dfcda3ec0e98a",
118
119
  },
119
120
  [DEX_ENUM.ONEINCH]: {
120
121
  [CHAINS_ENUM.ETH]: "0x111111125421ca6dc452d289314280a0f8842a65",
@@ -250,7 +251,7 @@ export const DEX_ROUTER_WHITELIST = {
250
251
  [CHAINS_ENUM.AVAX]: "0x0000000000001ff3684f28c67538d4d072c22734",
251
252
  ["BERA"]: "0x0000000000001ff3684f28c67538d4d072c22734",
252
253
  ["UNI"]: "0x0000000000001ff3684f28c67538d4d072c22734",
253
- [CHAINS_ENUM.SCRL]: "0x0000000000005e88410ccdfade4a5efae4b49562",
254
+ [CHAINS_ENUM.SCRL]: "0x0000000000001ff3684f28c67538d4d072c22734",
254
255
  ["PLASMA"]: "0x0000000000001ff3684f28c67538d4d072c22734",
255
256
  ["MONAD"]: "0x0000000000001ff3684f28c67538d4d072c22734",
256
257
  ["HYPER"]: "0x0000000000001ff3684f28c67538d4d072c22734",
@@ -345,6 +346,7 @@ export const DEX_SPENDER_WHITELIST = {
345
346
  ["BERA"]: "0xac4c6e212a361c968f1725b4d055b47e63f80b75",
346
347
  ["TAIKO"]: "0xac4c6e212a361c968f1725b4d055b47e63f80b75",
347
348
  ["KATANA"]: "0xac4c6e212a361c968f1725b4d055b47e63f80b75",
349
+ ["HOOD"]: "0x8e6fd69a77e88ee20ba4b4fbd59dfcda3ec0e98a",
348
350
  },
349
351
  [DEX_ENUM.ONEINCH]: {
350
352
  [CHAINS_ENUM.ETH]: "0x111111125421ca6dc452d289314280a0f8842a65",
@@ -481,7 +483,7 @@ export const DEX_SPENDER_WHITELIST = {
481
483
  [CHAINS_ENUM.AVAX]: "0x0000000000001ff3684f28c67538d4d072c22734",
482
484
  ["BERA"]: "0x0000000000001ff3684f28c67538d4d072c22734",
483
485
  ["UNI"]: "0x0000000000001ff3684f28c67538d4d072c22734",
484
- [CHAINS_ENUM.SCRL]: "0x0000000000005e88410ccdfade4a5efae4b49562",
486
+ [CHAINS_ENUM.SCRL]: "0x0000000000001ff3684f28c67538d4d072c22734",
485
487
  ["PLASMA"]: "0x0000000000001ff3684f28c67538d4d072c22734",
486
488
  ["MONAD"]: "0x0000000000001ff3684f28c67538d4d072c22734",
487
489
  ["HYPER"]: "0x0000000000001ff3684f28c67538d4d072c22734",
@@ -15,6 +15,6 @@ export type VerifyRouterAndSpenderParams = {
15
15
  };
16
16
  /**
17
17
  * 校验 tx.to / approve spender 是否在白名单。
18
- * wrap、native 支付无需 spender;缺字段时与现网一致,不判失败。
18
+ * wrap、native 支付或缺少 spender 时跳过 spender 校验。
19
19
  */
20
20
  export declare const verifyRouterAndSpender: (p: VerifyRouterAndSpenderParams) => [boolean, boolean];
@@ -26,19 +26,20 @@ export const getSpender = (dexId, chain) => {
26
26
  };
27
27
  /**
28
28
  * 校验 tx.to / approve spender 是否在白名单。
29
- * wrap、native 支付无需 spender;缺字段时与现网一致,不判失败。
29
+ * wrap、native 支付或缺少 spender 时跳过 spender 校验。
30
30
  */
31
31
  export const verifyRouterAndSpender = (p) => {
32
32
  const { chain, dexId, router, spender, payTokenId, receiveTokenId, nativeTokenAddress, } = p;
33
33
  if (dexId === DEX_ENUM.WRAPTOKEN) {
34
34
  return [true, true];
35
35
  }
36
- if (!dexId || !router || !spender || !payTokenId || !receiveTokenId) {
36
+ if (!dexId || !router || !payTokenId || !receiveTokenId) {
37
37
  return [true, true];
38
38
  }
39
39
  const routerWhitelist = getRouter(dexId, chain, payTokenId, nativeTokenAddress);
40
40
  const spenderWhitelist = getSpender(dexId, chain);
41
- const skipSpender = isNativeToken(payTokenId, nativeTokenAddress) ||
41
+ const skipSpender = !spender ||
42
+ isNativeToken(payTokenId, nativeTokenAddress) ||
42
43
  isSwapWrapToken(payTokenId, receiveTokenId, chain, nativeTokenAddress);
43
44
  return [
44
45
  isSameAddress(routerWhitelist || "", router),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-swap",
3
- "version": "0.0.86-alpha.0",
3
+ "version": "0.0.86-alpha.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {