@rabby-wallet/rabby-action 0.1.1-beta.1 → 0.1.1-beta.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.
|
@@ -12,6 +12,20 @@ export const formatSecurityEngineContractCall = (options) => __awaiter(void 0, v
|
|
|
12
12
|
if (!actionData.contractCall || !chainId) {
|
|
13
13
|
return {};
|
|
14
14
|
}
|
|
15
|
+
if (options.type === 'typed_data') {
|
|
16
|
+
if (options.actionData.contractId) {
|
|
17
|
+
return {
|
|
18
|
+
contractCall: {
|
|
19
|
+
id: options.actionData.contractId,
|
|
20
|
+
chainId: chainId,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
if (options.type === 'text') {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
15
29
|
const data = requireData;
|
|
16
30
|
return {
|
|
17
31
|
contractCall: {
|
|
@@ -56,7 +56,6 @@ export const fetchActionRequiredData = (options) => __awaiter(void 0, void 0, vo
|
|
|
56
56
|
fetchDataApproveToken(options),
|
|
57
57
|
fetchDataAssetOrder(options),
|
|
58
58
|
fetchDataCancelTx(options),
|
|
59
|
-
// @deprecated we don't parse common action data anymore, will be removed in the future
|
|
60
59
|
fetchDataCommon(options),
|
|
61
60
|
fetchDataContractCall(options),
|
|
62
61
|
fetchDataCrossSwapToken(options),
|
|
@@ -89,9 +88,5 @@ export const fetchActionRequiredData = (options) => __awaiter(void 0, void 0, vo
|
|
|
89
88
|
fetchDataCoboSafeModificationTokenApproval(options),
|
|
90
89
|
fetchDataRevokePermit(options),
|
|
91
90
|
]);
|
|
92
|
-
|
|
93
|
-
if (requireData && Object.keys(requireData).length === 0) {
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
return requireData;
|
|
91
|
+
return result.reduce((acc, val) => (Object.assign(Object.assign({}, acc), val)), {});
|
|
97
92
|
});
|
package/dist/parseAction.js
CHANGED
|
@@ -66,7 +66,11 @@ export function parseAction(options) {
|
|
|
66
66
|
}
|
|
67
67
|
if (actionKeys.length === 0) {
|
|
68
68
|
if (options.type === 'typed_data') {
|
|
69
|
-
|
|
69
|
+
const typedDataAction = action;
|
|
70
|
+
if (typedDataAction.chainId && typedDataAction.contractId) {
|
|
71
|
+
return parseTypedDataAction(parseActionContractCall)(options);
|
|
72
|
+
}
|
|
73
|
+
return parseTypedDataAction((r) => r)(options);
|
|
70
74
|
}
|
|
71
75
|
else if (options.type === 'transaction') {
|
|
72
76
|
return parseActionContractCall(options);
|