starknet 8.1.0 → 8.1.2

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,15 @@
1
+ ## [8.1.2](https://github.com/starknet-io/starknet.js/compare/v8.1.1...v8.1.2) (2025-08-04)
2
+
3
+ ### Bug Fixes
4
+
5
+ - migration docs update and fix overhead method to allow false overhead for no overhead ([3b74e62](https://github.com/starknet-io/starknet.js/commit/3b74e621b69447790a6bd1c4112b60e2b428c946))
6
+
7
+ ## [8.1.1](https://github.com/starknet-io/starknet.js/compare/v8.1.0...v8.1.1) (2025-08-04)
8
+
9
+ ### Bug Fixes
10
+
11
+ - repair published types ([#1465](https://github.com/starknet-io/starknet.js/issues/1465)) ([6ab9db0](https://github.com/starknet-io/starknet.js/commit/6ab9db0fd41155735f8536d9add046e2c89abb14))
12
+
1
13
  # [8.1.0](https://github.com/starknet-io/starknet.js/compare/v8.0.0...v8.1.0) (2025-07-28)
2
14
 
3
15
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -11,21 +11,6 @@ import * as poseidon from '@noble/curves/abstract/poseidon';
11
11
  import * as json$1 from 'lossless-json';
12
12
  import * as starknet from '@scure/starknet';
13
13
 
14
- function _mergeNamespaces(n, m) {
15
- m.forEach(function (e) {
16
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
17
- if (k !== 'default' && !(k in n)) {
18
- var d = Object.getOwnPropertyDescriptor(e, k);
19
- Object.defineProperty(n, k, d.get ? d : {
20
- enumerable: true,
21
- get: function () { return e[k]; }
22
- });
23
- }
24
- });
25
- });
26
- return Object.freeze(n);
27
- }
28
-
29
14
  declare const ec_weierstrass: typeof weierstrass;
30
15
  declare namespace ec {
31
16
  export { starknet as starkCurve, ec_weierstrass as weierstrass };
@@ -56,22 +41,20 @@ type WebSocketEvent = Omit<RequestBody, 'id'> & {
56
41
  params: {};
57
42
  };
58
43
 
59
- type index$5_ErrorResponseBody = ErrorResponseBody;
60
- type index$5_RequestBody = RequestBody;
61
- type index$5_ResponseBody = ResponseBody;
62
- type index$5_SuccessResponseBody = SuccessResponseBody;
63
- type index$5_WebSocketEvent = WebSocketEvent;
64
- declare namespace index$5 {
65
- export type { Error$1 as Error, index$5_ErrorResponseBody as ErrorResponseBody, index$5_RequestBody as RequestBody, index$5_ResponseBody as ResponseBody, index$5_SuccessResponseBody as SuccessResponseBody, index$5_WebSocketEvent as WebSocketEvent };
44
+ type jsonrpc_ErrorResponseBody = ErrorResponseBody;
45
+ type jsonrpc_RequestBody = RequestBody;
46
+ type jsonrpc_ResponseBody = ResponseBody;
47
+ type jsonrpc_SuccessResponseBody = SuccessResponseBody;
48
+ type jsonrpc_WebSocketEvent = WebSocketEvent;
49
+ declare namespace jsonrpc {
50
+ export type { Error$1 as Error, jsonrpc_ErrorResponseBody as ErrorResponseBody, jsonrpc_RequestBody as RequestBody, jsonrpc_ResponseBody as ResponseBody, jsonrpc_SuccessResponseBody as SuccessResponseBody, jsonrpc_WebSocketEvent as WebSocketEvent };
66
51
  }
67
52
 
68
- var index$4 = /*#__PURE__*/_mergeNamespaces({
69
- __proto__: null,
70
- JRPC: index$5,
71
- PAYMASTER_API: PAYMASTER_API,
72
- RPCSPEC08: RPCSPEC08,
73
- RPCSPEC09: RPC
74
- }, [RPC]);
53
+ declare const index$4_PAYMASTER_API: typeof PAYMASTER_API;
54
+ declare const index$4_RPCSPEC08: typeof RPCSPEC08;
55
+ declare namespace index$4 {
56
+ export { jsonrpc as JRPC, index$4_PAYMASTER_API as PAYMASTER_API, index$4_RPCSPEC08 as RPCSPEC08, RPC as RPCSPEC09 };
57
+ }
75
58
 
76
59
  type CairoEnumRaw = Record<string, any>;
77
60
  /**
@@ -547,6 +530,7 @@ type ApiEstimateFeeResponse = FeeEstimate[];
547
530
  declare function isRPC08Plus_ResourceBounds(entry: ResourceBounds): entry is RPCSPEC08.ResourceBounds;
548
531
  declare function isRPC08Plus_ResourceBoundsBN(entry: ResourceBoundsBN): entry is ResourceBoundsBN;
549
532
  type ResourceBounds = Merge<RPCSPEC08.ResourceBounds, RPC.ResourceBounds>;
533
+ type EventFilter = RPC.EventFilter;
550
534
  /**
551
535
  * Represents percentage overhead for each resource bound
552
536
  * numerical 50 means 50% overhead
@@ -875,7 +859,7 @@ type RpcProviderOptions = {
875
859
  default?: boolean;
876
860
  waitMode?: boolean;
877
861
  baseFetch?: WindowOrWorkerGlobalScope['fetch'];
878
- resourceBoundsOverhead?: ResourceBoundsOverhead;
862
+ resourceBoundsOverhead?: ResourceBoundsOverhead | false;
879
863
  batch?: false | number;
880
864
  };
881
865
 
@@ -904,10 +888,6 @@ type EstimateFeeResponseOverhead = {
904
888
  overall_fee: bigint;
905
889
  unit: PRICE_UNIT;
906
890
  };
907
- /**
908
- * same type as EstimateFeeResponseOverhead but without overhead
909
- */
910
- type EstimateFeeResponse = EstimateFeeResponseOverhead;
911
891
  type EstimateFeeResponseBulkOverhead = Array<EstimateFeeResponseOverhead>;
912
892
  type InvokeFunctionResponse = InvokedTransaction;
913
893
  type DeclareContractResponse = DeclaredTransaction;
@@ -1052,7 +1032,7 @@ declare abstract class SignerInterface {
1052
1032
  /**
1053
1033
  * Method to get the public key of the signer
1054
1034
  *
1055
- * @returns {string} hex-string
1035
+ * @returns {Promise<string>} hex-string public key
1056
1036
  * @example
1057
1037
  * ```typescript
1058
1038
  * const mySigner = new Signer("0x123");
@@ -1065,49 +1045,67 @@ declare abstract class SignerInterface {
1065
1045
  * Signs a JSON object for off-chain usage with the private key and returns the signature.
1066
1046
  * This adds a message prefix so it can't be interchanged with transactions
1067
1047
  *
1068
- * @param {TypedData} typedData JSON object to be signed
1069
- * @param {string} accountAddress Hex string of the account's address
1048
+ * @param {TypedData} typedData - JSON object to be signed
1049
+ * @param {string} accountAddress - Hex string of the account's address
1070
1050
  * @returns {Promise<Signature>} the signature of the message
1071
1051
  * @example
1072
1052
  * ```typescript
1073
1053
  * const mySigner = new Signer("0x123");
1074
- * const myTypedData: TypedData = {
1075
- * domain: {name: "Example DApp",
1076
- * chainId: constants.StarknetChainId.SN_SEPOLIA,
1077
- * version: "0.0.3"},
1078
- * types: {StarkNetDomain: [
1079
- * { name: "name", type: "string" },
1080
- * { name: "chainId", type: "felt" },
1081
- * { name: "version", type: "string" }],
1082
- * Message: [{ name: "message", type: "felt" }]},
1083
- * primaryType: "Message", message: {message: "1234"}};
1084
- * const result = await mySigner.signMessage(myTypedData,"0x5d08a4e9188429da4e993c9bf25aafe5cd491ee2b501505d4d059f0c938f82d");
1054
+ * const myTypedData: TypedData = {
1055
+ * domain: {
1056
+ * name: "Example DApp",
1057
+ * chainId: constants.StarknetChainId.SN_SEPOLIA,
1058
+ * version: "0.0.3"
1059
+ * },
1060
+ * types: {
1061
+ * StarkNetDomain: [
1062
+ * { name: "name", type: "string" },
1063
+ * { name: "chainId", type: "felt" },
1064
+ * { name: "version", type: "string" }
1065
+ * ],
1066
+ * Message: [{ name: "message", type: "felt" }]
1067
+ * },
1068
+ * primaryType: "Message",
1069
+ * message: { message: "1234" }
1070
+ * };
1071
+ * const result = await mySigner.signMessage(myTypedData, "0x5d08a4e9188429da4e993c9bf25aafe5cd491ee2b501505d4d059f0c938f82d");
1085
1072
  * // result = Signature {r: 684915484701699003335398790608214855489903651271362390249153620883122231253n,
1086
1073
  * // s: 1399150959912500412309102776989465580949387575375484933432871778355496929189n, recovery: 1}
1087
1074
  * ```
1088
-
1089
1075
  */
1090
1076
  abstract signMessage(typedData: TypedData, accountAddress: string): Promise<Signature>;
1091
1077
  /**
1092
- * Signs transactions with the private key and returns the signature
1078
+ * Signs INVOKE transactions with the private key and returns the signature
1093
1079
  *
1094
- * @param {Call[]} transactions array of Call objects
1095
- * @param {InvocationsSignerDetails} transactionsDetail InvocationsSignerDetails object
1080
+ * @param {Call[]} transactions - Array of Call objects representing the transactions
1081
+ * @param {InvocationsSignerDetails} transactionsDetail - Transaction details including V3 fields
1096
1082
  * @returns {Promise<Signature>} the signature of the transaction
1083
+ * @remarks Only supports V3 transactions. V0, V1, and V2 transactions will throw an error.
1097
1084
  * @example
1098
1085
  * ```typescript
1099
1086
  * const mySigner = new Signer("0x123");
1100
1087
  * const calls: Call[] = [{
1101
- * contractAddress: "0x1234567890123456789012345678901234567890",
1102
- * entrypoint: "functionName",
1103
- * calldata: [1, 2, 3]
1088
+ * contractAddress: "0x1234567890123456789012345678901234567890",
1089
+ * entrypoint: "transfer",
1090
+ * calldata: ["0xRecipient", "1000", "0"]
1104
1091
  * }];
1105
1092
  * const transactionsDetail: InvocationsSignerDetails = {
1106
- * walletAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
1107
- * chainId: constants.StarknetChainId.SN_MAIN,
1108
- * cairoVersion: "1",
1109
- * maxFee: '0x1234567890abcdef',
1110
- * version: "0x0", nonce: 1};
1093
+ * walletAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
1094
+ * chainId: constants.StarknetChainId.SN_MAIN,
1095
+ * cairoVersion: "1",
1096
+ * version: "0x3",
1097
+ * nonce: 1,
1098
+ * resourceBounds: {
1099
+ * l1_gas: { amount: "0x1000", price: "0x20" },
1100
+ * l2_gas: { amount: "0x200", price: "0x5" },
1101
+ * l1_data_gas: { amount: "0x500", price: "0x10" }
1102
+ * },
1103
+ * tip: 0,
1104
+ * paymasterData: [],
1105
+ * accountDeploymentData: [],
1106
+ * nonceDataAvailabilityMode: RPC.EDataAvailabilityMode.L1,
1107
+ * feeDataAvailabilityMode: RPC.EDataAvailabilityMode.L1
1108
+ * };
1111
1109
  * const result = await mySigner.signTransaction(calls, transactionsDetail);
1112
1110
  * // result = Signature {r: 304910226421970384958146916800275294114105560641204815169249090836676768876n,
1113
1111
  * // s: 1072798866000813654190523783606274062837012608648308896325315895472901074693n, recovery: 0}
@@ -1117,21 +1115,31 @@ declare abstract class SignerInterface {
1117
1115
  /**
1118
1116
  * Signs a DEPLOY_ACCOUNT transaction with the private key and returns the signature
1119
1117
  *
1120
- * @param {DeployAccountSignerDetails} transaction to deploy an account contract
1118
+ * @param {DeployAccountSignerDetails} transaction - Transaction details to deploy an account contract
1121
1119
  * @returns {Promise<Signature>} the signature of the transaction to deploy an account
1120
+ * @remarks Only supports V3 transactions. V0, V1, and V2 transactions will throw an error.
1122
1121
  * @example
1123
1122
  * ```typescript
1124
1123
  * const mySigner = new Signer("0x123");
1125
1124
  * const myDeployAcc: DeployAccountSignerDetails = {
1126
1125
  * contractAddress: "0x65a822fbee1ae79e898688b5a4282dc79e0042cbed12f6169937fddb4c26641",
1127
- * version: "0x2", chainId: constants.StarknetChainId.SN_SEPOLIA,
1126
+ * version: "0x3",
1127
+ * chainId: constants.StarknetChainId.SN_SEPOLIA,
1128
1128
  * classHash: "0x5f3614e8671257aff9ac38e929c74d65b02d460ae966cd826c9f04a7fa8e0d4",
1129
- * constructorCalldata: [1, 2],addressSalt: 1234,
1130
- * nonce: 45, maxFee: 10 ** 15, tip: 0, paymasterData: [],accountDeploymentData: [],
1129
+ * constructorCalldata: ["0x123", "0x456"],
1130
+ * addressSalt: "0x789",
1131
+ * nonce: 0,
1132
+ * resourceBounds: {
1133
+ * l1_gas: { amount: "0x1000", price: "0x20" },
1134
+ * l2_gas: { amount: "0x200", price: "0x5" },
1135
+ * l1_data_gas: { amount: "0x500", price: "0x10" }
1136
+ * },
1137
+ * tip: 0,
1138
+ * paymasterData: [],
1139
+ * accountDeploymentData: [],
1131
1140
  * nonceDataAvailabilityMode: RPC.EDataAvailabilityMode.L1,
1132
- * feeDataAvailabilityMode: RPC.EDataAvailabilityMode.L1,
1133
- * resourceBounds: stark.estimateFeeToBounds(constants.ZERO),
1134
- * }
1141
+ * feeDataAvailabilityMode: RPC.EDataAvailabilityMode.L1
1142
+ * };
1135
1143
  * const result = await mySigner.signDeployAccountTransaction(myDeployAcc);
1136
1144
  * // result = Signature {r: 2871311234341436528393212130310036951068553852419934781736214693308640202748n,
1137
1145
  * // s: 1746271646048888422437132495446973163454853863041370993384284773665861377605n, recovery: 1}
@@ -1141,20 +1149,30 @@ declare abstract class SignerInterface {
1141
1149
  /**
1142
1150
  * Signs a DECLARE transaction with the private key and returns the signature
1143
1151
  *
1144
- * @param {DeclareSignerDetails} transaction to declare a class
1152
+ * @param {DeclareSignerDetails} transaction - Transaction details to declare a contract class
1145
1153
  * @returns {Promise<Signature>} the signature of the transaction to declare a class
1154
+ * @remarks Only supports V3 transactions. V0, V1, and V2 transactions will throw an error.
1146
1155
  * @example
1147
1156
  * ```typescript
1148
1157
  * const mySigner = new Signer("0x123");
1149
1158
  * const myDeclare: DeclareSignerDetails = {
1150
- * version: "0x2", chainId: constants.StarknetChainId.SN_SEPOLIA,
1159
+ * version: "0x3",
1160
+ * chainId: constants.StarknetChainId.SN_SEPOLIA,
1151
1161
  * senderAddress: "0x65a822fbee1ae79e898688b5a4282dc79e0042cbed12f6169937fddb4c26641",
1152
1162
  * classHash: "0x5f3614e8671257aff9ac38e929c74d65b02d460ae966cd826c9f04a7fa8e0d4",
1153
- * nonce: 45, maxFee: 10 ** 15, tip: 0, paymasterData: [], accountDeploymentData: [],
1163
+ * compiledClassHash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
1164
+ * nonce: 45,
1165
+ * resourceBounds: {
1166
+ * l1_gas: { amount: "0x1000", price: "0x20" },
1167
+ * l2_gas: { amount: "0x200", price: "0x5" },
1168
+ * l1_data_gas: { amount: "0x500", price: "0x10" }
1169
+ * },
1170
+ * tip: 0,
1171
+ * paymasterData: [],
1172
+ * accountDeploymentData: [],
1154
1173
  * nonceDataAvailabilityMode: RPC.EDataAvailabilityMode.L1,
1155
- * feeDataAvailabilityMode: RPC.EDataAvailabilityMode.L1,
1156
- * resourceBounds: stark.estimateFeeToBounds(constants.ZERO),
1157
- }
1174
+ * feeDataAvailabilityMode: RPC.EDataAvailabilityMode.L1
1175
+ * };
1158
1176
  * const result = await mySigner.signDeclareTransaction(myDeclare);
1159
1177
  * // result = Signature {r: 2432056944313955951711774394836075930010416436707488863728289188289211995670n,
1160
1178
  * // s: 3407649393310177489888603098175002856596469926897298636282244411990343146307n, recovery: 1}
@@ -3841,15 +3859,6 @@ declare namespace rpc_0_9_0 {
3841
3859
  export { rpc_0_9_0_RpcChannel as RpcChannel };
3842
3860
  }
3843
3861
 
3844
- declare const _default: {
3845
- new (url: string | URL, protocols?: string | string[]): WebSocket;
3846
- prototype: WebSocket;
3847
- readonly CONNECTING: 0;
3848
- readonly OPEN: 1;
3849
- readonly CLOSING: 2;
3850
- readonly CLOSED: 3;
3851
- };
3852
-
3853
3862
  /**
3854
3863
  * Options for creating a new Subscription instance
3855
3864
  */
@@ -3970,6 +3979,9 @@ type ReconnectOptions = {
3970
3979
  */
3971
3980
  delay?: number;
3972
3981
  };
3982
+ type WebSocketModule = {
3983
+ new (nodeUrl: WebSocketOptions['nodeUrl']): WebSocket;
3984
+ };
3973
3985
  /**
3974
3986
  * Options for configuring the WebSocketChannel.
3975
3987
  */
@@ -3988,7 +4000,7 @@ type WebSocketOptions = {
3988
4000
  * const channel = new WebSocketChannel({ nodeUrl: '...', websocket: WebSocket });
3989
4001
  * ```
3990
4002
  */
3991
- websocket?: typeof _default;
4003
+ websocket?: WebSocketModule;
3992
4004
  /**
3993
4005
  * The maximum number of events to buffer per subscription when no handler is attached.
3994
4006
  * @default 1000
@@ -4044,7 +4056,7 @@ declare class WebSocketChannel {
4044
4056
  /**
4045
4057
  * The underlying WebSocket instance.
4046
4058
  */
4047
- websocket: _default;
4059
+ websocket: WebSocket;
4048
4060
  private WsImplementation;
4049
4061
  private activeSubscriptions;
4050
4062
  private readonly maxBufferSize;
@@ -4110,7 +4122,7 @@ declare class WebSocketChannel {
4110
4122
  * console.log('Connected!');
4111
4123
  * ```
4112
4124
  */
4113
- waitForConnection(): Promise<typeof this$1.websocket.readyState>;
4125
+ waitForConnection(): Promise<WebSocket['readyState']>;
4114
4126
  /**
4115
4127
  * Closes the WebSocket connection.
4116
4128
  * This method is user-initiated and will prevent automatic reconnection for this closure.
@@ -4122,7 +4134,7 @@ declare class WebSocketChannel {
4122
4134
  * Returns a Promise that resolves when the WebSocket connection is closed.
4123
4135
  * @returns {Promise<number | Event>} A Promise that resolves with the WebSocket's `readyState` or a `CloseEvent` when disconnected.
4124
4136
  */
4125
- waitForDisconnection(): Promise<typeof this$1.websocket.readyState | Event>;
4137
+ waitForDisconnection(): Promise<WebSocket['readyState'] | Event>;
4126
4138
  /**
4127
4139
  * Unsubscribes from a Starknet subscription.
4128
4140
  * It is recommended to use the `unsubscribe()` method on the `Subscription` object instead.
@@ -6035,16 +6047,40 @@ declare function signatureToDecimalArray(sig?: Signature): ArraySignatureType;
6035
6047
  * ```
6036
6048
  */
6037
6049
  declare function signatureToHexArray(sig?: Signature): ArraySignatureType;
6050
+ /**
6051
+ * Returns a resource bounds with zero values and no overhead.
6052
+ * @returns {ResourceBoundsBN} A resource bounds with zero values and no overhead.
6053
+ */
6054
+ declare function zeroResourceBounds(): ResourceBoundsBN;
6038
6055
  /**
6039
6056
  * Calculates the maximum resource bounds for fee estimation.
6040
6057
  *
6041
- * @param {FeeEstimate | 0n} estimate The estimate for the fee. If a BigInt is provided, the returned bounds will be set to 0n.
6042
- * @param {ResourceBoundsOverhead} [overhead] - The percentage overhead added to the max units and max price per unit.
6058
+ * @param {FeeEstimate} estimate The estimate for the fee.
6059
+ * @param {ResourceBoundsOverhead | false} [overhead] - The percentage overhead added to the max units and max price per unit. Pass `false` to disable overhead.
6043
6060
  * @returns {ResourceBoundsBN} The resource bounds with overhead represented as BigInt.
6044
6061
  * @throws {Error} If the estimate object is undefined or does not have the required properties.
6045
6062
  */
6046
- declare function toOverheadResourceBounds(estimate: FeeEstimate, overhead?: ResourceBoundsOverhead): ResourceBoundsBN;
6047
- declare function resourceBoundsToEstimateFee(resourceBounds: ResourceBoundsBN): EstimateFeeResponse;
6063
+ declare function toOverheadResourceBounds(estimate: FeeEstimate, overhead?: ResourceBoundsOverhead | false): ResourceBoundsBN;
6064
+ /**
6065
+ * Converts a resource bounds to an estimate fee response. No overhead is applied.
6066
+ * @param {ResourceBoundsBN} resourceBounds - The resource bounds to convert.
6067
+ * @returns {EstimateFeeResponseOverhead} The estimate fee response.
6068
+ * @example
6069
+ * ```typescript
6070
+ * const resourceBounds = {
6071
+ * l1_gas: { max_amount: 1000n, max_price_per_unit: 100n },
6072
+ * l2_gas: { max_amount: 2000n, max_price_per_unit: 200n },
6073
+ * l1_data_gas: { max_amount: 500n, max_price_per_unit: 50n }
6074
+ * };
6075
+ * const result = stark.resourceBoundsToEstimateFeeResponse(resourceBounds);
6076
+ * // result = {
6077
+ * // resourceBounds: resourceBounds,
6078
+ * // overall_fee: 129000n,
6079
+ * // unit: 'FRI'
6080
+ * // }
6081
+ * ```
6082
+ */
6083
+ declare function resourceBoundsToEstimateFeeResponse(resourceBounds: ResourceBoundsBN): EstimateFeeResponseOverhead;
6048
6084
  /**
6049
6085
  * Calculates the overall fee for a transaction based on resource consumption and prices.
6050
6086
  *
@@ -6052,7 +6088,7 @@ declare function resourceBoundsToEstimateFee(resourceBounds: ResourceBoundsBN):
6052
6088
  * l1_gas_consumed*l1_gas_price + l1_data_gas_consumed*l1_data_gas_price + l2_gas_consumed*l2_gas_price
6053
6089
  *
6054
6090
  * @param {FeeEstimate} estimate - The fee estimate containing gas consumption and price data
6055
- * @param {ResourceBoundsOverhead} overhead - The overhead percentage (currently unused in calculation)
6091
+ * @param {ResourceBoundsOverhead | false} overhead - The overhead percentage. Pass `false` to disable overhead.
6056
6092
  * @returns {bigint} The calculated overall fee in wei or fri
6057
6093
  * @example
6058
6094
  * ```typescript
@@ -6068,9 +6104,9 @@ declare function resourceBoundsToEstimateFee(resourceBounds: ResourceBoundsBN):
6068
6104
  * // result = 1000n * 100n + 500n * 50n + 200n * 20n = 129000n
6069
6105
  * ```
6070
6106
  */
6071
- declare function toOverheadOverallFee(estimate: FeeEstimate, overhead?: ResourceBoundsOverhead): bigint;
6107
+ declare function toOverheadOverallFee(estimate: FeeEstimate, overhead?: ResourceBoundsOverhead | false): bigint;
6072
6108
  /**
6073
- * Mock zero fee response
6109
+ * Mock zero fee API response
6074
6110
  */
6075
6111
  declare function ZeroFeeEstimate(): FeeEstimate;
6076
6112
  /**
@@ -6196,7 +6232,7 @@ declare const index$1_getFullPublicKey: typeof getFullPublicKey;
6196
6232
  declare const index$1_intDAM: typeof intDAM;
6197
6233
  declare const index$1_randomAddress: typeof randomAddress;
6198
6234
  declare const index$1_resourceBoundsToBigInt: typeof resourceBoundsToBigInt;
6199
- declare const index$1_resourceBoundsToEstimateFee: typeof resourceBoundsToEstimateFee;
6235
+ declare const index$1_resourceBoundsToEstimateFeeResponse: typeof resourceBoundsToEstimateFeeResponse;
6200
6236
  declare const index$1_resourceBoundsToHexString: typeof resourceBoundsToHexString;
6201
6237
  declare const index$1_signatureToDecimalArray: typeof signatureToDecimalArray;
6202
6238
  declare const index$1_signatureToHexArray: typeof signatureToHexArray;
@@ -6205,8 +6241,9 @@ declare const index$1_toOverheadOverallFee: typeof toOverheadOverallFee;
6205
6241
  declare const index$1_toOverheadResourceBounds: typeof toOverheadResourceBounds;
6206
6242
  declare const index$1_toTransactionVersion: typeof toTransactionVersion;
6207
6243
  declare const index$1_v3Details: typeof v3Details;
6244
+ declare const index$1_zeroResourceBounds: typeof zeroResourceBounds;
6208
6245
  declare namespace index$1 {
6209
- export { index$1_ZeroFeeEstimate as ZeroFeeEstimate, index$1_compressProgram as compressProgram, index$1_decompressProgram as decompressProgram, index$1_formatSignature as formatSignature, index$1_getFullPublicKey as getFullPublicKey, index$1_intDAM as intDAM, index$1_randomAddress as randomAddress, index$1_resourceBoundsToBigInt as resourceBoundsToBigInt, index$1_resourceBoundsToEstimateFee as resourceBoundsToEstimateFee, index$1_resourceBoundsToHexString as resourceBoundsToHexString, index$1_signatureToDecimalArray as signatureToDecimalArray, index$1_signatureToHexArray as signatureToHexArray, index$1_toFeeVersion as toFeeVersion, index$1_toOverheadOverallFee as toOverheadOverallFee, index$1_toOverheadResourceBounds as toOverheadResourceBounds, index$1_toTransactionVersion as toTransactionVersion, index$1_v3Details as v3Details };
6246
+ export { index$1_ZeroFeeEstimate as ZeroFeeEstimate, index$1_compressProgram as compressProgram, index$1_decompressProgram as decompressProgram, index$1_formatSignature as formatSignature, index$1_getFullPublicKey as getFullPublicKey, index$1_intDAM as intDAM, index$1_randomAddress as randomAddress, index$1_resourceBoundsToBigInt as resourceBoundsToBigInt, index$1_resourceBoundsToEstimateFeeResponse as resourceBoundsToEstimateFeeResponse, index$1_resourceBoundsToHexString as resourceBoundsToHexString, index$1_signatureToDecimalArray as signatureToDecimalArray, index$1_signatureToHexArray as signatureToHexArray, index$1_toFeeVersion as toFeeVersion, index$1_toOverheadOverallFee as toOverheadOverallFee, index$1_toOverheadResourceBounds as toOverheadResourceBounds, index$1_toTransactionVersion as toTransactionVersion, index$1_v3Details as v3Details, index$1_zeroResourceBounds as zeroResourceBounds };
6210
6247
  }
6211
6248
 
6212
6249
  /**
@@ -8503,4 +8540,4 @@ declare class Logger {
8503
8540
  */
8504
8541
  declare const logger: Logger;
8505
8542
 
8506
- export { type Abi, type AbiEntry, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFixedArray, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint256, CairoUint512, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type EstimateFeeBulk, type EstimateFeeResponse, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, Subscription, type SubscriptionBlockIdentifier, type SuccessfulTransactionReceiptResponse, type TXN_EXECUTION_STATUS, type TXN_HASH$1 as TXN_HASH, type TXN_STATUS, TimeoutError, type TipAnalysisOptions, type TipEstimate, type TipType, type TokenData, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, type TransactionReceiptCallbacks, type TransactionReceiptCallbacksDefault, type TransactionReceiptCallbacksDefined, type TransactionReceiptStatus, type TransactionReceiptValue, type TransactionStatus, type TransactionStatusReceiptSets, type TransactionTrace, TransactionType, type TransactionWithHash, type Tupled, type TypedContractV2, UINT_128_MAX, UINT_128_MIN, UINT_256_HIGH_MAX, UINT_256_HIGH_MIN, UINT_256_LOW_MAX, UINT_256_LOW_MIN, UINT_256_MAX, UINT_256_MIN, UINT_512_MAX, UINT_512_MIN, Uint, type Uint256, type Uint512, type UniversalDeployerContractPayload, type UniversalDetails, type UserInvoke, type UserTransaction, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, WalletAccount, WebSocketChannel, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, config, constants, contractClassResponseToLegacyCompiledContract, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, isAccount, isPendingBlock, isPendingStateUpdate, isPendingTransaction, isRPC08Plus_ResourceBounds, isRPC08Plus_ResourceBoundsBN, isSierra, isSupportedSpecVersion, isV3Tx, isVersion, json, legacyDeployer, logger, merkle, num, outsideExecution, parseCalldataField, paymaster, provider, selector, shortString, src5, index$1 as stark, starknetId, toAnyPatchVersion, toApiVersion, index$2 as transaction, typedData, uint256$1 as uint256, units, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, verifyMessageInStarknet, type waitForTransactionOptions, connect as wallet };
8543
+ export { type Abi, type AbiEntry, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFixedArray, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint256, CairoUint512, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type EstimateFeeBulk, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type EventFilter, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, Subscription, type SubscriptionBlockIdentifier, type SuccessfulTransactionReceiptResponse, type TXN_EXECUTION_STATUS, type TXN_HASH$1 as TXN_HASH, type TXN_STATUS, TimeoutError, type TipAnalysisOptions, type TipEstimate, type TipType, type TokenData, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, type TransactionReceiptCallbacks, type TransactionReceiptCallbacksDefault, type TransactionReceiptCallbacksDefined, type TransactionReceiptStatus, type TransactionReceiptValue, type TransactionStatus, type TransactionStatusReceiptSets, type TransactionTrace, TransactionType, type TransactionWithHash, type Tupled, type TypedContractV2, UINT_128_MAX, UINT_128_MIN, UINT_256_HIGH_MAX, UINT_256_HIGH_MIN, UINT_256_LOW_MAX, UINT_256_LOW_MIN, UINT_256_MAX, UINT_256_MIN, UINT_512_MAX, UINT_512_MIN, Uint, type Uint256, type Uint512, type UniversalDeployerContractPayload, type UniversalDetails, type UserInvoke, type UserTransaction, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, WalletAccount, WebSocketChannel, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, config, constants, contractClassResponseToLegacyCompiledContract, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, isAccount, isPendingBlock, isPendingStateUpdate, isPendingTransaction, isRPC08Plus_ResourceBounds, isRPC08Plus_ResourceBoundsBN, isSierra, isSupportedSpecVersion, isV3Tx, isVersion, json, legacyDeployer, logger, merkle, num, outsideExecution, parseCalldataField, paymaster, provider, selector, shortString, src5, index$1 as stark, starknetId, toAnyPatchVersion, toApiVersion, index$2 as transaction, typedData, uint256$1 as uint256, units, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, verifyMessageInStarknet, type waitForTransactionOptions, connect as wallet };
@@ -240,7 +240,7 @@ var starknet = (() => {
240
240
  WALLET_API: () => wallet_api_exports2
241
241
  });
242
242
 
243
- // src/types/api/jsonrpc/index.ts
243
+ // src/types/api/jsonrpc.ts
244
244
  var jsonrpc_exports = {};
245
245
 
246
246
  // node_modules/@starknet-io/starknet-types-08/dist/esm/index.js
@@ -7635,7 +7635,7 @@ ${indent}}` : "}";
7635
7635
  intDAM: () => intDAM,
7636
7636
  randomAddress: () => randomAddress,
7637
7637
  resourceBoundsToBigInt: () => resourceBoundsToBigInt,
7638
- resourceBoundsToEstimateFee: () => resourceBoundsToEstimateFee,
7638
+ resourceBoundsToEstimateFeeResponse: () => resourceBoundsToEstimateFeeResponse,
7639
7639
  resourceBoundsToHexString: () => resourceBoundsToHexString,
7640
7640
  signatureToDecimalArray: () => signatureToDecimalArray,
7641
7641
  signatureToHexArray: () => signatureToHexArray,
@@ -7643,7 +7643,8 @@ ${indent}}` : "}";
7643
7643
  toOverheadOverallFee: () => toOverheadOverallFee,
7644
7644
  toOverheadResourceBounds: () => toOverheadResourceBounds,
7645
7645
  toTransactionVersion: () => toTransactionVersion,
7646
- v3Details: () => v3Details
7646
+ v3Details: () => v3Details,
7647
+ zeroResourceBounds: () => zeroResourceBounds
7647
7648
  });
7648
7649
 
7649
7650
  // node_modules/pako/dist/pako.esm.mjs
@@ -11854,26 +11855,44 @@ ${indent}}` : "}";
11854
11855
  function signatureToHexArray(sig) {
11855
11856
  return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig));
11856
11857
  }
11858
+ function zeroResourceBounds() {
11859
+ return toOverheadResourceBounds(ZeroFeeEstimate(), false);
11860
+ }
11857
11861
  function toOverheadResourceBounds(estimate, overhead = config.get("resourceBoundsOverhead")) {
11858
11862
  return {
11859
11863
  l2_gas: {
11860
- max_amount: addPercent(estimate.l2_gas_consumed, overhead.l2_gas.max_amount),
11861
- max_price_per_unit: addPercent(estimate.l2_gas_price, overhead.l2_gas.max_price_per_unit)
11864
+ max_amount: addPercent(
11865
+ estimate.l2_gas_consumed,
11866
+ overhead !== false ? overhead.l2_gas.max_amount : 0
11867
+ ),
11868
+ max_price_per_unit: addPercent(
11869
+ estimate.l2_gas_price,
11870
+ overhead !== false ? overhead.l2_gas.max_price_per_unit : 0
11871
+ )
11862
11872
  },
11863
11873
  l1_gas: {
11864
- max_amount: addPercent(estimate.l1_gas_consumed, overhead.l1_gas.max_amount),
11865
- max_price_per_unit: addPercent(estimate.l1_gas_price, overhead.l1_gas.max_price_per_unit)
11874
+ max_amount: addPercent(
11875
+ estimate.l1_gas_consumed,
11876
+ overhead !== false ? overhead.l1_gas.max_amount : 0
11877
+ ),
11878
+ max_price_per_unit: addPercent(
11879
+ estimate.l1_gas_price,
11880
+ overhead !== false ? overhead.l1_gas.max_price_per_unit : 0
11881
+ )
11866
11882
  },
11867
11883
  l1_data_gas: {
11868
- max_amount: addPercent(estimate.l1_data_gas_consumed, overhead.l1_data_gas.max_amount),
11884
+ max_amount: addPercent(
11885
+ estimate.l1_data_gas_consumed,
11886
+ overhead !== false ? overhead.l1_data_gas.max_amount : 0
11887
+ ),
11869
11888
  max_price_per_unit: addPercent(
11870
11889
  estimate.l1_data_gas_price,
11871
- overhead.l1_data_gas.max_price_per_unit
11890
+ overhead !== false ? overhead.l1_data_gas.max_price_per_unit : 0
11872
11891
  )
11873
11892
  }
11874
11893
  };
11875
11894
  }
11876
- function resourceBoundsToEstimateFee(resourceBounds) {
11895
+ function resourceBoundsToEstimateFeeResponse(resourceBounds) {
11877
11896
  return {
11878
11897
  resourceBounds,
11879
11898
  /**
@@ -11884,7 +11903,16 @@ ${indent}}` : "}";
11884
11903
  };
11885
11904
  }
