starknet 6.4.0 → 6.4.1
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +5 -10
- package/dist/index.global.js +9 -37
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -717,31 +717,15 @@ function stringFromByteArray(myByteArray) {
|
|
|
717
717
|
return cumuledString + add;
|
|
718
718
|
}, "") + pending_word;
|
|
719
719
|
}
|
|
720
|
-
function byteArrayFromString(
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
pending_word_len: 0
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
const myShortStrings = splitLongString(myString);
|
|
729
|
-
const remains = myShortStrings[myShortStrings.length - 1];
|
|
730
|
-
const myShortStringsEncoded = myShortStrings.map(
|
|
731
|
-
(shortStr) => encodeShortString(shortStr)
|
|
732
|
-
);
|
|
733
|
-
if (remains.length === 31) {
|
|
734
|
-
return {
|
|
735
|
-
data: myShortStringsEncoded,
|
|
736
|
-
pending_word: "0x00",
|
|
737
|
-
pending_word_len: 0
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
|
-
const pendingEncodedWord = myShortStringsEncoded.pop();
|
|
720
|
+
function byteArrayFromString(targetString) {
|
|
721
|
+
const shortStrings = splitLongString(targetString);
|
|
722
|
+
const remainder = shortStrings[shortStrings.length - 1];
|
|
723
|
+
const shortStringsEncoded = shortStrings.map(encodeShortString);
|
|
724
|
+
const [pendingWord, pendingWordLength] = remainder === void 0 || remainder.length === 31 ? ["0x00", 0] : [shortStringsEncoded.pop(), remainder.length];
|
|
741
725
|
return {
|
|
742
|
-
data:
|
|
743
|
-
pending_word:
|
|
744
|
-
pending_word_len:
|
|
726
|
+
data: shortStringsEncoded.length === 0 ? [] : shortStringsEncoded,
|
|
727
|
+
pending_word: pendingWord,
|
|
728
|
+
pending_word_len: pendingWordLength
|
|
745
729
|
};
|
|
746
730
|
}
|
|
747
731
|
|
|
@@ -4964,7 +4948,6 @@ var SignerInterface = class {
|
|
|
4964
4948
|
var typedData_exports = {};
|
|
4965
4949
|
__export(typedData_exports, {
|
|
4966
4950
|
TypedDataRevision: () => TypedDataRevision,
|
|
4967
|
-
byteArrayFromString: () => byteArrayFromString2,
|
|
4968
4951
|
encodeData: () => encodeData,
|
|
4969
4952
|
encodeType: () => encodeType,
|
|
4970
4953
|
encodeValue: () => encodeValue,
|
|
@@ -5083,17 +5066,6 @@ var revisionConfiguration = {
|
|
|
5083
5066
|
presetTypes: {}
|
|
5084
5067
|
}
|
|
5085
5068
|
};
|
|
5086
|
-
function byteArrayFromString2(targetString) {
|
|
5087
|
-
const shortStrings = splitLongString(targetString);
|
|
5088
|
-
const remainder = shortStrings[shortStrings.length - 1];
|
|
5089
|
-
const shortStringsEncoded = shortStrings.map(encodeShortString);
|
|
5090
|
-
const [pendingWord, pendingWordLength] = remainder === void 0 || remainder.length === 31 ? ["0x00", 0] : [shortStringsEncoded.pop(), remainder.length];
|
|
5091
|
-
return {
|
|
5092
|
-
data: shortStringsEncoded.length === 0 ? ["0x00"] : shortStringsEncoded,
|
|
5093
|
-
pending_word: pendingWord,
|
|
5094
|
-
pending_word_len: pendingWordLength
|
|
5095
|
-
};
|
|
5096
|
-
}
|
|
5097
5069
|
function identifyRevision({ types, domain }) {
|
|
5098
5070
|
if (revisionConfiguration["1" /* Active */].domain in types && domain.revision === "1" /* Active */)
|
|
5099
5071
|
return "1" /* Active */;
|
|
@@ -5245,7 +5217,7 @@ function encodeValue(types, type, data, ctx = {}, revision = "0" /* Legacy */) {
|
|
|
5245
5217
|
}
|
|
5246
5218
|
case "string": {
|
|
5247
5219
|
if (revision === "1" /* Active */) {
|
|
5248
|
-
const byteArray =
|
|
5220
|
+
const byteArray = byteArrayFromString(data);
|
|
5249
5221
|
const elements = [
|
|
5250
5222
|
byteArray.data.length,
|
|
5251
5223
|
...byteArray.data,
|