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/dist/index.js CHANGED
@@ -2325,7 +2325,8 @@ __export(num_exports, {
2325
2325
  toBigInt: () => toBigInt,
2326
2326
  toCairoBool: () => toCairoBool,
2327
2327
  toHex: () => toHex,
2328
- toHexString: () => toHexString
2328
+ toHexString: () => toHexString,
2329
+ toStorageKey: () => toStorageKey
2329
2330
  });
2330
2331
  var import_utils = require("@noble/curves/abstract/utils");
2331
2332
  function isHex(hex) {
@@ -2340,6 +2341,10 @@ function isBigInt(value) {
2340
2341
  function toHex(number2) {
2341
2342
  return addHexPrefix(toBigInt(number2).toString(16));
2342
2343
  }
2344
+ function toStorageKey(number2) {
2345
+ const res = addHexPrefix(toBigInt(number2).toString(16).padStart(64, "0"));
2346
+ return res;
2347
+ }
2343
2348
  function hexToDecimalString(hex) {
2344
2349
  return BigInt(addHexPrefix(hex)).toString(10);
2345
2350
  }
@@ -4090,7 +4095,7 @@ var RpcProvider = class {
4090
4095
  return this.fetchEndpoint("starknet_getStateUpdate", { block_id });
4091
4096
  }
4092
4097
  async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) {
4093
- const parsedKey = toHex(key);
4098
+ const parsedKey = toStorageKey(key);
4094
4099
  const block_id = new Block(blockIdentifier).identifier;
4095
4100
  return this.fetchEndpoint("starknet_getStorageAt", {
4096
4101
  contract_address: contractAddress,