starknet 11.0.0-beta.7 → 11.0.0-beta.9

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,30 @@
1
+ # [11.0.0-beta.9](https://github.com/starknet-io/starknet.js/compare/v11.0.0-beta.8...v11.0.0-beta.9) (2026-08-31)
2
+
3
+ ### Features
4
+
5
+ - **constants:** remove the feeder gateway BaseUrl constant ([c455e2a](https://github.com/starknet-io/starknet.js/commit/c455e2a7410817135729f652a8bd46aa45b9cec6))
6
+
7
+ ### BREAKING CHANGES
8
+
9
+ - **constants:** `constants.BaseUrl` is removed. It exposed the feeder
10
+ gateway roots, whose endpoints Starknet v0.14.4 deletes; the library has
11
+ been JSON-RPC only since v7 and never read it. Use `constants.NetworkName`
12
+ with `provider.getDefaultNodeUrl()`, or your own node's RPC url.
13
+
14
+ # [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)
15
+
16
+ ### Bug Fixes
17
+
18
+ - **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)
19
+ - **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)
20
+
21
+ ### BREAKING CHANGES
22
+
23
+ - **starknetId:** `useEncoded` throws on any character outside the Starknet.id alphabets
24
+ instead of silently ignoring it, and `encodeBrotherDomain`, which calls it with no guard,
25
+ throws on the same input. `isStarkDomain` also rejects labels whose encoding overflows the
26
+ field, including every 48-character label it used to accept.
27
+
1
28
  # [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
29
 
3
30
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -5223,12 +5223,6 @@ declare const SNIP9_V1_INTERFACE_ID = "0x68cfd18b92d1907b8ba3cc324900277f5a36220
5223
5223
  declare const SNIP9_V2_INTERFACE_ID = "0x1d1144bb2138366ff28d8e9ab57456b1d332ac42196230c3a602003c89872";
5224
5224
  declare const HARDENING_BYTE = 128;
5225
5225
  declare const HARDENING_4BYTES = 2147483648n;
5226
- declare const _BaseUrl: {
5227
- readonly SN_MAIN: "https://alpha-mainnet.starknet.io";
5228
- readonly SN_SEPOLIA: "https://alpha-sepolia.starknet.io";
5229
- };
5230
- type _BaseUrl = ValuesType<typeof _BaseUrl>;
5231
-
5232
5226
  declare const _NetworkName: {
5233
5227
  readonly SN_MAIN: "SN_MAIN";
5234
5228
  readonly SN_SEPOLIA: "SN_SEPOLIA";
@@ -5379,7 +5373,7 @@ declare const constants_TEXT_TO_FELT_MAX_LEN: typeof TEXT_TO_FELT_MAX_LEN;
5379
5373
  declare const constants_UDC: typeof UDC;
5380
5374
  declare const constants_ZERO: typeof ZERO;
5381
5375
  declare namespace constants {
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 };
5376
+ export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, 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 };
5383
5377
  }
5384
5378
 
5385
5379
  /** What a {@link SubscriptionChannel} needs: a socket to borrow, and how much to buffer. */
@@ -9401,14 +9395,22 @@ declare namespace typedData {
9401
9395
  */
9402
9396
  declare function useDecoded(encoded: bigint[]): string;
9403
9397
  /**
9404
- * Encodes a string into a bigint value.
9398
+ * Encodes a single Starknet.id label into a bigint value.
9405
9399
  *
9406
- * @param {string} decoded The string to be encoded.
9400
+ * Only the characters of the Starknet.id alphabets are accepted: `a-z`, `0-9`, `-` and the two
9401
+ * `bigAlphabet` characters. Any other character throws, so a mistyped name can never be silently
9402
+ * encoded as a different, existing one.
9403
+ *
9404
+ * @param {string} decoded The label to be encoded, without any `.` separator nor `.stark` suffix.
9407
9405
  * @returns {bigint} The encoded bigint value.
9406
+ * @throws {Error} If the label holds a character outside the Starknet.id alphabets.
9408
9407
  * @example
9409
9408
  * ```typescript
9410
- * const result = starknetId.useEncoded("starknet.js");
9409
+ * const result = starknetId.useEncoded("starknetjs");
9411
9410
  * // result = 3015206943634620n
9411
+ *
9412
+ * starknetId.useEncoded("Starknetjs");
9413
+ * // throws an Error: the uppercase "S" is not a Starknet.id character
9412
9414
  * ```
9413
9415
  */
9414
9416
  declare function useEncoded(decoded: string): bigint;
@@ -226,7 +226,6 @@ var starknet = (() => {
226
226
  __export(constants_exports, {
227
227
  ADDR_BOUND: () => ADDR_BOUND,
228
228
  API_VERSION: () => API_VERSION,
229
- BaseUrl: () => _BaseUrl,
230
229
  DEFAULT_GLOBAL_CONFIG: () => DEFAULT_GLOBAL_CONFIG,
231
230
  HARDENING_4BYTES: () => HARDENING_4BYTES,
232
231
  HARDENING_BYTE: () => HARDENING_BYTE,
@@ -1235,10 +1234,6 @@ var starknet = (() => {
1235
1234
  var SNIP9_V2_INTERFACE_ID = "0x1d1144bb2138366ff28d8e9ab57456b1d332ac42196230c3a602003c89872";
1236
1235
  var HARDENING_BYTE = 128;
1237
1236
  var HARDENING_4BYTES = 2147483648n;
1238
- var _BaseUrl = {
1239
- SN_MAIN: "https://alpha-mainnet.starknet.io",
1240
- SN_SEPOLIA: "https://alpha-sepolia.starknet.io"
1241
- };
1242
1237
  var _NetworkName = {
1243
1238
  SN_MAIN: "SN_MAIN",
1244
1239
  SN_SEPOLIA: "SN_SEPOLIA"
@@ -15800,6 +15795,10 @@ ${indent}}` : "}";
15800
15795
  const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char);
15801
15796
  encoded += multiplier * BigInt(newid);
15802
15797
  multiplier *= bigAlphabetSize;
15798
+ } else {
15799
+ throw new Error(
15800
+ `Invalid character "${char}" in a Starknet.id name: allowed characters are "${basicAlphabet}" and "${bigAlphabet}"`
15801
+ );
15803
15802
  }
15804
15803
  }
15805
15804
  return encoded;
@@ -15919,9 +15918,14 @@ ${indent}}` : "}";
15919
15918
  return false;
15920
15919
  }
15921
15920
  return name.split(".").every((label) => {
15922
- return label.length > 0 && label.length <= 48 && [...label].every((char) => {
15923
- return char >= "a" && char <= "z" || char >= "0" && char <= "9" || char === "-";
15924
- });
15921
+ if (label.length === 0 || label.length > 48) {
15922
+ return false;
15923
+ }
15924
+ try {
15925
+ return useEncoded(label) < PRIME;
15926
+ } catch {
15927
+ return false;
15928
+ }
15925
15929
  });
15926
15930
  }
15927
15931