11886
11905
  function toOverheadOverallFee(estimate, overhead = config.get("resourceBoundsOverhead")) {
11887
- return addPercent(estimate.l1_gas_consumed, overhead.l1_gas.max_amount) * addPercent(estimate.l1_gas_price, overhead.l1_gas.max_price_per_unit) + addPercent(estimate.l1_data_gas_consumed, overhead.l1_data_gas.max_amount) * addPercent(estimate.l1_data_gas_price, overhead.l1_data_gas.max_price_per_unit) + addPercent(estimate.l2_gas_consumed, overhead.l2_gas.max_amount) * addPercent(estimate.l2_gas_price, overhead.l2_gas.max_price_per_unit);
11906
+ return addPercent(estimate.l1_gas_consumed, overhead !== false ? overhead.l1_gas.max_amount : 0) * addPercent(
11907
+ estimate.l1_gas_price,
11908
+ overhead !== false ? overhead.l1_gas.max_price_per_unit : 0
11909
+ ) + addPercent(
11910
+ estimate.l1_data_gas_consumed,
11911
+ overhead !== false ? overhead.l1_data_gas.max_amount : 0
11912
+ ) * addPercent(
11913
+ estimate.l1_data_gas_price,
11914
+ overhead !== false ? overhead.l1_data_gas.max_price_per_unit : 0
11915
+ ) + addPercent(estimate.l2_gas_consumed, overhead !== false ? overhead.l2_gas.max_amount : 0) * addPercent(estimate.l2_gas_price, overhead !== false ? overhead.l2_gas.max_price_per_unit : 0);
11888
11916
  }
