starknet 5.13.1 → 5.13.2
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 +10 -0
- package/dist/index.global.js +7 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2248,7 +2248,8 @@ __export(num_exports, {
|
|
|
2248
2248
|
toBigInt: () => toBigInt,
|
|
2249
2249
|
toCairoBool: () => toCairoBool,
|
|
2250
2250
|
toHex: () => toHex,
|
|
2251
|
-
toHexString: () => toHexString
|
|
2251
|
+
toHexString: () => toHexString,
|
|
2252
|
+
toStorageKey: () => toStorageKey
|
|
2252
2253
|
});
|
|
2253
2254
|
import { hexToBytes as hexToBytesNoble } from "@noble/curves/abstract/utils";
|
|
2254
2255
|
function isHex(hex) {
|
|
@@ -2263,6 +2264,10 @@ function isBigInt(value) {
|
|
|
2263
2264
|
function toHex(number2) {
|
|
2264
2265
|
return addHexPrefix(toBigInt(number2).toString(16));
|
|
2265
2266
|
}
|
|
2267
|
+
function toStorageKey(number2) {
|
|
2268
|
+
const res = addHexPrefix(toBigInt(number2).toString(16).padStart(64, "0"));
|
|
2269
|
+
return res;
|
|
2270
|
+
}
|
|
2266
2271
|
function hexToDecimalString(hex) {
|
|
2267
2272
|
return BigInt(addHexPrefix(hex)).toString(10);
|
|
2268
2273
|
}
|
|
@@ -4013,7 +4018,7 @@ var RpcProvider = class {
|
|
|
4013
4018
|
return this.fetchEndpoint("starknet_getStateUpdate", { block_id });
|
|
4014
4019
|
}
|
|
4015
4020
|
async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) {
|
|
4016
|
-
const parsedKey =
|
|
4021
|
+
const parsedKey = toStorageKey(key);
|
|
4017
4022
|
const block_id = new Block(blockIdentifier).identifier;
|
|
4018
4023
|
return this.fetchEndpoint("starknet_getStorageAt", {
|
|
4019
4024
|
contract_address: contractAddress,
|