@rabby-wallet/rabby-action 0.1.0

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.
Files changed (256) hide show
  1. package/README.md +7 -0
  2. package/dist/actions/approveNFT/fetchData.d.ts +4 -0
  3. package/dist/actions/approveNFT/fetchData.js +60 -0
  4. package/dist/actions/approveNFT/formatSecurityEngine.d.ts +2 -0
  5. package/dist/actions/approveNFT/formatSecurityEngine.js +31 -0
  6. package/dist/actions/approveNFT/parseAction.d.ts +2 -0
  7. package/dist/actions/approveNFT/parseAction.js +9 -0
  8. package/dist/actions/approveNFTCollection/fetchData.d.ts +2 -0
  9. package/dist/actions/approveNFTCollection/fetchData.js +19 -0
  10. package/dist/actions/approveNFTCollection/formatSecurityEngine.d.ts +2 -0
  11. package/dist/actions/approveNFTCollection/formatSecurityEngine.js +31 -0
  12. package/dist/actions/approveNFTCollection/parseAction.d.ts +2 -0
  13. package/dist/actions/approveNFTCollection/parseAction.js +9 -0
  14. package/dist/actions/approveToken/fetchData.d.ts +6 -0
  15. package/dist/actions/approveToken/fetchData.js +64 -0
  16. package/dist/actions/approveToken/formatSecurityEngine.d.ts +2 -0
  17. package/dist/actions/approveToken/formatSecurityEngine.js +31 -0
  18. package/dist/actions/approveToken/parseAction.d.ts +2 -0
  19. package/dist/actions/approveToken/parseAction.js +13 -0
  20. package/dist/actions/assetOrder/fetchData.d.ts +2 -0
  21. package/dist/actions/assetOrder/fetchData.js +29 -0
  22. package/dist/actions/assetOrder/formatSecurityEngine.d.ts +2 -0
  23. package/dist/actions/assetOrder/formatSecurityEngine.js +30 -0
  24. package/dist/actions/assetOrder/parseAction.d.ts +2 -0
  25. package/dist/actions/assetOrder/parseAction.js +18 -0
  26. package/dist/actions/batchPermit2/fetchData.d.ts +2 -0
  27. package/dist/actions/batchPermit2/fetchData.js +65 -0
  28. package/dist/actions/batchPermit2/formatSecurityEngine.d.ts +2 -0
  29. package/dist/actions/batchPermit2/formatSecurityEngine.js +30 -0
  30. package/dist/actions/batchPermit2/parseAction.d.ts +2 -0
  31. package/dist/actions/batchPermit2/parseAction.js +9 -0
  32. package/dist/actions/batchSellNFT/fetchData.d.ts +2 -0
  33. package/dist/actions/batchSellNFT/fetchData.js +21 -0
  34. package/dist/actions/batchSellNFT/formatSecurityEngine.d.ts +2 -0
  35. package/dist/actions/batchSellNFT/formatSecurityEngine.js +33 -0
  36. package/dist/actions/batchSellNFT/parseAction.d.ts +2 -0
  37. package/dist/actions/batchSellNFT/parseAction.js +9 -0
  38. package/dist/actions/buyNFT/fetchData.d.ts +2 -0
  39. package/dist/actions/buyNFT/fetchData.js +21 -0
  40. package/dist/actions/buyNFT/formatSecurityEngine.d.ts +2 -0
  41. package/dist/actions/buyNFT/formatSecurityEngine.js +33 -0
  42. package/dist/actions/buyNFT/parseAction.d.ts +2 -0
  43. package/dist/actions/buyNFT/parseAction.js +9 -0
  44. package/dist/actions/cancelTx/fetchData.d.ts +2 -0
  45. package/dist/actions/cancelTx/fetchData.js +32 -0
  46. package/dist/actions/cancelTx/formatSecurityEngine.d.ts +2 -0
  47. package/dist/actions/cancelTx/formatSecurityEngine.js +12 -0
  48. package/dist/actions/cancelTx/parseAction.d.ts +2 -0
  49. package/dist/actions/cancelTx/parseAction.js +11 -0
  50. package/dist/actions/coboSafeCreate/fetchData.d.ts +2 -0
  51. package/dist/actions/coboSafeCreate/fetchData.js +12 -0
  52. package/dist/actions/coboSafeCreate/formatSecurityEngine.d.ts +2 -0
  53. package/dist/actions/coboSafeCreate/formatSecurityEngine.js +12 -0
  54. package/dist/actions/coboSafeCreate/parseAction.d.ts +2 -0
  55. package/dist/actions/coboSafeCreate/parseAction.js +9 -0
  56. package/dist/actions/coboSafeModificationDelegatedAddress/fetchData.d.ts +2 -0
  57. package/dist/actions/coboSafeModificationDelegatedAddress/fetchData.js +12 -0
  58. package/dist/actions/coboSafeModificationDelegatedAddress/formatSecurityEngine.d.ts +2 -0
  59. package/dist/actions/coboSafeModificationDelegatedAddress/formatSecurityEngine.js +12 -0
  60. package/dist/actions/coboSafeModificationDelegatedAddress/parseAction.d.ts +2 -0
  61. package/dist/actions/coboSafeModificationDelegatedAddress/parseAction.js +9 -0
  62. package/dist/actions/coboSafeModificationRole/fetchData.d.ts +2 -0
  63. package/dist/actions/coboSafeModificationRole/fetchData.js +12 -0
  64. package/dist/actions/coboSafeModificationRole/formatSecurityEngine.d.ts +2 -0
  65. package/dist/actions/coboSafeModificationRole/formatSecurityEngine.js +12 -0
  66. package/dist/actions/coboSafeModificationRole/parseAction.d.ts +2 -0
  67. package/dist/actions/coboSafeModificationRole/parseAction.js +9 -0
  68. package/dist/actions/coboSafeModificationTokenApproval/fetchData.d.ts +2 -0
  69. package/dist/actions/coboSafeModificationTokenApproval/fetchData.js +12 -0
  70. package/dist/actions/coboSafeModificationTokenApproval/formatSecurityEngine.d.ts +2 -0
  71. package/dist/actions/coboSafeModificationTokenApproval/formatSecurityEngine.js +12 -0
  72. package/dist/actions/coboSafeModificationTokenApproval/parseAction.d.ts +2 -0
  73. package/dist/actions/coboSafeModificationTokenApproval/parseAction.js +9 -0
  74. package/dist/actions/common/fetchData.d.ts +4 -0
  75. package/dist/actions/common/fetchData.js +119 -0
  76. package/dist/actions/common/formatSecurityEngine.d.ts +2 -0
  77. package/dist/actions/common/formatSecurityEngine.js +21 -0
  78. package/dist/actions/common/parseAction.d.ts +2 -0
  79. package/dist/actions/common/parseAction.js +14 -0
  80. package/dist/actions/contractCall/fetchData.d.ts +2 -0
  81. package/dist/actions/contractCall/fetchData.js +115 -0
  82. package/dist/actions/contractCall/formatSecurityEngine.d.ts +2 -0
  83. package/dist/actions/contractCall/formatSecurityEngine.js +25 -0
  84. package/dist/actions/contractCall/parseAction.d.ts +2 -0
  85. package/dist/actions/contractCall/parseAction.js +5 -0
  86. package/dist/actions/createKey/fetchData.d.ts +2 -0
  87. package/dist/actions/createKey/fetchData.js +12 -0
  88. package/dist/actions/createKey/formatSecurityEngine.d.ts +2 -0
  89. package/dist/actions/createKey/formatSecurityEngine.js +24 -0
  90. package/dist/actions/createKey/parseAction.d.ts +2 -0
  91. package/dist/actions/createKey/parseAction.js +9 -0
  92. package/dist/actions/crossSwapToken/fetchData.d.ts +2 -0
  93. package/dist/actions/crossSwapToken/fetchData.js +19 -0
  94. package/dist/actions/crossSwapToken/formatSecurityEngine.d.ts +2 -0
  95. package/dist/actions/crossSwapToken/formatSecurityEngine.js +38 -0
  96. package/dist/actions/crossSwapToken/parseAction.d.ts +2 -0
  97. package/dist/actions/crossSwapToken/parseAction.js +26 -0
  98. package/dist/actions/crossToken/fetchData.d.ts +2 -0
  99. package/dist/actions/crossToken/fetchData.js +19 -0
  100. package/dist/actions/crossToken/formatSecurityEngine.d.ts +2 -0
  101. package/dist/actions/crossToken/formatSecurityEngine.js +38 -0
  102. package/dist/actions/crossToken/parseAction.d.ts +2 -0
  103. package/dist/actions/crossToken/parseAction.js +22 -0
  104. package/dist/actions/deployContract/fetchData.d.ts +2 -0
  105. package/dist/actions/deployContract/fetchData.js +12 -0
  106. package/dist/actions/deployContract/formatSecurityEngine.d.ts +2 -0
  107. package/dist/actions/deployContract/formatSecurityEngine.js +12 -0
  108. package/dist/actions/deployContract/parseAction.d.ts +2 -0
  109. package/dist/actions/deployContract/parseAction.js +9 -0
  110. package/dist/actions/permit/fetchData.d.ts +2 -0
  111. package/dist/actions/permit/fetchData.js +19 -0
  112. package/dist/actions/permit/formatSecurityEngine.d.ts +2 -0
  113. package/dist/actions/permit/formatSecurityEngine.js +30 -0
  114. package/dist/actions/permit/parseAction.d.ts +2 -0
  115. package/dist/actions/permit/parseAction.js +9 -0
  116. package/dist/actions/permit2/fetchData.d.ts +2 -0
  117. package/dist/actions/permit2/fetchData.js +19 -0
  118. package/dist/actions/permit2/formatSecurityEngine.d.ts +2 -0
  119. package/dist/actions/permit2/formatSecurityEngine.js +30 -0
  120. package/dist/actions/permit2/parseAction.d.ts +2 -0
  121. package/dist/actions/permit2/parseAction.js +9 -0
  122. package/dist/actions/permit2BatchRevokeToken/fetchData.d.ts +2 -0
  123. package/dist/actions/permit2BatchRevokeToken/fetchData.js +30 -0
  124. package/dist/actions/permit2BatchRevokeToken/formatSecurityEngine.d.ts +2 -0
  125. package/dist/actions/permit2BatchRevokeToken/formatSecurityEngine.js +12 -0
  126. package/dist/actions/permit2BatchRevokeToken/parseAction.d.ts +2 -0
  127. package/dist/actions/permit2BatchRevokeToken/parseAction.js +9 -0
  128. package/dist/actions/pushMultiSig/fetchData.d.ts +2 -0
  129. package/dist/actions/pushMultiSig/fetchData.js +27 -0
  130. package/dist/actions/pushMultiSig/formatSecurityEngine.d.ts +2 -0
  131. package/dist/actions/pushMultiSig/formatSecurityEngine.js +12 -0
  132. package/dist/actions/pushMultiSig/parseAction.d.ts +2 -0
  133. package/dist/actions/pushMultiSig/parseAction.js +9 -0
  134. package/dist/actions/revokeNFT/fetchData.d.ts +2 -0
  135. package/dist/actions/revokeNFT/fetchData.js +19 -0
  136. package/dist/actions/revokeNFT/formatSecurityEngine.d.ts +2 -0
  137. package/dist/actions/revokeNFT/formatSecurityEngine.js +12 -0
  138. package/dist/actions/revokeNFT/parseAction.d.ts +2 -0
  139. package/dist/actions/revokeNFT/parseAction.js +9 -0
  140. package/dist/actions/revokeNFTCollection/fetchData.d.ts +2 -0
  141. package/dist/actions/revokeNFTCollection/fetchData.js +19 -0
  142. package/dist/actions/revokeNFTCollection/formatSecurityEngine.d.ts +2 -0
  143. package/dist/actions/revokeNFTCollection/formatSecurityEngine.js +12 -0
  144. package/dist/actions/revokeNFTCollection/parseAction.d.ts +2 -0
  145. package/dist/actions/revokeNFTCollection/parseAction.js +9 -0
  146. package/dist/actions/revokePermit/fetchData.d.ts +2 -0
  147. package/dist/actions/revokePermit/fetchData.js +19 -0
  148. package/dist/actions/revokePermit/formatSecurityEngine.d.ts +2 -0
  149. package/dist/actions/revokePermit/formatSecurityEngine.js +12 -0
  150. package/dist/actions/revokePermit/parseAction.d.ts +2 -0
  151. package/dist/actions/revokePermit/parseAction.js +9 -0
  152. package/dist/actions/revokePermit2/fetchData.d.ts +2 -0
  153. package/dist/actions/revokePermit2/fetchData.js +19 -0
  154. package/dist/actions/revokePermit2/formatSecurityEngine.d.ts +2 -0
  155. package/dist/actions/revokePermit2/formatSecurityEngine.js +12 -0
  156. package/dist/actions/revokePermit2/parseAction.d.ts +2 -0
  157. package/dist/actions/revokePermit2/parseAction.js +13 -0
  158. package/dist/actions/revokeToken/fetchData.d.ts +2 -0
  159. package/dist/actions/revokeToken/fetchData.js +19 -0
  160. package/dist/actions/revokeToken/formatSecurityEngine.d.ts +2 -0
  161. package/dist/actions/revokeToken/formatSecurityEngine.js +25 -0
  162. package/dist/actions/revokeToken/parseAction.d.ts +2 -0
  163. package/dist/actions/revokeToken/parseAction.js +14 -0
  164. package/dist/actions/sellNFT/fetchData.d.ts +2 -0
  165. package/dist/actions/sellNFT/fetchData.js +21 -0
  166. package/dist/actions/sellNFT/formatSecurityEngine.d.ts +2 -0
  167. package/dist/actions/sellNFT/formatSecurityEngine.js +33 -0
  168. package/dist/actions/sellNFT/parseAction.d.ts +2 -0
  169. package/dist/actions/sellNFT/parseAction.js +9 -0
  170. package/dist/actions/send/fetchData.d.ts +8 -0
  171. package/dist/actions/send/fetchData.js +103 -0
  172. package/dist/actions/send/formatSecurityEngine.d.ts +2 -0
  173. package/dist/actions/send/formatSecurityEngine.js +47 -0
  174. package/dist/actions/send/parseAction.d.ts +2 -0
  175. package/dist/actions/send/parseAction.js +9 -0
  176. package/dist/actions/sendNFT/fetchData.d.ts +2 -0
  177. package/dist/actions/sendNFT/fetchData.js +26 -0
  178. package/dist/actions/sendNFT/formatSecurityEngine.d.ts +2 -0
  179. package/dist/actions/sendNFT/formatSecurityEngine.js +46 -0
  180. package/dist/actions/sendNFT/parseAction.d.ts +2 -0
  181. package/dist/actions/sendNFT/parseAction.js +9 -0
  182. package/dist/actions/signMultiSig/fetchData.d.ts +2 -0
  183. package/dist/actions/signMultiSig/fetchData.js +27 -0
  184. package/dist/actions/signMultiSig/formatSecurityEngine.d.ts +2 -0
  185. package/dist/actions/signMultiSig/formatSecurityEngine.js +12 -0
  186. package/dist/actions/signMultiSig/parseAction.d.ts +2 -0
  187. package/dist/actions/signMultiSig/parseAction.js +9 -0
  188. package/dist/actions/swap/fetchData.d.ts +4 -0
  189. package/dist/actions/swap/fetchData.js +51 -0
  190. package/dist/actions/swap/formatSecurityEngine.d.ts +2 -0
  191. package/dist/actions/swap/formatSecurityEngine.js +39 -0
  192. package/dist/actions/swap/parseAction.d.ts +2 -0
  193. package/dist/actions/swap/parseAction.js +43 -0
  194. package/dist/actions/swapTokenOrder/fetchData.d.ts +2 -0
  195. package/dist/actions/swapTokenOrder/fetchData.js +21 -0
  196. package/dist/actions/swapTokenOrder/formatSecurityEngine.d.ts +2 -0
  197. package/dist/actions/swapTokenOrder/formatSecurityEngine.js +35 -0
  198. package/dist/actions/swapTokenOrder/parseAction.d.ts +2 -0
  199. package/dist/actions/swapTokenOrder/parseAction.js +27 -0
  200. package/dist/actions/unwrapToken/fetchData.d.ts +2 -0
  201. package/dist/actions/unwrapToken/fetchData.js +19 -0
  202. package/dist/actions/unwrapToken/formatSecurityEngine.d.ts +2 -0
  203. package/dist/actions/unwrapToken/formatSecurityEngine.js +34 -0
  204. package/dist/actions/unwrapToken/parseAction.d.ts +2 -0
  205. package/dist/actions/unwrapToken/parseAction.js +17 -0
  206. package/dist/actions/verifyAddress/fetchData.d.ts +2 -0
  207. package/dist/actions/verifyAddress/fetchData.js +12 -0
  208. package/dist/actions/verifyAddress/formatSecurityEngine.d.ts +2 -0
  209. package/dist/actions/verifyAddress/formatSecurityEngine.js +24 -0
  210. package/dist/actions/verifyAddress/parseAction.d.ts +2 -0
  211. package/dist/actions/verifyAddress/parseAction.js +9 -0
  212. package/dist/actions/wrapToken/fetchData.d.ts +2 -0
  213. package/dist/actions/wrapToken/fetchData.js +19 -0
  214. package/dist/actions/wrapToken/formatSecurityEngine.d.ts +2 -0
  215. package/dist/actions/wrapToken/formatSecurityEngine.js +34 -0
  216. package/dist/actions/wrapToken/parseAction.d.ts +2 -0
  217. package/dist/actions/wrapToken/parseAction.js +17 -0
  218. package/dist/fetchActionRequiredData.d.ts +2 -0
  219. package/dist/fetchActionRequiredData.js +87 -0
  220. package/dist/formatSecurityEngineContext.d.ts +2 -0
  221. package/dist/formatSecurityEngineContext.js +89 -0
  222. package/dist/index.d.ts +5 -0
  223. package/dist/index.js +5 -0
  224. package/dist/parseAction.d.ts +4 -0
  225. package/dist/parseAction.js +66 -0
  226. package/dist/types/actionRequireData.d.ts +158 -0
  227. package/dist/types/actionRequireData.js +1 -0
  228. package/dist/types/fetchActionRequiredData.d.ts +24 -0
  229. package/dist/types/fetchActionRequiredData.js +1 -0
  230. package/dist/types/formatSecurityEngineContext.d.ts +40 -0
  231. package/dist/types/formatSecurityEngineContext.js +1 -0
  232. package/dist/types/index.d.ts +5 -0
  233. package/dist/types/index.js +5 -0
  234. package/dist/types/parseAction.d.ts +26 -0
  235. package/dist/types/parseAction.js +1 -0
  236. package/dist/types/parsedActionData.d.ts +161 -0
  237. package/dist/types/parsedActionData.js +1 -0
  238. package/dist/types/walletProvider.d.ts +79 -0
  239. package/dist/types/walletProvider.js +1 -0
  240. package/dist/utils/calcSlippageTolerance.d.ts +1 -0
  241. package/dist/utils/calcSlippageTolerance.js +12 -0
  242. package/dist/utils/calcUSDValueChange.d.ts +1 -0
  243. package/dist/utils/calcUSDValueChange.js +12 -0
  244. package/dist/utils/getProtocol.d.ts +6 -0
  245. package/dist/utils/getProtocol.js +7 -0
  246. package/dist/utils/isSameAddress.d.ts +4 -0
  247. package/dist/utils/isSameAddress.js +8 -0
  248. package/dist/utils/keyring.d.ts +10 -0
  249. package/dist/utils/keyring.js +10 -0
  250. package/dist/utils/parseTextAction.d.ts +2 -0
  251. package/dist/utils/parseTextAction.js +9 -0
  252. package/dist/utils/parseTypedDataAction.d.ts +2 -0
  253. package/dist/utils/parseTypedDataAction.js +25 -0
  254. package/dist/utils/waitQueueFinished.d.ts +2 -0
  255. package/dist/utils/waitQueueFinished.js +8 -0
  256. package/package.json +56 -0
