starknet 11.6.3 → 11.7.1

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/dist/index.js CHANGED
@@ -115,11 +115,12 @@ __export(index_exports, {
115
115
  RPC0102: () => v0_10_2_exports,
116
116
  RPC0103: () => v0_10_3_exports,
117
117
  RPC0104: () => v0_10_4_exports,
118
+ RPC0105: () => v0_10_5_exports,
118
119
  RPC09: () => v0_9_exports,
119
120
  RPCResponseParser: () => RPCResponseParser,
120
121
  ReconnectingWsTransport: () => ReconnectingWsTransport,
121
122
  ResponseParser: () => ResponseParser,
122
- RpcChannel: () => RpcChannel4,
123
+ RpcChannel: () => RpcChannel5,
123
124
  RpcError: () => RpcError,
124
125
  RpcProvider: () => RpcProvider,
125
126
  SECP256K1_POINT_MAX: () => SECP256K1_POINT_MAX,
@@ -283,8 +284,8 @@ __export(constants_exports, {
283
284
  var api_exports = {};
284
285
  __export(api_exports, {
285
286
  JRPC: () => jsonrpc_exports,
286
- PAYMASTER_API: () => import_starknet_types_0104.PAYMASTER_API,
287
- RPCSPEC0104: () => RPCSPEC0104,
287
+ PAYMASTER_API: () => import_starknet_types_0105.PAYMASTER_API,
288
+ RPCSPEC0105: () => RPCSPEC0105,
288
289
  RPCSPEC09: () => RPCSPEC09
289
290
  });
290
291
 
@@ -293,12 +294,12 @@ var jsonrpc_exports = {};
293
294
 
294
295
  // src/types/api/index.ts
295
296
  var RPCSPEC09 = __toESM(require("@starknet-io/starknet-types-09"));
296
- var RPCSPEC0104 = __toESM(require("@starknet-io/starknet-types-0104"));
297
- var import_starknet_types_0104 = require("@starknet-io/starknet-types-0104");
297
+ var RPCSPEC0105 = __toESM(require("@starknet-io/starknet-types-0105"));
298
+ var import_starknet_types_0105 = require("@starknet-io/starknet-types-0105");
298
299
 
299
300
  // src/types/api/rpc.ts
300
301
  var rpc_exports = {};
301
- __reExport(rpc_exports, require("@starknet-io/starknet-types-0104"));
302
+ __reExport(rpc_exports, require("@starknet-io/starknet-types-0105"));
302
303
 
303
304
  // src/types/api/index.ts
304
305
  __reExport(api_exports, rpc_exports);
@@ -306,19 +307,19 @@ __reExport(api_exports, rpc_exports);
306
307
  // src/provider/types/spec.type.ts
307
308
  var { ETransactionVersion } = RPCSPEC09;
308
309
  var { ETransactionVersion3 } = RPCSPEC09;
309
- var { EDataAvailabilityMode } = RPCSPEC0104;
310
- var { EDAMode } = RPCSPEC0104;
310
+ var { EDataAvailabilityMode } = RPCSPEC0105;
311
+ var { EDAMode } = RPCSPEC0105;
311
312
  function isRPC08Plus_ResourceBounds(entry) {
312
313
  return "l1_data_gas" in entry;
313
314
  }
314
315
  function isRPC08Plus_ResourceBoundsBN(entry) {
315
316
  return "l1_data_gas" in entry;
316
317
  }
317
- var { ETxnResponseFlag } = RPCSPEC0104;
318
- var { ETraceFlag } = RPCSPEC0104;
319
- var { ESubscriptionTag } = RPCSPEC0104;
320
- var { ETransactionStatus } = RPCSPEC0104;
321
- var { ETransactionExecutionStatus } = RPCSPEC0104;
318
+ var { ETxnResponseFlag } = RPCSPEC0105;
319
+ var { ETraceFlag } = RPCSPEC0105;
320
+ var { ESubscriptionTag } = RPCSPEC0105;
321
+ var { ETransactionStatus } = RPCSPEC0105;
322
+ var { ETransactionExecutionStatus } = RPCSPEC0105;
322
323
  var { ETransactionType: TransactionType } = RPCSPEC09;
323
324
  var { EBlockStatus: BlockStatus } = RPCSPEC09;
324
325
  var { ETransactionFinalityStatus: TransactionFinalityStatus } = RPCSPEC09;
@@ -533,11 +534,13 @@ var _SupportedRpcVersion = {
533
534
  "0.10.2": "0.10.2",
534
535
  "0.10.3": "0.10.3",
535
536
  "0.10.4": "0.10.4",
537
+ "0.10.5": "0.10.5",
536
538
  v0_9_0: "0.9.0",
537
539
  v0_10_0: "0.10.0",
538
540
  v0_10_2: "0.10.2",
539
541
  v0_10_3: "0.10.3",
540
- v0_10_4: "0.10.4"
542
+ v0_10_4: "0.10.4",
543
+ v0_10_5: "0.10.5"
541
544
  };
542
545
  var DEFAULT_GLOBAL_CONFIG = {
543
546
  rpcVersion: "0.10.0",
@@ -15349,6 +15352,25 @@ var SubscriptionChannel4 = class extends SubscriptionChannel {
15349
15352
  channelSpecVersion = _SupportedRpcVersion.v0_10_4;
15350
15353
  };
15351
15354
 
15355
+ // src/channel/v0_10_5/index.ts
15356
+ var v0_10_5_exports = {};
15357
+ __export(v0_10_5_exports, {
15358
+ RpcChannel: () => RpcChannel5,
15359
+ SubscriptionChannel: () => SubscriptionChannel5
15360
+ });
15361
+
15362
+ // src/channel/rpc_0_10_5.ts
15363
+ var RpcChannel5 = class extends RpcChannel4 {
15364
+ id = "RPC0.10.5";
15365
+ channelSpecVersion = _SupportedRpcVersion.v0_10_5;
15366
+ };
15367
+
15368
+ // src/channel/v0_10_5/index.ts
15369
+ var SubscriptionChannel5 = class extends SubscriptionChannel {
15370
+ id = "RPC0.10.5-subscriptions";
15371
+ channelSpecVersion = _SupportedRpcVersion.v0_10_5;
15372
+ };
15373
+
15352
15374
  // src/channel/ws/ws_0_10.ts
15353
15375
  var WebSocketChannel = class {
15354
15376
  /**
@@ -17981,12 +18003,12 @@ var RpcProvider = class {
17981
18003
  if (isVersion("0.9", options.specVersion)) {
17982
18004
  this.channel = new v0_9_exports.RpcChannel({ ...options, waitMode: false });
17983
18005
  } else if (isVersion("0.10", options.specVersion)) {
17984
- this.channel = new v0_10_4_exports.RpcChannel({ ...options, waitMode: false });
18006
+ this.channel = new v0_10_5_exports.RpcChannel({ ...options, waitMode: false });
17985
18007
  } else throw new Error(`unsupported channel for spec version: ${options.specVersion}`);
17986
18008
  } else if (isVersion("0.9", config.get("rpcVersion"))) {
17987
18009
  this.channel = new v0_9_exports.RpcChannel({ ...options, waitMode: false });
17988
18010
  } else if (isVersion("0.10", config.get("rpcVersion"))) {
17989
- this.channel = new v0_10_4_exports.RpcChannel({ ...options, waitMode: false });
18011
+ this.channel = new v0_10_5_exports.RpcChannel({ ...options, waitMode: false });
17990
18012
  } else throw new Error("unable to define spec version for channel");
17991
18013
  this.responseParser = new RPCResponseParser(options?.resourceBoundsOverhead);
17992
18014
  const plugins = options?.plugins === false ? [] : options?.plugins ?? defaultPlugins;
@@ -18499,7 +18521,7 @@ var WebSocketProvider = class _WebSocketProvider extends RpcProvider {
18499
18521
  const channelOptions = { transport, maxBufferSize: options.maxBufferSize };
18500
18522
  const forVersion = (specVersion) => {
18501
18523
  if (isVersion("0.9", specVersion)) return new v0_9_exports.SubscriptionChannel(channelOptions);
18502
- if (isVersion("0.10", specVersion)) return new v0_10_4_exports.SubscriptionChannel(channelOptions);
18524
+ if (isVersion("0.10", specVersion)) return new v0_10_5_exports.SubscriptionChannel(channelOptions);
18503
18525
  throw new LibraryError(`unsupported subscription channel for spec version: ${specVersion}`);
18504
18526
  };
18505
18527
  if (options.specVersion) return forVersion(options.specVersion);
@@ -18531,7 +18553,7 @@ var WebSocketProvider = class _WebSocketProvider extends RpcProvider {
18531
18553
  return new this({ ...options, transport, specVersion: _SupportedRpcVersion.v0_9_0 });
18532
18554
  }
18533
18555
  if (isVersion("0.10", spec)) {
18534
- return new this({ ...options, transport, specVersion: _SupportedRpcVersion.v0_10_4 });
18556
+ return new this({ ...options, transport, specVersion: _SupportedRpcVersion.v0_10_5 });
18535
18557
  }
18536
18558
  throw new LibraryError(
18537
18559
  `Provided RPC node specification version ${spec} is not compatible with the SDK. SDK supported RPC versions ${Object.keys(_SupportedRpcVersion).toString()}`
@@ -21280,8 +21302,10 @@ var WalletAccountV6 = class _WalletAccountV6 extends WalletAccountV5 {
21280
21302
  }
21281
21303
  /**
21282
21304
  * Submit STRK20 actions as a single atomic transaction. The wallet displays an approval
21283
- * UI, generates the SNIP-36 proof, adds the fee action, and submits — so this call may
21284
- * take significantly longer than a standard invoke.
21305
+ * UI, generates the SNIP-36 proof, adds the fee action (except for a `register` action),
21306
+ * and submits — so this call may take significantly longer than a standard invoke.
21307
+ * The account must be registered in the pool first, else the wallet answers `NOT_REGISTERED`:
21308
+ * send `[{ type: 'register' }]` once, alone in its request.
21285
21309
  * @param {STRK20_ACTION[]} actions - The STRK20 actions to perform atomically (min 1).
21286
21310
  * @returns {Promise<{transaction_hash: string}>} The hash of the submitted transaction.
21287
21311
  * @example
@@ -21998,8 +22022,11 @@ function units(amount, simbol = "fri") {
21998
22022
  }
21999
22023
  }
22000
22024
  const [integer, decimal = "0"] = numStr.split(".");
22025
+ if (decimal.length > 18) {
22026
+ throw new Error(`units: '${numStr}' strk has more than 18 decimals`);
22027
+ }
22001
22028
  const pdec = decimal.padEnd(18, "0");
22002
- return `${integer}${pdec}`.replace(/\b0+/g, "");
22029
+ return `${integer}${pdec}`.replace(/\b0+(?=\d)/g, "");
22003
22030
  }
22004
22031
  const bis = BigInt(amount).toString();
22005
22032
  let strk;
@@ -22096,6 +22123,7 @@ function units(amount, simbol = "fri") {
22096
22123
  RPC0102,
22097
22124
  RPC0103,
22098
22125
  RPC0104,
22126
+ RPC0105,
22099
22127
  RPC09,
22100
22128
  RPCResponseParser,
22101
22129
  ReconnectingWsTransport,