starknet 10.7.2 → 10.7.4

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/index.js CHANGED
@@ -8774,9 +8774,15 @@ function getHex(value) {
8774
8774
  }
8775
8775
  function validateTypedData(data) {
8776
8776
  const typedData = data;
8777
- return Boolean(
8778
- typedData.message && typedData.primaryType && typedData.types && identifyRevision(typedData)
8779
- );
8777
+ if (!(typedData.message && typedData.primaryType && typedData.types)) {
8778
+ return false;
8779
+ }
8780
+ const revision = identifyRevision(typedData);
8781
+ if (!revision) {
8782
+ return false;
8783
+ }
8784
+ const presetNames = Object.keys(revisionConfiguration[revision].presetTypes);
8785
+ return Object.keys(typedData.types).every((name) => !presetNames.includes(name));
8780
8786
  }
8781
8787
  function prepareSelector(selector) {
8782
8788
  return isHex(selector) ? selector : getSelectorFromName(selector);
@@ -11869,9 +11875,10 @@ var Deployer = class {
11869
11875
  const compiledConstructorCallData = getCompiledCalldata(constructorCalldata, () => {
11870
11876
  if (abi) {
11871
11877
  const calldataClass = new CallData(abi);
11872
- const rawArgs = Object.values(constructorCalldata);
11873
- calldataClass.validate(ValidateType.DEPLOY, "constructor", rawArgs);
11874
- return calldataClass.compile("constructor", rawArgs);
11878
+ if (Array.isArray(constructorCalldata)) {
11879
+ calldataClass.validate(ValidateType.DEPLOY, "constructor", constructorCalldata);
11880
+ }
11881
+ return calldataClass.compile("constructor", constructorCalldata);
11875
11882
  }
11876
11883
  return CallData.compile(constructorCalldata);
11877
11884
  });