starknet 11.0.0-beta.6 → 11.0.0-beta.8

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,25 @@
1
+ # [11.0.0-beta.8](https://github.com/starknet-io/starknet.js/compare/v11.0.0-beta.7...v11.0.0-beta.8) (2026-08-27)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **starknetId:** accept bigAlphabet characters in isStarkDomain ([f508984](https://github.com/starknet-io/starknet.js/commit/f5089848f4b4bf526cc814f20fef1918bc67879f)), closes [#1668](https://github.com/starknet-io/starknet.js/issues/1668)
6
+ - **starknetId:** reject names the encoder cannot represent ([76fe9b1](https://github.com/starknet-io/starknet.js/commit/76fe9b1df174d295374417a018e425ee652258c8)), closes [#1668](https://github.com/starknet-io/starknet.js/issues/1668)
7
+
8
+ ### BREAKING CHANGES
9
+
10
+ - **starknetId:** `useEncoded` throws on any character outside the Starknet.id alphabets
11
+ instead of silently ignoring it, and `encodeBrotherDomain`, which calls it with no guard,
12
+ throws on the same input. `isStarkDomain` also rejects labels whose encoding overflows the
13
+ field, including every 48-character label it used to accept.
14
+
15
+ # [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)
16
+
17
+ ### Bug Fixes
18
+
19
+ - **calldata:** a Cairo type serializes itself, abi or not ([c0943fb](https://github.com/starknet-io/starknet.js/commit/c0943fb173ab7e914ae213865c8cf7cf78898746))
20
+ - **calldata:** an abi slot accepts the Cairo type it declares ([b9fa576](https://github.com/starknet-io/starknet.js/commit/b9fa5769aba339a27a989d249d4adef1b04f79a8))
21
+ - **calldata:** out-of-range arguments refused, negative results come back negative ([41bf052](https://github.com/starknet-io/starknet.js/commit/41bf052f11a66d9b72e8db2a964b86c8161546b1))
22
+
1
23
  # [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
24
 
3
25
  ### 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. */
@@ -9361,14 +9401,22 @@ declare namespace typedData {
9361
9401
  */
9362
9402
  declare function useDecoded(encoded: bigint[]): string;
9363
9403
  /**
9364
- * Encodes a string into a bigint value.
9404
+ * Encodes a single Starknet.id label into a bigint value.
9405
+ *
9406
+ * Only the characters of the Starknet.id alphabets are accepted: `a-z`, `0-9`, `-` and the two
9407
+ * `bigAlphabet` characters. Any other character throws, so a mistyped name can never be silently
9408
+ * encoded as a different, existing one.
9365
9409
  *
9366
- * @param {string} decoded The string to be encoded.
9410
+ * @param {string} decoded The label to be encoded, without any `.` separator nor `.stark` suffix.
9367
9411
  * @returns {bigint} The encoded bigint value.
9412
+ * @throws {Error} If the label holds a character outside the Starknet.id alphabets.
9368
9413
  * @example
9369
9414
  * ```typescript
9370
- * const result = starknetId.useEncoded("starknet.js");
9415
+ * const result = starknetId.useEncoded("starknetjs");
9371
9416
  * // result = 3015206943634620n
9417
+ *
9418
+ * starknetId.useEncoded("Starknetjs");
9419
+ * // throws an Error: the uppercase "S" is not a Starknet.id character
9372
9420
  * ```
9373
9421
  */
9374
9422
  declare function useEncoded(decoded: string): bigint;
@@ -10581,24 +10629,6 @@ declare class CairoFelt252 {
10581
10629
  static factoryFromApiResponse(responseIterator: Iterator<string>): CairoFelt252;
10582
10630
  }
10583
10631
 
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
10632
  /**
10603
10633
  * A Cairo `core::byte_array::ByteArray` : an arbitrary sequence of bytes, cut into words of 31.
10604
10634
  *
@@ -11340,8 +11370,23 @@ declare class CallData {
11340
11370
  compile(method: string, argsCalldata: RawArgs): Calldata;
11341
11371
  /**
11342
11372
  * Compile contract callData without abi
11373
+ *
11374
+ * An instance of a Cairo type class — `CairoByteArray`, `CairoBytes31`, `CairoUint256`, … — is
11375
+ * serialized by that class, so it yields the same felts here as it would through an abi. Any
11376
+ * other object is walked field by field, which is what makes a plain `{ low, high }` and the
11377
+ * object of `byteArrayFromString` work just as well.
11378
+ *
11379
+ * A `string[]` value is always read as a Cairo array and gains a length in front of it, an
11380
+ * already compiled one included : pass the instance itself rather than its `toApiRequest()`.
11343
11381
  * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data
11344
11382
  * @returns Calldata
11383
+ * @example
11384
+ * ```typescript
11385
+ * const result = CallData.compile({ text: CairoByteArray.fromText('12345') });
11386
+ * // result = ["0", "211295614005", "5"]
11387
+ * const result2 = CallData.compile({ text: CairoByteArray.fromText('12345').toApiRequest() });
11388
+ * // result2 = ["3", "0", "211295614005", "5"] the three felts, behind an array length
11389
+ * ```
11345
11390
  */
11346
11391
  static compile(rawArgs: RawArgs): Calldata;
11347
11392
  /**