@@ -0,0 +1,30 @@
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 { fetchDataApproveToken } from '../approveToken/fetchData';
11
+ export const fetchDataPermit2BatchRevokeToken = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (options.type !== 'transaction') {
13
+ return {};
14
+ }
15
+ const { actionData } = options;
16
+ const action = actionData.permit2BatchRevokeToken;
17
+ if (!action) {
18
+ return {};
19
+ }
20
+ const spenders = action.revoke_list.map((item) => item.spender);
21
+ // filter out the same spender
22
+ const uniqueSpenders = Array.from(new Set(spenders));
23
+ const result = {};
24
+ yield Promise.all(uniqueSpenders.map((spender) => __awaiter(void 0, void 0, void 0, function* () {
25
+ result[spender] = (yield fetchDataApproveToken(options, {
26
+ spender,
27
+ }));
28
+ })));
29
+ return result;
30
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEnginePermit2BatchRevokeToken: FormatSecurityEngineContext;
@@ -0,0 +1,12 @@
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
+ export const formatSecurityEnginePermit2BatchRevokeToken = (options) => __awaiter(void 0, void 0, void 0, function* () {
11
+ return {};
12
+ });
@@ -0,0 +1,2 @@
1
+ import { ParseAction } from '../../types';
2
+ export declare const parseActionPermit2BatchRevokeToken: ParseAction<'transaction'>;
@@ -0,0 +1,9 @@
1
+ export const parseActionPermit2BatchRevokeToken = (options) => {
2
+ const { data } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'permit2_batch_revoke_token') {
4
+ return {};
5
+ }
6
+ return {
7
+ permit2BatchRevokeToken: data.data,
8
+ };
9
+ };
@@ -0,0 +1,2 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataPushMultiSig: FetchActionRequiredData;
@@ -0,0 +1,27 @@
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
+ export const fetchDataPushMultiSig = (options) => __awaiter(void 0, void 0, void 0, function* () {
11
+ if (options.type !== 'transaction') {
12
+ return {};
13
+ }
14
+ const { apiProvider, actionData } = options;
15
+ if (!actionData.pushMultiSig) {
16
+ return {};
17
+ }
18
+ const result = {
19
+ contract: null,
20
+ id: actionData.pushMultiSig.multisig_id,
21
+ };
22
+ const { desc } = yield apiProvider.addrDesc(actionData.pushMultiSig.multisig_id);
23
+ if (desc.contract) {
24
+ result.contract = desc.contract;
25
+ }
26
+ return result;
27
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEnginePushMultiSig: FormatSecurityEngineContext;
@@ -0,0 +1,12 @@
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
+ export const formatSecurityEnginePushMultiSig = () => __awaiter(void 0, void 0, void 0, function* () {
11
+ return {};
12
+ });
@@ -0,0 +1,2 @@
1
+ import { ParseAction } from '../../types';
2
+ export declare const parseActionPushMultiSig: ParseAction<'transaction'>;
@@ -0,0 +1,9 @@
1
+ export const parseActionPushMultiSig = (options) => {
2
+ const { data } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'push_multisig') {
4
+ return {};
5
+ }
6
+ return {
7
+ pushMultiSig: data.data,
8
+ };
9
+ };
@@ -0,0 +1,2 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataRevokeNFT: FetchActionRequiredData;
@@ -0,0 +1,19 @@
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 { fetchDataApproveNFT } from '../approveNFT/fetchData';
11
+ export const fetchDataRevokeNFT = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (options.type !== 'transaction') {
13
+ return {};
14
+ }
15
+ if (!options.actionData.revokeNFT) {
16
+ return {};
17
+ }
18
+ return fetchDataApproveNFT(options, options.actionData.revokeNFT);
19
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEngineRevokeNFT: FormatSecurityEngineContext;
@@ -0,0 +1,12 @@
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
+ export const formatSecurityEngineRevokeNFT = () => __awaiter(void 0, void 0, void 0, function* () {
11
+ return {};
12
+ });
@@ -0,0 +1,2 @@
1
+ import { ParseAction } from '../../types';
2
+ export declare const parseActionRevokeNFT: ParseAction<'transaction'>;
@@ -0,0 +1,9 @@
1
+ export const parseActionRevokeNFT = (options) => {
2
+ const { data } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'revoke_nft') {
4
+ return {};
5
+ }
6
+ return {
7
+ revokeNFT: data.data,
8
+ };
9
+ };
@@ -0,0 +1,2 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataRevokeNFTCollection: FetchActionRequiredData;
@@ -0,0 +1,19 @@
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 { fetchDataApproveNFT } from '../approveNFT/fetchData';
11
+ export const fetchDataRevokeNFTCollection = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (options.type !== 'transaction') {
13
+ return {};
14
+ }
15
+ if (!options.actionData.revokeNFTCollection) {
16
+ return {};
17
+ }
18
+ return fetchDataApproveNFT(options, options.actionData.revokeNFTCollection);
19
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEngineRevokeNFTCollection: FormatSecurityEngineContext;
@@ -0,0 +1,12 @@
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
+ export const formatSecurityEngineRevokeNFTCollection = () => __awaiter(void 0, void 0, void 0, function* () {
11
+ return {};
12
+ });
@@ -0,0 +1,2 @@
1
+ import { ParseAction } from '../../types';
2
+ export declare const parseActionRevokeNFTCollection: ParseAction<'transaction'>;
@@ -0,0 +1,9 @@
1
+ export const parseActionRevokeNFTCollection = (options) => {
2
+ const { data } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'revoke_collection') {
4
+ return {};
5
+ }
6
+ return {
7
+ revokeNFTCollection: data.data,
8
+ };
9
+ };
@@ -0,0 +1,2 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataRevokePermit: FetchActionRequiredData;
@@ -0,0 +1,19 @@
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 { fetchDataApproveToken } from '../approveToken/fetchData';
11
+ export const fetchDataRevokePermit = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (options.type !== 'typed_data') {
13
+ return {};
14
+ }
15
+ if (!options.actionData.revokePermit) {
16
+ return {};
17
+ }
18
+ return fetchDataApproveToken(options, options.actionData.revokePermit);
19
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEngineRevokePermit: FormatSecurityEngineContext;
@@ -0,0 +1,12 @@
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
+ export const formatSecurityEngineRevokePermit = () => __awaiter(void 0, void 0, void 0, function* () {
11
+ return {};
12
+ });
@@ -0,0 +1,2 @@
1
+ import { PartialParseAction } from '../../types';
2
+ export declare const parseActionRevokePermit: PartialParseAction<'typed_data'>;
@@ -0,0 +1,9 @@
1
+ export const parseActionRevokePermit = (options) => {
2
+ const { data } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'permit1_revoke_token') {
4
+ return {};
5
+ }
6
+ return {
7
+ revokePermit: data.data,
8
+ };
9
+ };
@@ -0,0 +1,2 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataRevokePermit2: FetchActionRequiredData;
@@ -0,0 +1,19 @@
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 { fetchDataApproveToken } from '../approveToken/fetchData';
11
+ export const fetchDataRevokePermit2 = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (options.type !== 'transaction') {
13
+ return {};
14
+ }
15
+ if (!options.actionData.revokePermit2) {
16
+ return {};
17
+ }
18
+ return fetchDataApproveToken(options, options.actionData.revokePermit2);
19
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEngineRevokePermit2: FormatSecurityEngineContext;
@@ -0,0 +1,12 @@
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
+ export const formatSecurityEngineRevokePermit2 = () => __awaiter(void 0, void 0, void 0, function* () {
11
+ return {};
12
+ });
@@ -0,0 +1,2 @@
1
+ import { ParseAction } from '../../types';
2
+ export declare const parseActionRevokePermit2: ParseAction<'transaction'>;
@@ -0,0 +1,13 @@
1
+ export const parseActionRevokePermit2 = (options) => {
2
+ const { data } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'permit2_revoke_token') {
4
+ return {};
5
+ }
6
+ const { spender, token } = data.data;
7
+ return {
8
+ revokePermit2: {
9
+ spender,
10
+ token,
11
+ },
12
+ };
13
+ };
@@ -0,0 +1,2 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataRevokeToken: FetchActionRequiredData;
@@ -0,0 +1,19 @@
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 { fetchDataApproveToken } from '../approveToken/fetchData';
11
+ export const fetchDataRevokeToken = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (options.type !== 'transaction') {
13
+ return {};
14
+ }
15
+ if (!options.actionData.revokeToken) {
16
+ return {};
17
+ }
18
+ return fetchDataApproveToken(options, options.actionData.revokeToken);
19
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEngineRevokeToken: FormatSecurityEngineContext;
@@ -0,0 +1,25 @@
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
+ export const formatSecurityEngineRevokeToken = (options) => __awaiter(void 0, void 0, void 0, function* () {
11
+ if (options.type !== 'transaction') {
12
+ return {};
13
+ }
14
+ const { actionData, requireData, chainId, provider } = options;
15
+ if (!actionData.revokeToken) {
16
+ return {};
17
+ }
18
+ const { gasUsed } = actionData.revokeToken;
19
+ return {
20
+ revokeApprove: {
21
+ gasUsed,
22
+ chainId,
23
+ },
24
+ };
25
+ });
@@ -0,0 +1,2 @@
1
+ import { ParseAction } from '../../types';
2
+ export declare const parseActionRevokeToken: ParseAction<'transaction'>;
@@ -0,0 +1,14 @@
1
+ export const parseActionRevokeToken = (options) => {
2
+ const { data, gasUsed } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'revoke_token') {
4
+ return {};
5
+ }
6
+ const { spender, token } = data.data;
7
+ return {
8
+ revokeToken: {
9
+ spender,
10
+ token,
11
+ gasUsed,
12
+ },
13
+ };
14
+ };
@@ -0,0 +1,2 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataSellNFT: FetchActionRequiredData;
@@ -0,0 +1,21 @@
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 { fetchDataCommon } from '../common/fetchData';
11
+ export const fetchDataSellNFT = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
+ if (options.type !== 'typed_data') {
13
+ return {};
14
+ }
15
+ if (!options.actionData.contractId || !options.actionData.sellNFT) {
16
+ return {};
17
+ }
18
+ return fetchDataCommon(options, {
19
+ receiver: options.actionData.contractId,
20
+ });
21
+ });
@@ -0,0 +1,2 @@
1
+ import { FormatSecurityEngineContext } from '../../types';
2
+ export declare const formatSecurityEngineSellNFT: FormatSecurityEngineContext;
@@ -0,0 +1,33 @@
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
+ export const formatSecurityEngineSellNFT = (options) => __awaiter(void 0, void 0, void 0, function* () {
11
+ if (options.type !== 'typed_data') {
12
+ return {};
13
+ }
14
+ const { actionData, requireData, chainId, provider } = options;
15
+ if (!actionData.sellNFT) {
16
+ return {};
17
+ }
18
+ const receiveTokenIsFake = actionData.sellNFT.receive_token.is_verified === false;
19
+ const receiveTokenIsScam = receiveTokenIsFake
20
+ ? false
21
+ : !!actionData.sellNFT.receive_token.is_suspicious;
22
+ return {
23
+ sellNFT: {
24
+ specificBuyer: actionData.sellNFT.takers[0],
25
+ from: actionData.sender,
26
+ receiver: actionData.sellNFT.receiver,
27
+ receiveTokenIsFake,
28
+ receiveTokenIsScam,
29
+ chainId: chainId,
30
+ id: actionData.contractId,
31
+ },
32
+ };
33
+ });
@@ -0,0 +1,2 @@
1
+ import { PartialParseAction } from '../../types';
2
+ export declare const parseActionSellNFT: PartialParseAction<'typed_data'>;
@@ -0,0 +1,9 @@
1
+ export const parseActionSellNFT = (options) => {
2
+ const { data } = options;
3
+ if ((data === null || data === void 0 ? void 0 : data.type) !== 'sell_nft_order') {
4
+ return {};
5
+ }
6
+ return {
7
+ sellNFT: data.data,
8
+ };
9
+ };
@@ -0,0 +1,8 @@
1
+ import { FetchActionRequiredData } from '../../types';
2
+ export declare const fetchDataSend: FetchActionRequiredData<{
3
+ to: string;
4
+ token: {
5
+ id: string;
6
+ chain: string;
7
+ };
8
+ }>;
@@ -0,0 +1,103 @@
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 PQueue from 'p-queue';
11
+ import { waitQueueFinished } from '../../utils/waitQueueFinished';
12
+ import { KEYRING_TYPE } from '../../utils/keyring';
13
+ // send, sendNFT, typedData.send
14
+ export const fetchDataSend = (options, likeSendAction) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const queue = new PQueue();
16
+ const { actionData, walletProvider, apiProvider, chainId, sender } = options;
17
+ const sendAction = likeSendAction || actionData.send;
18
+ if (!sendAction || !chainId) {
19
+ return {};
20
+ }
21
+ const result = {
22
+ eoa: null,
23
+ cex: null,
24
+ contract: null,
25
+ usd_value: 0,
26
+ protocol: null,
27
+ hasTransfer: false,
28
+ usedChains: [],
29
+ isTokenContract: false,
30
+ name: null,
31
+ onTransferWhitelist: false,
32
+ whitelistEnable: false,
33
+ receiverIsSpoofing: false,
34
+ hasReceiverPrivateKeyInWallet: false,
35
+ hasReceiverMnemonicInWallet: false,
36
+ };
37
+ const hasPrivateKeyInWallet = yield walletProvider.hasPrivateKeyInWallet(sendAction.to);
38
+ if (hasPrivateKeyInWallet) {
39
+ result.hasReceiverPrivateKeyInWallet =
40
+ hasPrivateKeyInWallet === KEYRING_TYPE.SimpleKeyring;
41
+ result.hasReceiverMnemonicInWallet =
42
+ hasPrivateKeyInWallet === KEYRING_TYPE.HdKeyring;
43
+ }
44
+ queue.add(() => __awaiter(void 0, void 0, void 0, function* () {
45
+ const { has_transfer } = yield apiProvider.hasTransfer(chainId, sender, sendAction.to);
46
+ result.hasTransfer = has_transfer;
47
+ }));
48
+ queue.add(() => __awaiter(void 0, void 0, void 0, function* () {
49
+ var _a;
50
+ const { desc } = yield apiProvider.addrDesc(sendAction.to);
51
+ if ((_a = desc.cex) === null || _a === void 0 ? void 0 : _a.id) {
52
+ result.cex = {
53
+ id: desc.cex.id,
54
+ logo: desc.cex.logo_url,
55
+ name: desc.cex.name,
56
+ bornAt: desc.born_at,
57
+ isDeposit: desc.cex.is_deposit,
58
+ };
59
+ }
60
+ if (desc.contract && Object.keys(desc.contract).length > 0) {
61
+ result.contract = desc.contract;
62
+ }
63
+ if (!result.cex && !result.contract) {
64
+ result.eoa = {
65
+ id: sendAction.to,
66
+ bornAt: desc.born_at,
67
+ };
68
+ }
69
+ result.usd_value = desc.usd_value;
70
+ if (result.cex) {
71
+ const { support } = yield apiProvider.depositCexSupport(sendAction.token.id, sendAction.token.chain, result.cex.id);
72
+ result.cex.supportToken = support;
73
+ }
74
+ if (result.contract) {
75
+ const { is_token } = yield apiProvider.isTokenContract(chainId, sendAction.to);
76
+ result.isTokenContract = is_token;
77
+ }
78
+ result.name = desc.name;
79
+ if (walletProvider.ALIAS_ADDRESS[sendAction.to.toLowerCase()]) {
80
+ result.name = walletProvider.ALIAS_ADDRESS[sendAction.to.toLowerCase()];
81
+ }
82
+ }));
83
+ queue.add(() => __awaiter(void 0, void 0, void 0, function* () {
84
+ const usedChainList = yield apiProvider.addrUsedChainList(sendAction.to);
85
+ result.usedChains = usedChainList;
86
+ }));
87
+ queue.add(() => __awaiter(void 0, void 0, void 0, function* () {
88
+ const { is_spoofing } = yield apiProvider.checkSpoofing({
89
+ from: sender,
90
+ to: sendAction.to,
91
+ });
92
+ result.receiverIsSpoofing = is_spoofing;
93
+ }));
94
+ const whitelist = yield walletProvider.getWhitelist();
95
+ // FIXME: I don't know why `isWhitelistEnabled` is blocking running tests, so skip it in test
96
+ if (process.env.NODE_ENV !== 'test') {
97
+ const whitelistEnable = yield walletProvider.isWhitelistEnabled();
98
+ result.whitelistEnable = whitelistEnable;
99
+ }
100
+ result.onTransferWhitelist = whitelist.includes(sendAction.to.toLowerCase());
101
+ yield waitQueueFinished(queue);
102
+ return result;
103
+ });