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/CHANGELOG.md +17 -0
- package/dist/index.d.ts +111 -103
- package/dist/index.global.js +38 -33
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +38 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -101,11 +101,12 @@ __export(index_exports, {
|
|
|
101
101
|
RPC: () => api_exports,
|
|
102
102
|
RPC0102: () => rpc_0_10_2_exports,
|
|
103
103
|
RPC0103: () => rpc_0_10_3_exports,
|
|
104
|
+
RPC0104: () => rpc_0_10_4_exports,
|
|
104
105
|
RPC09: () => rpc_0_9_0_exports,
|
|
105
106
|
RPCResponseParser: () => RPCResponseParser,
|
|
106
107
|
ReceiptTx: () => ReceiptTx,
|
|
107
108
|
ResponseParser: () => ResponseParser,
|
|
108
|
-
RpcChannel: () =>
|
|
109
|
+
RpcChannel: () => RpcChannel4,
|
|
109
110
|
RpcError: () => RpcError,
|
|
110
111
|
RpcProvider: () => RpcProvider,
|
|
111
112
|
Signer: () => Signer,
|
|
@@ -255,8 +256,8 @@ __export(constants_exports, {
|
|
|
255
256
|
var api_exports = {};
|
|
256
257
|
__export(api_exports, {
|
|
257
258
|
JRPC: () => jsonrpc_exports,
|
|
258
|
-
PAYMASTER_API: () =>
|
|
259
|
-
|
|
259
|
+
PAYMASTER_API: () => import_starknet_types_0104.PAYMASTER_API,
|
|
260
|
+
RPCSPEC0104: () => RPCSPEC0104,
|
|
260
261
|
RPCSPEC09: () => RPCSPEC09
|
|
261
262
|
});
|
|
262
263
|
|
|
@@ -265,12 +266,12 @@ var jsonrpc_exports = {};
|
|
|
265
266
|
|
|
266
267
|
// src/types/api/index.ts
|
|
267
268
|
var RPCSPEC09 = __toESM(require("@starknet-io/starknet-types-09"));
|
|
268
|
-
var
|
|
269
|
-
var
|
|
269
|
+
var RPCSPEC0104 = __toESM(require("@starknet-io/starknet-types-0104"));
|
|
270
|
+
var import_starknet_types_0104 = require("@starknet-io/starknet-types-0104");
|
|
270
271
|
|
|
271
272
|
// src/types/api/rpc.ts
|
|
272
273
|
var rpc_exports = {};
|
|
273
|
-
__reExport(rpc_exports, require("@starknet-io/starknet-types-
|
|
274
|
+
__reExport(rpc_exports, require("@starknet-io/starknet-types-0104"));
|
|
274
275
|
|
|
275
276
|
// src/types/api/index.ts
|
|
276
277
|
__reExport(api_exports, rpc_exports);
|
|
@@ -279,19 +280,19 @@ __reExport(api_exports, rpc_exports);
|
|
|
279
280
|
var { ETransactionVersion } = RPCSPEC09;
|
|
280
281
|
var { ETransactionVersion2 } = RPCSPEC09;
|
|
281
282
|
var { ETransactionVersion3 } = RPCSPEC09;
|
|
282
|
-
var { EDataAvailabilityMode } =
|
|
283
|
-
var { EDAMode } =
|
|
283
|
+
var { EDataAvailabilityMode } = RPCSPEC0104;
|
|
284
|
+
var { EDAMode } = RPCSPEC0104;
|
|
284
285
|
function isRPC08Plus_ResourceBounds(entry) {
|
|
285
286
|
return "l1_data_gas" in entry;
|
|
286
287
|
}
|
|
287
288
|
function isRPC08Plus_ResourceBoundsBN(entry) {
|
|
288
289
|
return "l1_data_gas" in entry;
|
|
289
290
|
}
|
|
290
|
-
var { ETxnResponseFlag } =
|
|
291
|
-
var { ETraceFlag } =
|
|
292
|
-
var { ESubscriptionTag } =
|
|
293
|
-
var { ETransactionStatus } =
|
|
294
|
-
var { ETransactionExecutionStatus } =
|
|
291
|
+
var { ETxnResponseFlag } = RPCSPEC0104;
|
|
292
|
+
var { ETraceFlag } = RPCSPEC0104;
|
|
293
|
+
var { ESubscriptionTag } = RPCSPEC0104;
|
|
294
|
+
var { ETransactionStatus } = RPCSPEC0104;
|
|
295
|
+
var { ETransactionExecutionStatus } = RPCSPEC0104;
|
|
295
296
|
var { ETransactionType: TransactionType } = RPCSPEC09;
|
|
296
297
|
var { EBlockStatus: BlockStatus } = RPCSPEC09;
|
|
297
298
|
var { ETransactionFinalityStatus: TransactionFinalityStatus } = RPCSPEC09;
|
|
@@ -507,10 +508,12 @@ var _SupportedRpcVersion = {
|
|
|
507
508
|
"0.10.0": "0.10.0",
|
|
508
509
|
"0.10.2": "0.10.2",
|
|
509
510
|
"0.10.3": "0.10.3",
|
|
511
|
+
"0.10.4": "0.10.4",
|
|
510
512
|
v0_9_0: "0.9.0",
|
|
511
513
|
v0_10_0: "0.10.0",
|
|
512
514
|
v0_10_2: "0.10.2",
|
|
513
|
-
v0_10_3: "0.10.3"
|
|
515
|
+
v0_10_3: "0.10.3",
|
|
516
|
+
v0_10_4: "0.10.4"
|
|
514
517
|
};
|
|
515
518
|
var DEFAULT_GLOBAL_CONFIG = {
|
|
516
519
|
rpcVersion: "0.10.0",
|
|
@@ -693,14 +696,16 @@ var Logger = class _Logger {
|
|
|
693
696
|
}
|
|
694
697
|
formatMessage(logMessage) {
|
|
695
698
|
const { level, message, timestamp, data } = logMessage;
|
|
696
|
-
|
|
699
|
+
const sanitizedMessage = String(message).replace(/[\r\n]/g, "");
|
|
700
|
+
let formattedMessage = `[${timestamp}] ${level}: ${sanitizedMessage}`;
|
|
697
701
|
if (data) {
|
|
698
702
|
try {
|
|
699
703
|
formattedMessage += `
|
|
700
704
|
${JSON.stringify(data, null, 2)}`;
|
|
701
705
|
} catch (error) {
|
|
706
|
+
const sanitizedError = String(error).replace(/[\r\n]/g, "");
|
|
702
707
|
formattedMessage += `
|
|
703
|
-
[JSON.stringify Error/Circular]: ${
|
|
708
|
+
[JSON.stringify Error/Circular]: ${sanitizedError}`;
|
|
704
709
|
}
|
|
705
710
|
}
|
|
706
711
|
return formattedMessage;
|
|
@@ -7421,6 +7426,16 @@ var RpcChannel3 = class extends RpcChannel2 {
|
|
|
7421
7426
|
channelSpecVersion = _SupportedRpcVersion.v0_10_3;
|
|
7422
7427
|
};
|
|
7423
7428
|
|
|
7429
|
+
// src/channel/rpc_0_10_4.ts
|
|
7430
|
+
var rpc_0_10_4_exports = {};
|
|
7431
|
+
__export(rpc_0_10_4_exports, {
|
|
7432
|
+
RpcChannel: () => RpcChannel4
|
|
7433
|
+
});
|
|
7434
|
+
var RpcChannel4 = class extends RpcChannel3 {
|
|
7435
|
+
id = "RPC0.10.4";
|
|
7436
|
+
channelSpecVersion = _SupportedRpcVersion.v0_10_4;
|
|
7437
|
+
};
|
|
7438
|
+
|
|
7424
7439
|
// src/utils/eventEmitter.ts
|
|
7425
7440
|
var EventEmitter = class {
|
|
7426
7441
|
listeners = {};
|
|
@@ -9878,12 +9893,12 @@ var RpcProvider = class {
|
|
|
9878
9893
|
if (isVersion("0.9", options.specVersion)) {
|
|
9879
9894
|
this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
|
|
9880
9895
|
} else if (isVersion("0.10", options.specVersion)) {
|
|
9881
|
-
this.channel = new
|
|
9896
|
+
this.channel = new rpc_0_10_4_exports.RpcChannel({ ...options, waitMode: false });
|
|
9882
9897
|
} else throw new Error(`unsupported channel for spec version: ${options.specVersion}`);
|
|
9883
9898
|
} else if (isVersion("0.9", config.get("rpcVersion"))) {
|
|
9884
9899
|
this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
|
|
9885
9900
|
} else if (isVersion("0.10", config.get("rpcVersion"))) {
|
|
9886
|
-
this.channel = new
|
|
9901
|
+
this.channel = new rpc_0_10_4_exports.RpcChannel({ ...options, waitMode: false });
|
|
9887
9902
|
} else throw new Error("unable to define spec version for channel");
|
|
9888
9903
|
this.responseParser = new RPCResponseParser(options?.resourceBoundsOverhead);
|
|
9889
9904
|
const plugins = options?.plugins === false ? [] : options?.plugins ?? defaultPlugins;
|
|
@@ -9907,13 +9922,14 @@ var RpcProvider = class {
|
|
|
9907
9922
|
if (isVersion("0.9", specVersion)) {
|
|
9908
9923
|
return new this({
|
|
9909
9924
|
...optionsOrProvider,
|
|
9910
|
-
specVersion
|
|
9925
|
+
specVersion
|
|
9911
9926
|
});
|
|
9912
9927
|
}
|
|
9913
9928
|
if (isVersion("0.10", specVersion)) {
|
|
9914
9929
|
return new this({
|
|
9915
9930
|
...optionsOrProvider,
|
|
9916
|
-
|
|
9931
|
+
// forward the version the node reports, not the newest revision the SDK implements
|
|
9932
|
+
specVersion
|
|
9917
9933
|
});
|
|
9918
9934
|
}
|
|
9919
9935
|
throw new LibraryError(
|
|
@@ -11357,7 +11373,7 @@ var LedgerSigner231 = class extends LedgerSigner221 {
|
|
|
11357
11373
|
encodeCall(call) {
|
|
11358
11374
|
const toBuf = this.convertBnToLedger(call.contractAddress);
|
|
11359
11375
|
const selectorBuf = hexToBytes(addAddressPadding(getSelector(call.entrypoint)));
|
|
11360
|
-
let calldataBuf
|
|
11376
|
+
let calldataBuf;
|
|
11361
11377
|
if (call.calldata) {
|
|
11362
11378
|
const compiledCalldata = CallData.compile(call.calldata);
|
|
11363
11379
|
const calldataSizeBuf = this.convertBnToLedger(compiledCalldata.length);
|
|
@@ -14104,6 +14120,7 @@ function units(amount, simbol = "fri") {
|
|
|
14104
14120
|
RPC,
|
|
14105
14121
|
RPC0102,
|
|
14106
14122
|
RPC0103,
|
|
14123
|
+
RPC0104,
|
|
14107
14124
|
RPC09,
|
|
14108
14125
|
RPCResponseParser,
|
|
14109
14126
|
ReceiptTx,
|