11889
11917
  function ZeroFeeEstimate() {
11890
11918
  return {
@@ -11929,7 +11957,7 @@ ${indent}}` : "}";
11929
11957
  accountDeploymentData: details.accountDeploymentData || [],
11930
11958
  nonceDataAvailabilityMode: details.nonceDataAvailabilityMode || EDataAvailabilityMode3.L1,
11931
11959
  feeDataAvailabilityMode: details.feeDataAvailabilityMode || EDataAvailabilityMode3.L1,
11932
- resourceBounds: details.resourceBounds ?? toOverheadResourceBounds(ZeroFeeEstimate(), void 0)
11960
+ resourceBounds: details.resourceBounds ?? zeroResourceBounds()
11933
11961
  };
11934
11962
  }
11935
11963
  function getFullPublicKey(privateKey) {
@@ -17698,7 +17726,8 @@ ${indent}}` : "}";
17698
17726
  }
17699
17727
  async estimateFeeBulk(invocations, details = {}) {
17700
17728
  if (!invocations.length) throw TypeError("Invocations should be non-empty array");
17701
- if (details.resourceBounds) return [resourceBoundsToEstimateFee(details.resourceBounds)];
17729
+ if (details.resourceBounds)
17730
+ return [resourceBoundsToEstimateFeeResponse(details.resourceBounds)];
17702
17731
  const { nonce, blockIdentifier, version, skipValidate } = details;
17703
17732
  const detailsWithTip = await this.resolveDetailsWithTip(details);
17704
17733
  const accountInvocations = await this.accountInvocationsFactory(invocations, {