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.js
CHANGED
|
@@ -821,31 +821,15 @@ function stringFromByteArray(myByteArray) {
|
|
|
821
821
|
return cumuledString + add;
|
|
822
822
|
}, "") + pending_word;
|
|
823
823
|
}
|
|
824
|
-
function byteArrayFromString(
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
pending_word_len: 0
|
|
830
|
-
};
|
|
831
|
-
}
|
|
832
|
-
const myShortStrings = splitLongString(myString);
|
|
833
|
-
const remains = myShortStrings[myShortStrings.length - 1];
|
|
834
|
-
const myShortStringsEncoded = myShortStrings.map(
|
|
835
|
-
(shortStr) => encodeShortString(shortStr)
|
|
836
|
-
);
|
|
837
|
-
if (remains.length === 31) {
|
|
838
|
-
return {
|
|
839
|
-
data: myShortStringsEncoded,
|
|
840
|
-
pending_word: "0x00",
|
|
841
|
-
pending_word_len: 0
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
const pendingEncodedWord = myShortStringsEncoded.pop();
|
|
824
|
+
function byteArrayFromString(targetString) {
|
|
825
|
+
const shortStrings = splitLongString(targetString);
|
|
826
|
+
const remainder = shortStrings[shortStrings.length - 1];
|
|
827
|
+
const shortStringsEncoded = shortStrings.map(encodeShortString);
|
|
828
|
+
const [pendingWord, pendingWordLength] = remainder === void 0 || remainder.length === 31 ? ["0x00", 0] : [shortStringsEncoded.pop(), remainder.length];
|
|
845
829
|
return {
|
|
846
|
-
data:
|
|
847
|
-
pending_word:
|
|
848
|
-
pending_word_len:
|
|
830
|
+
data: shortStringsEncoded.length === 0 ? [] : shortStringsEncoded,
|
|
831
|
+
pending_word: pendingWord,
|
|
832
|
+
pending_word_len: pendingWordLength
|
|
849
833
|
};
|
|
850
834
|
}
|
|
851
835
|
|
|
@@ -5068,7 +5052,6 @@ var SignerInterface = class {
|
|
|
5068
5052
|
var typedData_exports = {};
|
|
5069
5053
|
__export(typedData_exports, {
|
|
5070
5054
|
TypedDataRevision: () => TypedDataRevision,
|
|
5071
|
-
byteArrayFromString: () => byteArrayFromString2,
|
|
5072
5055
|
encodeData: () => encodeData,
|
|
5073
5056
|
encodeType: () => encodeType,
|
|
5074
5057
|
encodeValue: () => encodeValue,
|
|
@@ -5187,17 +5170,6 @@ var revisionConfiguration = {
|
|
|
5187
5170
|
presetTypes: {}
|
|
5188
5171
|
}
|
|
5189
5172
|
};
|
|
5190
|
-
function byteArrayFromString2(targetString) {
|
|
5191
|
-
const shortStrings = splitLongString(targetString);
|
|
5192
|
-
const remainder = shortStrings[shortStrings.length - 1];
|
|
5193
|
-
const shortStringsEncoded = shortStrings.map(encodeShortString);
|
|
5194
|
-
const [pendingWord, pendingWordLength] = remainder === void 0 || remainder.length === 31 ? ["0x00", 0] : [shortStringsEncoded.pop(), remainder.length];
|
|
5195
|
-
return {
|
|
5196
|
-
data: shortStringsEncoded.length === 0 ? ["0x00"] : shortStringsEncoded,
|
|
5197
|
-
pending_word: pendingWord,
|
|
5198
|
-
pending_word_len: pendingWordLength
|
|
5199
|
-
};
|
|
5200
|
-
}
|
|
5201
5173
|
function identifyRevision({ types, domain }) {
|
|
5202
5174
|
if (revisionConfiguration["1" /* Active */].domain in types && domain.revision === "1" /* Active */)
|
|
5203
5175
|
return "1" /* Active */;
|
|
@@ -5349,7 +5321,7 @@ function encodeValue(types, type, data, ctx = {}, revision = "0" /* Legacy */) {
|
|
|
5349
5321
|
}
|
|
5350
5322
|
case "string": {
|
|
5351
5323
|
if (revision === "1" /* Active */) {
|
|
5352
|
-
const byteArray =
|
|
5324
|
+
const byteArray = byteArrayFromString(data);
|
|
5353
5325
|
const elements = [
|
|
5354
5326
|
byteArray.data.length,
|
|
5355
5327
|
...byteArray.data,
|