starknet 11.0.0-beta.6 → 11.0.0-beta.7

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,11 @@
1
+ # [11.0.0-beta.7](https://github.com/starknet-io/starknet.js/compare/v11.0.0-beta.6...v11.0.0-beta.7) (2026-08-26)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **calldata:** a Cairo type serializes itself, abi or not ([c0943fb](https://github.com/starknet-io/starknet.js/commit/c0943fb173ab7e914ae213865c8cf7cf78898746))
6
+ - **calldata:** an abi slot accepts the Cairo type it declares ([b9fa576](https://github.com/starknet-io/starknet.js/commit/b9fa5769aba339a27a989d249d4adef1b04f79a8))
7
+ - **calldata:** out-of-range arguments refused, negative results come back negative ([41bf052](https://github.com/starknet-io/starknet.js/commit/41bf052f11a66d9b72e8db2a964b86c8161546b1))
8
+
1
9
  # [11.0.0-beta.6](https://github.com/starknet-io/starknet.js/compare/v11.0.0-beta.5...v11.0.0-beta.6) (2026-08-25)
2
10
 
3
11
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -4101,6 +4101,24 @@ declare class CairoUint16 {
4101
4101
  static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint16;
4102
4102
  }
4103
4103
 
4104
+ declare class CairoUint32 {
4105
+ data: bigint;
4106
+ static abiSelector: string;
4107
+ constructor(data: BigNumberish | boolean | unknown);
4108
+ static __processData(data: BigNumberish | boolean | unknown): bigint;
4109
+ toApiRequest(): string[];
4110
+ toBigInt(): bigint;
4111
+ decodeUtf8(): string;
4112
+ toHexString(): string;
4113
+ static validate(data: BigNumberish | boolean | unknown): void;
4114
+ static is(data: BigNumberish | boolean | unknown): boolean;
4115
+ /**
4116
+ * Check if provided abi type is this data type
4117
+ */
4118
+ static isAbiType(abiType: string): boolean;
4119
+ static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint32;
4120
+ }
4121
+
4104
4122
  declare class CairoUint64 {
4105
4123
  data: bigint;
4106
4124
  static abiSelector: string;
@@ -4274,7 +4292,15 @@ type ParsingStrategy = {
4274
4292
  response: Record<AbiEntryType, (responseIterator: Iterator<string>) => any>;
4275
4293
  };
4276
4294
  /**
4277
- * More robust parsing strategy
4295
+ * The default parsing strategy.
4296
+ *
4297
+ * A request is validated, a response is only decoded. What the caller passes in is the caller's
4298
+ * mistake to catch, so an argument goes through the class of its declared type and is refused
4299
+ * when it does not fit. What a node answers is not, so a response is read as it comes — the
4300
+ * declared type is used there only where reading needs it: a negative i8..i128, which is a field
4301
+ * element on the wire and only its own class turns back into a negative number, a u256 or u512
4302
+ * spread over several felts, a bytes31 or a ByteArray carrying bytes.
4303
+ *
4278
4304
  * Configuration mapping - data-driven approach
4279
4305
  * Configure parsing strategy for each abi type
4280
4306
  */
@@ -4283,6 +4309,7 @@ declare const hdParsingStrategy: {
4283
4309
  readonly [CairoUint512.abiSelector]: (val: unknown) => string[];
4284
4310
  readonly [CairoUint8.abiSelector]: (val: unknown) => string[];
4285
4311
  readonly [CairoUint16.abiSelector]: (val: unknown) => string[];
4312
+ readonly [CairoUint32.abiSelector]: (val: unknown) => string[];
4286
4313
  readonly [CairoUint64.abiSelector]: (val: unknown) => string[];
4287
4314
  readonly [CairoUint96.abiSelector]: (val: unknown) => string[];
4288
4315
  readonly [CairoUint128.abiSelector]: (val: unknown) => string[];
@@ -4294,12 +4321,14 @@ declare const hdParsingStrategy: {
4294
4321
  readonly "core::bytes_31::bytes31": (val: unknown) => string[];
4295
4322
  readonly "core::byte_array::ByteArray": (val: unknown) => string[];
4296
4323
  readonly "core::felt252": (val: unknown) => string[];
4324
+ readonly "core::starknet::eth_address::EthAddress": (val: unknown) => string[];
4297
4325
  readonly "core::integer::u256": (val: unknown) => string[];
4298
4326
  };
4299
4327
  readonly response: {
4300
4328
  readonly [CairoUint512.abiSelector]: (responseIterator: Iterator<string>) => bigint;
4301
4329
  readonly [CairoUint8.abiSelector]: (responseIterator: Iterator<string>) => bigint;
4302
4330
  readonly [CairoUint16.abiSelector]: (responseIterator: Iterator<string>) => bigint;
4331
+ readonly [CairoUint32.abiSelector]: (responseIterator: Iterator<string>) => bigint;
4303
4332
  readonly [CairoUint64.abiSelector]: (responseIterator: Iterator<string>) => bigint;
4304
4333
  readonly [CairoUint96.abiSelector]: (responseIterator: Iterator<string>) => bigint;
4305
4334
  readonly [CairoUint128.abiSelector]: (responseIterator: Iterator<string>) => bigint;
@@ -4315,7 +4344,13 @@ declare const hdParsingStrategy: {
4315
4344
  };
4316
4345
  };
4317
4346
  /**
4318
- * Faster parsing strategy
4347
+ * A faster strategy, opt-in through the second argument of `new CallData(abi, strategy)`.
4348
+ *
4349
+ * It buys that speed by not going through the class of the declared type, which costs two things
4350
+ * the caller should weigh: an out-of-range u8/u16/u64/u96/u128 is serialized rather than refused,
4351
+ * and a negative i8..i128 comes back from a call as its raw field element rather than as a
4352
+ * negative number.
4353
+ *
4319
4354
  * Configuration mapping - data-driven approach
4320
4355
  * Configure parsing strategy for each abi type
4321
4356
  */
@@ -5171,6 +5206,10 @@ declare const RANGE_I128: {
5171
5206
  readonly min: bigint;
5172
5207
  readonly max: bigint;
5173
5208
  };
5209
+ declare const RANGE_ETH_ADDRESS: {
5210
+ readonly min: bigint;
5211
+ readonly max: bigint;
5212
+ };
5174
5213
  declare const LegacyUDC: {
5175
5214
  readonly ADDRESS: "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf";
5176
5215
  readonly ENTRYPOINT: "deployContract";
@@ -5315,6 +5354,7 @@ declare const constants_MAX_STORAGE_ITEM_SIZE: typeof MAX_STORAGE_ITEM_SIZE;
5315
5354
  declare const constants_OutsideExecutionCallerAny: typeof OutsideExecutionCallerAny;
5316
5355
  declare const constants_PAYMASTER_RPC_NODES: typeof PAYMASTER_RPC_NODES;
5317
5356
  declare const constants_PRIME: typeof PRIME;
5357
+ declare const constants_RANGE_ETH_ADDRESS: typeof RANGE_ETH_ADDRESS;
5318
5358
  declare const constants_RANGE_FELT: typeof RANGE_FELT;
5319
5359
  declare const constants_RANGE_I128: typeof RANGE_I128;
5320
5360
  declare const constants_RANGE_I16: typeof RANGE_I16;
@@ -5339,7 +5379,7 @@ declare const constants_TEXT_TO_FELT_MAX_LEN: typeof TEXT_TO_FELT_MAX_LEN;
5339
5379
  declare const constants_UDC: typeof UDC;
5340
5380
  declare const constants_ZERO: typeof ZERO;
5341
5381
  declare namespace constants {
5342
- export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, _BaseUrl as BaseUrl, type constants_ChannelDefaultOptions as ChannelDefaultOptions, type constants_ChannelDefaults as ChannelDefaults, type constants_ChannelMethodOptions as ChannelMethodOptions, constants_DEFAULT_GLOBAL_CONFIG as DEFAULT_GLOBAL_CONFIG, constants_HARDENING_4BYTES as HARDENING_4BYTES, constants_HARDENING_BYTE as HARDENING_BYTE, constants_IS_BROWSER as IS_BROWSER, constants_LegacyUDC as LegacyUDC, constants_MASK_250 as MASK_250, constants_MASK_31 as MASK_31, constants_MAX_STORAGE_ITEM_SIZE as MAX_STORAGE_ITEM_SIZE, _NetworkName as NetworkName, constants_OutsideExecutionCallerAny as OutsideExecutionCallerAny, constants_PAYMASTER_RPC_NODES as PAYMASTER_RPC_NODES, constants_PRIME as PRIME, constants_RANGE_FELT as RANGE_FELT, constants_RANGE_I128 as RANGE_I128, constants_RANGE_I16 as RANGE_I16, constants_RANGE_I32 as RANGE_I32, constants_RANGE_I64 as RANGE_I64, constants_RANGE_I8 as RANGE_I8, constants_RANGE_U128 as RANGE_U128, constants_RANGE_U16 as RANGE_U16, constants_RANGE_U32 as RANGE_U32, constants_RANGE_U64 as RANGE_U64, constants_RANGE_U8 as RANGE_U8, constants_RANGE_U96 as RANGE_U96, constants_RPC_DEFAULT_NODES as RPC_DEFAULT_NODES, constants_SNIP9_V1_INTERFACE_ID as SNIP9_V1_INTERFACE_ID, constants_SNIP9_V2_INTERFACE_ID as SNIP9_V2_INTERFACE_ID, constants_SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS as SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS, constants_SYSTEM_MESSAGES as SYSTEM_MESSAGES, _StarknetChainId as StarknetChainId, type constants_SupportedCairoVersion as SupportedCairoVersion, _SupportedRpcVersion as SupportedRpcVersion, type constants_SupportedRpcVersion0_10 as SupportedRpcVersion0_10, type constants_SupportedTransactionVersion as SupportedTransactionVersion, constants_TEXT_TO_FELT_MAX_LEN as TEXT_TO_FELT_MAX_LEN, _TransactionHashPrefix as TransactionHashPrefix, constants_UDC as UDC, constants_ZERO as ZERO };
5382
+ export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, _BaseUrl as BaseUrl, type constants_ChannelDefaultOptions as ChannelDefaultOptions, type constants_ChannelDefaults as ChannelDefaults, type constants_ChannelMethodOptions as ChannelMethodOptions, constants_DEFAULT_GLOBAL_CONFIG as DEFAULT_GLOBAL_CONFIG, constants_HARDENING_4BYTES as HARDENING_4BYTES, constants_HARDENING_BYTE as HARDENING_BYTE, constants_IS_BROWSER as IS_BROWSER, constants_LegacyUDC as LegacyUDC, constants_MASK_250 as MASK_250, constants_MASK_31 as MASK_31, constants_MAX_STORAGE_ITEM_SIZE as MAX_STORAGE_ITEM_SIZE, _NetworkName as NetworkName, constants_OutsideExecutionCallerAny as OutsideExecutionCallerAny, constants_PAYMASTER_RPC_NODES as PAYMASTER_RPC_NODES, constants_PRIME as PRIME, constants_RANGE_ETH_ADDRESS as RANGE_ETH_ADDRESS, constants_RANGE_FELT as RANGE_FELT, constants_RANGE_I128 as RANGE_I128, constants_RANGE_I16 as RANGE_I16, constants_RANGE_I32 as RANGE_I32, constants_RANGE_I64 as RANGE_I64, constants_RANGE_I8 as RANGE_I8, constants_RANGE_U128 as RANGE_U128, constants_RANGE_U16 as RANGE_U16, constants_RANGE_U32 as RANGE_U32, constants_RANGE_U64 as RANGE_U64, constants_RANGE_U8 as RANGE_U8, constants_RANGE_U96 as RANGE_U96, constants_RPC_DEFAULT_NODES as RPC_DEFAULT_NODES, constants_SNIP9_V1_INTERFACE_ID as SNIP9_V1_INTERFACE_ID, constants_SNIP9_V2_INTERFACE_ID as SNIP9_V2_INTERFACE_ID, constants_SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS as SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS, constants_SYSTEM_MESSAGES as SYSTEM_MESSAGES, _StarknetChainId as StarknetChainId, type constants_SupportedCairoVersion as SupportedCairoVersion, _SupportedRpcVersion as SupportedRpcVersion, type constants_SupportedRpcVersion0_10 as SupportedRpcVersion0_10, type constants_SupportedTransactionVersion as SupportedTransactionVersion, constants_TEXT_TO_FELT_MAX_LEN as TEXT_TO_FELT_MAX_LEN, _TransactionHashPrefix as TransactionHashPrefix, constants_UDC as UDC, constants_ZERO as ZERO };
5343
5383
  }
5344
5384
 
5345
5385
  /** What a {@link SubscriptionChannel} needs: a socket to borrow, and how much to buffer. */
@@ -10581,24 +10621,6 @@ declare class CairoFelt252 {
10581
10621
  static factoryFromApiResponse(responseIterator: Iterator<string>): CairoFelt252;
10582
10622
  }
10583
10623
 
10584
- declare class CairoUint32 {
10585
- data: bigint;
10586
- static abiSelector: string;
10587
- constructor(data: BigNumberish);
10588
- static __processData(data: BigNumberish): bigint;
10589
- toApiRequest(): string[];
10590
- toBigInt(): bigint;
10591
- decodeUtf8(): string;
10592
- toHexString(): string;
10593
- static validate(data: BigNumberish): void;
10594
- static is(data: BigNumberish): boolean;
10595
- /**
10596
- * Check if provided abi type is this data type
10597
- */
10598
- static isAbiType(abiType: string): boolean;
10599
- static factoryFromApiResponse(responseIterator: Iterator<string>): CairoUint32;
10600
- }
10601
-
10602
10624
  /**
10603
10625
  * A Cairo `core::byte_array::ByteArray` : an arbitrary sequence of bytes, cut into words of 31.
10604
10626
  *
@@ -11340,8 +11362,23 @@ declare class CallData {
11340
11362
  compile(method: string, argsCalldata: RawArgs): Calldata;
11341
11363
  /**
11342
11364
  * Compile contract callData without abi
11365
+ *
11366
+ * An instance of a Cairo type class — `CairoByteArray`, `CairoBytes31`, `CairoUint256`, … — is
11367
+ * serialized by that class, so it yields the same felts here as it would through an abi. Any
11368
+ * other object is walked field by field, which is what makes a plain `{ low, high }` and the
11369
+ * object of `byteArrayFromString` work just as well.
11370
+ *
11371
+ * A `string[]` value is always read as a Cairo array and gains a length in front of it, an
11372
+ * already compiled one included : pass the instance itself rather than its `toApiRequest()`.
11343
11373
  * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data
11344
11374
  * @returns Calldata
11375
+ * @example
11376
+ * ```typescript
11377
+ * const result = CallData.compile({ text: CairoByteArray.fromText('12345') });
11378
+ * // result = ["0", "211295614005", "5"]
11379
+ * const result2 = CallData.compile({ text: CairoByteArray.fromText('12345').toApiRequest() });
11380
+ * // result2 = ["3", "0", "211295614005", "5"] the three felts, behind an array length
11381
+ * ```
11345
11382
  */
11346
11383
  static compile(rawArgs: RawArgs): Calldata;
11347
11384
  /**