starknet 6.1.3 → 6.1.5

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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## [6.1.5](https://github.com/starknet-io/starknet.js/compare/v6.1.4...v6.1.5) (2024-03-02)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **RpcChannel:** allow client to provide `specVersion` ([ae8cf8e](https://github.com/starknet-io/starknet.js/commit/ae8cf8e19d8ba73c52376d83d2e084da008daba1))
6
+
7
+ ## [6.1.4](https://github.com/starknet-io/starknet.js/compare/v6.1.3...v6.1.4) (2024-02-26)
8
+
9
+ ### Bug Fixes
10
+
11
+ - **Calldata.compile:** do not split long `entrypoint` names before calling `getSelectorFromName` ([9434bcd](https://github.com/starknet-io/starknet.js/commit/9434bcddf74069c7e5bdecbac94017ae23cd2a45))
12
+
1
13
  ## [6.1.3](https://github.com/starknet-io/starknet.js/compare/v6.1.2...v6.1.3) (2024-02-23)
2
14
 
3
15
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -2029,6 +2029,7 @@ type RpcProviderOptions = {
2029
2029
  headers?: object;
2030
2030
  blockIdentifier?: BlockIdentifier;
2031
2031
  chainId?: StarknetChainId;
2032
+ specVersion?: string;
2032
2033
  default?: boolean;
2033
2034
  waitMode?: boolean;
2034
2035
  };
@@ -2475,7 +2476,7 @@ declare class RpcChannel {
2475
2476
  requestId: number;
2476
2477
  readonly blockIdentifier: BlockIdentifier;
2477
2478
  private chainId?;
2478
- private speckVersion?;
2479
+ private specVersion?;
2479
2480
  readonly waitMode: Boolean;
2480
2481
  constructor(optionsOrProvider?: RpcProviderOptions);
2481
2482
  fetch(method: string, params?: object, id?: string | number): any;
@@ -17477,10 +17477,10 @@ var starknet = (() => {
17477
17477
  const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o;
17478
17478
  return Object.entries(oe).flatMap(([k, v]) => {
17479
17479
  let value = v;
17480
- if (isLongText(value))
17481
- value = byteArrayFromString(value);
17482
17480
  if (k === "entrypoint")
17483
17481
  value = getSelectorFromName(value);
17482
+ else if (isLongText(value))
17483
+ value = byteArrayFromString(value);
17484
17484
  const kk = Array.isArray(oe) && k === "0" ? "$$len" : k;
17485
17485
  if (isBigInt(value))
17486
17486
  return [[`${prefix}${kk}`, felt(value)]];
@@ -23327,11 +23327,11 @@ var starknet = (() => {
23327
23327
  requestId;
23328
23328
  blockIdentifier;
23329
23329
  chainId;
23330
- speckVersion;
23330
+ specVersion;
23331
23331
  waitMode;
23332
23332
  // behave like web2 rpc and return when tx is processed
23333
23333
  constructor(optionsOrProvider) {
23334
- const { nodeUrl, retries, headers, blockIdentifier, chainId, waitMode } = optionsOrProvider || {};
23334
+ const { nodeUrl, retries, headers, blockIdentifier, chainId, specVersion, waitMode } = optionsOrProvider || {};
23335
23335
  if (Object.values(NetworkName).includes(nodeUrl)) {
23336
23336
  this.nodeUrl = getDefaultNodeUrl(nodeUrl, optionsOrProvider?.default);
23337
23337
  } else if (nodeUrl) {
@@ -23343,6 +23343,7 @@ var starknet = (() => {
23343
23343
  this.headers = { ...defaultOptions.headers, ...headers };
23344
23344
  this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier;
23345
23345
  this.chainId = chainId;
23346
+ this.specVersion = specVersion;
23346
23347
  this.waitMode = waitMode || false;
23347
23348
  this.requestId = 0;
23348
23349
  }
@@ -23391,8 +23392,8 @@ var starknet = (() => {
23391
23392
  return this.chainId;
23392
23393
  }
23393
23394
  async getSpecVersion() {
23394
- this.speckVersion ??= await this.fetchEndpoint("starknet_specVersion");
23395
- return this.speckVersion;
23395
+ this.specVersion ??= await this.fetchEndpoint("starknet_specVersion");
23396
+ return this.specVersion;
23396
23397
  }
23397
23398
  getNonceForAddress(contractAddress, blockIdentifier = this.blockIdentifier) {
23398
23399
  const contract_address = toHex(contractAddress);