starknet 10.7.5 → 10.8.0

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.mjs CHANGED
@@ -70,7 +70,7 @@ var api_exports = {};
70
70
  __export(api_exports, {
71
71
  JRPC: () => jsonrpc_exports,
72
72
  PAYMASTER_API: () => PAYMASTER_API,
73
- RPCSPEC0103: () => RPCSPEC0103,
73
+ RPCSPEC0104: () => RPCSPEC0104,
74
74
  RPCSPEC09: () => RPCSPEC09
75
75
  });
76
76
 
@@ -79,13 +79,13 @@ var jsonrpc_exports = {};
79
79
 
80
80
  // src/types/api/index.ts
81
81
  import * as RPCSPEC09 from "@starknet-io/starknet-types-09";
82
- import * as RPCSPEC0103 from "@starknet-io/starknet-types-0103";
83
- import { PAYMASTER_API } from "@starknet-io/starknet-types-0103";
82
+ import * as RPCSPEC0104 from "@starknet-io/starknet-types-0104";
83
+ import { PAYMASTER_API } from "@starknet-io/starknet-types-0104";
84
84
 
85
85
  // src/types/api/rpc.ts
86
86
  var rpc_exports = {};
87
- __reExport(rpc_exports, starknet_types_0103_star);
88
- import * as starknet_types_0103_star from "@starknet-io/starknet-types-0103";
87
+ __reExport(rpc_exports, starknet_types_0104_star);
88
+ import * as starknet_types_0104_star from "@starknet-io/starknet-types-0104";
89
89
 
90
90
  // src/types/api/index.ts
91
91
  __reExport(api_exports, rpc_exports);
@@ -94,19 +94,19 @@ __reExport(api_exports, rpc_exports);
94
94
  var { ETransactionVersion } = RPCSPEC09;
95
95
  var { ETransactionVersion2 } = RPCSPEC09;
96
96
  var { ETransactionVersion3 } = RPCSPEC09;
97
- var { EDataAvailabilityMode } = RPCSPEC0103;
98
- var { EDAMode } = RPCSPEC0103;
97
+ var { EDataAvailabilityMode } = RPCSPEC0104;
98
+ var { EDAMode } = RPCSPEC0104;
99
99
  function isRPC08Plus_ResourceBounds(entry) {
100
100
  return "l1_data_gas" in entry;
101
101
  }
102
102
  function isRPC08Plus_ResourceBoundsBN(entry) {
103
103
  return "l1_data_gas" in entry;
104
104
  }
105
- var { ETxnResponseFlag } = RPCSPEC0103;
106
- var { ETraceFlag } = RPCSPEC0103;
107
- var { ESubscriptionTag } = RPCSPEC0103;
108
- var { ETransactionStatus } = RPCSPEC0103;
109
- var { ETransactionExecutionStatus } = RPCSPEC0103;
105
+ var { ETxnResponseFlag } = RPCSPEC0104;
106
+ var { ETraceFlag } = RPCSPEC0104;
107
+ var { ESubscriptionTag } = RPCSPEC0104;
108
+ var { ETransactionStatus } = RPCSPEC0104;
109
+ var { ETransactionExecutionStatus } = RPCSPEC0104;
110
110
  var { ETransactionType: TransactionType } = RPCSPEC09;
111
111
  var { EBlockStatus: BlockStatus } = RPCSPEC09;
112
112
  var { ETransactionFinalityStatus: TransactionFinalityStatus } = RPCSPEC09;
@@ -322,10 +322,12 @@ var _SupportedRpcVersion = {
322
322
  "0.10.0": "0.10.0",
323
323
  "0.10.2": "0.10.2",
324
324
  "0.10.3": "0.10.3",
325
+ "0.10.4": "0.10.4",
325
326
  v0_9_0: "0.9.0",
326
327
  v0_10_0: "0.10.0",
327
328
  v0_10_2: "0.10.2",
328
- v0_10_3: "0.10.3"
329
+ v0_10_3: "0.10.3",
330
+ v0_10_4: "0.10.4"
329
331
  };
