starknet 5.4.0 → 5.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 +7 -0
- package/dist/index.d.ts +11 -9
- package/dist/index.global.js +7 -11
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2784,7 +2784,6 @@ __export(stark_exports, {
|
|
|
2784
2784
|
estimatedFeeToMaxFee: () => estimatedFeeToMaxFee,
|
|
2785
2785
|
formatSignature: () => formatSignature,
|
|
2786
2786
|
makeAddress: () => makeAddress,
|
|
2787
|
-
parseSignature: () => parseSignature,
|
|
2788
2787
|
randomAddress: () => randomAddress,
|
|
2789
2788
|
signatureToDecimalArray: () => signatureToDecimalArray,
|
|
2790
2789
|
signatureToHexArray: () => signatureToHexArray
|
|
@@ -2805,12 +2804,15 @@ function makeAddress(input) {
|
|
|
2805
2804
|
}
|
|
2806
2805
|
function formatSignature(sig) {
|
|
2807
2806
|
if (!sig)
|
|
2808
|
-
|
|
2807
|
+
throw Error("formatSignature: provided signature is undefined");
|
|
2808
|
+
if (Array.isArray(sig)) {
|
|
2809
|
+
return sig.map((it) => toHex(it));
|
|
2810
|
+
}
|
|
2809
2811
|
try {
|
|
2810
2812
|
const { r, s } = sig;
|
|
2811
2813
|
return [toHex(r), toHex(s)];
|
|
2812
2814
|
} catch (e) {
|
|
2813
|
-
|
|
2815
|
+
throw new Error("Signature need to be weierstrass.SignatureType or an array for custom");
|
|
2814
2816
|
}
|
|
2815
2817
|
}
|
|
2816
2818
|
function signatureToDecimalArray(sig) {
|
|
@@ -2819,12 +2821,6 @@ function signatureToDecimalArray(sig) {
|
|
|
2819
2821
|
function signatureToHexArray(sig) {
|
|
2820
2822
|
return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig));
|
|
2821
2823
|
}
|
|
2822
|
-
function parseSignature(sig) {
|
|
2823
|
-
if (!sig)
|
|
2824
|
-
return void 0;
|
|
2825
|
-
const [r, s] = sig;
|
|
2826
|
-
return new import_micro_starknet2.Signature(toBigInt(r), toBigInt(s));
|
|
2827
|
-
}
|
|
2828
2824
|
function compileCalldata(args) {
|
|
2829
2825
|
const compiledData = Object.values(args).flatMap((value) => {
|
|
2830
2826
|
if (Array.isArray(value))
|
|
@@ -3459,7 +3455,7 @@ var SequencerAPIResponseParser = class extends ResponseParser {
|
|
|
3459
3455
|
max_fee: "max_fee" in res.transaction ? res.transaction.max_fee : void 0,
|
|
3460
3456
|
nonce: res.transaction.nonce,
|
|
3461
3457
|
sender_address: "sender_address" in res.transaction ? res.transaction.sender_address : void 0,
|
|
3462
|
-
signature: "signature" in res.transaction ?
|
|
3458
|
+
signature: "signature" in res.transaction ? res.transaction.signature : void 0,
|
|
3463
3459
|
transaction_hash: "transaction_hash" in res.transaction ? res.transaction.transaction_hash : void 0,
|
|
3464
3460
|
version: "version" in res.transaction ? res.transaction.version : void 0
|
|
3465
3461
|
};
|
|
@@ -5506,7 +5502,7 @@ var Account = class extends Provider {
|
|
|
5506
5502
|
entrypoint: "isValidSignature",
|
|
5507
5503
|
calldata: compileCalldata({
|
|
5508
5504
|
hash: toBigInt(hash).toString(),
|
|
5509
|
-
signature:
|
|
5505
|
+
signature: formatSignature(signature)
|
|
5510
5506
|
})
|
|
5511
5507
|
});
|
|
5512
5508
|
return true;
|