starknet 5.19.2 → 5.19.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/CHANGELOG.md +13 -0
- package/dist/index.d.ts +325 -306
- package/dist/index.global.js +211 -240
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -100,7 +100,7 @@ function sanitizeHex(hex) {
|
|
|
100
100
|
function utf8ToArray(str) {
|
|
101
101
|
return new TextEncoder().encode(str);
|
|
102
102
|
}
|
|
103
|
-
var pascalToSnake = (text) => text.split(/(?=[A-Z])/).join("_").toUpperCase();
|
|
103
|
+
var pascalToSnake = (text) => !/[a-z]/.test(text) ? text.split(/(?=[A-Z])/).join("_").toUpperCase() : text;
|
|
104
104
|
|
|
105
105
|
// src/constants.ts
|
|
106
106
|
var HEX_STR_TRANSACTION_VERSION_1 = "0x1";
|
|
@@ -2421,7 +2421,7 @@ __export(selector_exports, {
|
|
|
2421
2421
|
keccakBn: () => keccakBn,
|
|
2422
2422
|
starknetKeccak: () => starknetKeccak
|
|
2423
2423
|
});
|
|
2424
|
-
import { keccak } from "
|
|
2424
|
+
import { keccak } from "@scure/starknet";
|
|
2425
2425
|
function keccakBn(value) {
|
|
2426
2426
|
const hexWithoutPrefix = removeHexPrefix(toHex(BigInt(value)));
|
|
2427
2427
|
const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`;
|
|
@@ -2999,10 +2999,6 @@ function orderPropsByAbi(unorderedObject, abiOfObject, structs, enums) {
|
|
|
2999
2999
|
if (isTypeEthAddress(abiType)) {
|
|
3000
3000
|
return unorderedItem;
|
|
3001
3001
|
}
|
|
3002
|
-
if (isTypeStruct(abiType, structs)) {
|
|
3003
|
-
const abiOfStruct = structs[abiType].members;
|
|
3004
|
-
return orderStruct(unorderedItem, abiOfStruct);
|
|
3005
|
-
}
|
|
3006
3002
|
if (isTypeUint256(abiType)) {
|
|
3007
3003
|
const u256 = unorderedItem;
|
|
3008
3004
|
if (typeof u256 !== "object") {
|
|
@@ -3013,6 +3009,10 @@ function orderPropsByAbi(unorderedObject, abiOfObject, structs, enums) {
|
|
|
3013
3009
|
}
|
|
3014
3010
|
return { low: u256.low, high: u256.high };
|
|
3015
3011
|
}
|
|
3012
|
+
if (isTypeStruct(abiType, structs)) {
|
|
3013
|
+
const abiOfStruct = structs[abiType].members;
|
|
3014
|
+
return orderStruct(unorderedItem, abiOfStruct);
|
|
3015
|
+
}
|
|
3016
3016
|
return unorderedItem;
|
|
3017
3017
|
};
|
|
3018
3018
|
const orderStruct = (unorderedObject2, abiObject) => {
|
|
@@ -3910,7 +3910,7 @@ __export(hash_exports, {
|
|
|
3910
3910
|
transactionVersion: () => transactionVersion,
|
|
3911
3911
|
transactionVersion_2: () => transactionVersion_2
|
|
3912
3912
|
});
|
|
3913
|
-
import { poseidonHashMany } from "
|
|
3913
|
+
import { poseidonHashMany } from "@scure/starknet";
|
|
3914
3914
|
|
|
3915
3915
|
// src/utils/ec.ts
|
|
3916
3916
|
var ec_exports = {};
|
|
@@ -3918,7 +3918,7 @@ __export(ec_exports, {
|
|
|
3918
3918
|
starkCurve: () => starkCurve,
|
|
3919
3919
|
weierstrass: () => weierstrass
|
|
3920
3920
|
});
|
|
3921
|
-
import * as starkCurve from "
|
|
3921
|
+
import * as starkCurve from "@scure/starknet";
|
|
3922
3922
|
import * as weierstrass from "@noble/curves/abstract/weierstrass";
|
|
3923
3923
|
|
|
3924
3924
|
// src/utils/json.ts
|
|
@@ -4163,7 +4163,7 @@ __export(stark_exports, {
|
|
|
4163
4163
|
signatureToDecimalArray: () => signatureToDecimalArray,
|
|
4164
4164
|
signatureToHexArray: () => signatureToHexArray
|
|
4165
4165
|
});
|
|
4166
|
-
import { getStarkKey, utils } from "
|
|
4166
|
+
import { getStarkKey, utils } from "@scure/starknet";
|
|
4167
4167
|
import { gzip, ungzip } from "pako";
|
|
4168
4168
|
function compressProgram(jsonProgram) {
|
|
4169
4169
|
const stringified = typeof jsonProgram === "string" ? jsonProgram : stringify2(jsonProgram);
|
|
@@ -6617,6 +6617,11 @@ var AccountInterface = class extends ProviderInterface {
|
|
|
6617
6617
|
};
|
|
6618
6618
|
|
|
6619
6619
|
// src/utils/events/index.ts
|
|
6620
|
+
var events_exports = {};
|
|
6621
|
+
__export(events_exports, {
|
|
6622
|
+
getAbiEvents: () => getAbiEvents,
|
|
6623
|
+
parseEvents: () => parseEvents
|
|
6624
|
+
});
|
|
6620
6625
|
function getAbiEvents(abi) {
|
|
6621
6626
|
return abi.filter((abiEntry) => abiEntry.type === "event" && (abiEntry.size || abiEntry.kind !== "enum")).reduce((acc, abiEntry) => {
|
|
6622
6627
|
const entryName = abiEntry.name.slice(abiEntry.name.lastIndexOf(":") + 1);
|
|
@@ -7060,6 +7065,7 @@ export {
|
|
|
7060
7065
|
defaultProvider,
|
|
7061
7066
|
ec_exports as ec,
|
|
7062
7067
|
encode_exports as encode,
|
|
7068
|
+
events_exports as events,
|
|
7063
7069
|
extractContractHashes,
|
|
7064
7070
|
fixProto,
|
|
7065
7071
|
fixStack,
|