330
332
  var DEFAULT_GLOBAL_CONFIG = {
331
333
  rpcVersion: "0.10.0",
@@ -508,14 +510,16 @@ var Logger = class _Logger {
508
510
  }
509
511
  formatMessage(logMessage) {
510
512
  const { level, message, timestamp, data } = logMessage;
511
- let formattedMessage = `[${timestamp}] ${level}: ${message}`;
513
+ const sanitizedMessage = String(message).replace(/[\r\n]/g, "");
514
+ let formattedMessage = `[${timestamp}] ${level}: ${sanitizedMessage}`;
512
515
  if (data) {
513
516
  try {
514
517
  formattedMessage += `
515
518
  ${JSON.stringify(data, null, 2)}`;
516
519
  } catch (error) {
520
+ const sanitizedError = String(error).replace(/[\r\n]/g, "");
517
521
  formattedMessage += `
518
- [JSON.stringify Error/Circular]: ${error}`;
522
+ [JSON.stringify Error/Circular]: ${sanitizedError}`;
519
523
  }
520
524
  }
521
525
  return formattedMessage;
@@ -7236,6 +7240,16 @@ var RpcChannel3 = class extends RpcChannel2 {
7236
7240
  channelSpecVersion = _SupportedRpcVersion.v0_10_3;
7237
7241
  };
7238
7242
 
7243
+ // src/channel/rpc_0_10_4.ts
7244
+ var rpc_0_10_4_exports = {};
7245
+ __export(rpc_0_10_4_exports, {
7246
+ RpcChannel: () => RpcChannel4
7247
+ });
7248
+ var RpcChannel4 = class extends RpcChannel3 {
7249
+ id = "RPC0.10.4";
7250
+ channelSpecVersion = _SupportedRpcVersion.v0_10_4;
7251
+ };
7252
+
7239
7253
  // src/utils/eventEmitter.ts
7240
7254
  var EventEmitter = class {
7241
7255
  listeners = {};
@@ -9693,12 +9707,12 @@ var RpcProvider = class {
9693
9707
  if (isVersion("0.9", options.specVersion)) {
9694
9708
  this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
9695
9709
  } else if (isVersion("0.10", options.specVersion)) {
9696
- this.channel = new rpc_0_10_3_exports.RpcChannel({ ...options, waitMode: false });
9710
+ this.channel = new rpc_0_10_4_exports.RpcChannel({ ...options, waitMode: false });
9697
9711
  } else throw new Error(`unsupported channel for spec version: ${options.specVersion}`);
9698
9712
  } else if (isVersion("0.9", config.get("rpcVersion"))) {
9699
9713
  this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
9700
9714
  } else if (isVersion("0.10", config.get("rpcVersion"))) {
9701
- this.channel = new rpc_0_10_3_exports.RpcChannel({ ...options, waitMode: false });
9715
+ this.channel = new rpc_0_10_4_exports.RpcChannel({ ...options, waitMode: false });
9702
9716
  } else throw new Error("unable to define spec version for channel");
9703
9717
  this.responseParser = new RPCResponseParser(options?.resourceBoundsOverhead);
9704
9718
  const plugins = options?.plugins === false ? [] : options?.plugins ?? defaultPlugins;
@@ -9722,13 +9736,14 @@ var RpcProvider = class {
9722
9736
  if (isVersion("0.9", specVersion)) {
9723
9737
  return new this({
9724
9738
  ...optionsOrProvider,
9725
- specVersion: _SupportedRpcVersion.v0_9_0
9739
+ specVersion
9726
9740
  });
9727
9741
  }
9728
9742
  if (isVersion("0.10", specVersion)) {
9729
9743
  return new this({
9730
9744
  ...optionsOrProvider,
9731
- specVersion: _SupportedRpcVersion.v0_10_3
9745
+ // forward the version the node reports, not the newest revision the SDK implements
9746
+ specVersion
9732
9747
  });
9733
9748
  }
9734
9749
  throw new LibraryError(
@@ -11172,7 +11187,7 @@ var LedgerSigner231 = class extends LedgerSigner221 {
11172
11187
  encodeCall(call) {
11173
11188
  const toBuf = this.convertBnToLedger(call.contractAddress);
11174
11189
  const selectorBuf = hexToBytes(addAddressPadding(getSelector(call.entrypoint)));
11175
- let calldataBuf = new Uint8Array([]);
11190
+ let calldataBuf;
11176
11191
  if (call.calldata) {
11177
11192
  const compiledCalldata = CallData.compile(call.calldata);
11178
11193
  const calldataSizeBuf = this.convertBnToLedger(compiledCalldata.length);
@@ -13919,11 +13934,12 @@ export {
13919
13934
  api_exports as RPC,
13920
13935
  rpc_0_10_2_exports as RPC0102,
13921
13936
  rpc_0_10_3_exports as RPC0103,
13937
+ rpc_0_10_4_exports as RPC0104,
13922
13938
  rpc_0_9_0_exports as RPC09,
13923
13939
  RPCResponseParser,
13924
13940
  ReceiptTx,
13925
13941
  ResponseParser,
13926
- RpcChannel3 as RpcChannel,
13942
+ RpcChannel4 as RpcChannel,
13927
13943
  RpcError,
13928
13944
  RpcProvider,
13929
13945
  Signer,