starknet 5.24.1 → 5.24.3

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
+ ## [5.24.3](https://github.com/starknet-io/starknet.js/compare/v5.24.2...v5.24.3) (2023-11-20)
2
+
3
+ ### Bug Fixes
4
+
5
+ - correct syncing type ([41f9d8a](https://github.com/starknet-io/starknet.js/commit/41f9d8a0d1b69c569e7a3aa55cec09f105c32356))
6
+
7
+ ## [5.24.2](https://github.com/starknet-io/starknet.js/compare/v5.24.1...v5.24.2) (2023-11-17)
8
+
9
+ ### Bug Fixes
10
+
11
+ - errors when testing in Testnet with a Cairo 1 account ([243074e](https://github.com/starknet-io/starknet.js/commit/243074ebd8324da2a33f13b5d8542949d7e92991))
12
+
1
13
  ## [5.24.1](https://github.com/starknet-io/starknet.js/compare/v5.24.0...v5.24.1) (2023-11-13)
2
14
 
3
15
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -293,7 +293,7 @@ declare enum CairoResultVariant {
293
293
  * @param resultContent value of type T or U.
294
294
  * @returns an instance representing a Cairo Result.
295
295
  * @example ```typescript
296
- * const myOption = new CairoResult<BigNumberish,CustomError>(CairoResultVariant.Ok, "0x54dda8");
296
+ * const myOption = new CairoResult<BigNumberish, CustomError>(CairoResultVariant.Ok, "0x54dda8");
297
297
  * ```
298
298
  */
299
299
  declare class CairoResult<T, U> {
@@ -1651,7 +1651,7 @@ type BlockTransactionsTraces = {
1651
1651
  transaction_hash: FELT;
1652
1652
  trace_root: TRANSACTION_TRACE;
1653
1653
  }[];
1654
- type Syncing = boolean | SYNC_STATUS;
1654
+ type Syncing = false | SYNC_STATUS;
1655
1655
  type Events = EVENTS_CHUNK;
1656
1656
  type InvokedTransaction = {
1657
1657
  transaction_hash: TXN_HASH;
@@ -4637,7 +4637,7 @@ declare function bigNumberishArrayToDecimalStringArray(rawCalldata: BigNumberish
4637
4637
  */
4638
4638
  declare function bigNumberishArrayToHexadecimalStringArray(rawCalldata: BigNumberish[]): string[];
4639
4639
  /**
4640
- * Test if string is whole number (0,1,2,3...)
4640
+ * Test if string is whole number (0, 1, 2, 3...)
4641
4641
  */
4642
4642
  declare const isStringWholeNumber: (value: string) => boolean;
4643
4643
  /**
@@ -5193,7 +5193,7 @@ declare const uint256: (it: BigNumberish) => Uint256;
5193
5193
  * Create unnamed tuple Cairo type (helper same as common struct type)
5194
5194
  * @example
5195
5195
  * ```typescript
5196
- * tuple(1,'0x101',16);
5196
+ * tuple(1, '0x101', 16);
5197
5197
  * ```
5198
5198
  */
5199
5199
  declare const tuple: (...args: (BigNumberish | object | boolean)[]) => Record<number, BigNumberish | object | boolean>;
@@ -5273,10 +5273,10 @@ declare class CallData {
5273
5273
  * @return Calldata - parsed arguments in format that contract is expecting
5274
5274
  * @example
5275
5275
  * ```typescript
5276
- * const calldata = myCallData.compile("constructor",["0x34a",[1,3n]]);
5276
+ * const calldata = myCallData.compile("constructor", ["0x34a", [1, 3n]]);
5277
5277
  * ```
5278
5278
  * ```typescript
5279
- * const calldata2 = myCallData.compile("constructor",{list:[1,3n],balance:"0x34"}); // wrong order is valid
5279
+ * const calldata2 = myCallData.compile("constructor", {list:[1, 3n], balance:"0x34"}); // wrong order is valid
5280
5280
  * ```
5281
5281
  */
5282
5282
  compile(method: string, argsCalldata: RawArgs): Calldata;
@@ -5109,10 +5109,10 @@ var starknet = (() => {
5109
5109
  * @return Calldata - parsed arguments in format that contract is expecting
5110
5110
  * @example
5111
5111
  * ```typescript
5112
- * const calldata = myCallData.compile("constructor",["0x34a",[1,3n]]);
5112
+ * const calldata = myCallData.compile("constructor", ["0x34a", [1, 3n]]);
5113
5113
  * ```
5114
5114
  * ```typescript
5115
- * const calldata2 = myCallData.compile("constructor",{list:[1,3n],balance:"0x34"}); // wrong order is valid
5115
+ * const calldata2 = myCallData.compile("constructor", {list:[1, 3n], balance:"0x34"}); // wrong order is valid
5116
5116
  * ```
5117
5117
  */
5118
5118
  compile(method, argsCalldata) {
@@ -12174,7 +12174,8 @@ ${res.tx_failure_reason.error_message}`;
12174
12174
  const orderCalls = calls.map((call) => ({
12175
12175
  contractAddress: call.contractAddress,
12176
12176
  entrypoint: call.entrypoint,
12177
- calldata: call.calldata
12177
+ calldata: Array.isArray(call.calldata) && "__compiled__" in call.calldata ? call.calldata : CallData.compile(call.calldata)
12178
+ // RawArgsObject | RawArgsArray type
12178
12179
  }));
12179
12180
  return CallData.compile({ orderCalls });
12180
12181
  };