starknet 7.3.0 → 7.5.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 +24 -0
- package/dist/index.d.ts +210 -30
- package/dist/index.global.js +171 -59
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +161 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +161 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -207,10 +207,10 @@ __export(api_exports, {
|
|
|
207
207
|
var jsonrpc_exports = {};
|
|
208
208
|
|
|
209
209
|
// src/types/api/index.ts
|
|
210
|
-
var RPCSPEC07 = __toESM(require("starknet-types-07"));
|
|
211
|
-
var RPCSPEC08 = __toESM(require("starknet-types-08"));
|
|
212
|
-
var import_starknet_types_08 = require("starknet-types-08");
|
|
213
|
-
__reExport(api_exports, require("starknet-types-08"));
|
|
210
|
+
var RPCSPEC07 = __toESM(require("@starknet-io/starknet-types-07"));
|
|
211
|
+
var RPCSPEC08 = __toESM(require("@starknet-io/starknet-types-08"));
|
|
212
|
+
var import_starknet_types_08 = require("@starknet-io/starknet-types-08");
|
|
213
|
+
__reExport(api_exports, require("@starknet-io/starknet-types-08"));
|
|
214
214
|
|
|
215
215
|
// src/utils/encode.ts
|
|
216
216
|
var encode_exports = {};
|
|
@@ -372,14 +372,8 @@ var DEFAULT_GLOBAL_CONFIG = {
|
|
|
372
372
|
websocket: void 0
|
|
373
373
|
};
|
|
374
374
|
var RPC_DEFAULT_NODES = {
|
|
375
|
-
SN_MAIN: [
|
|
376
|
-
|
|
377
|
-
`https://free-rpc.nethermind.io/mainnet-juno/`
|
|
378
|
-
],
|
|
379
|
-
SN_SEPOLIA: [
|
|
380
|
-
`https://starknet-sepolia.public.blastapi.io/rpc/`,
|
|
381
|
-
`https://free-rpc.nethermind.io/sepolia-juno/`
|
|
382
|
-
]
|
|
375
|
+
SN_MAIN: [`https://starknet-mainnet.public.blastapi.io/rpc/`],
|
|
376
|
+
SN_SEPOLIA: [`https://starknet-sepolia.public.blastapi.io/rpc/`]
|
|
383
377
|
};
|
|
384
378
|
var PAYMASTER_RPC_NODES = {
|
|
385
379
|
SN_MAIN: [`https://starknet.paymaster.avnu.fi`],
|
|
@@ -390,7 +384,8 @@ var SYSTEM_MESSAGES = {
|
|
|
390
384
|
legacyTxRPC08Message: "RPC 0.8 do not support legacy transactions",
|
|
391
385
|
SWOldV3: "RPC 0.7 V3 tx (improper resource bounds) not supported in RPC 0.8",
|
|
392
386
|
channelVersionMismatch: "Channel specification version is not compatible with the connected node Specification Version",
|
|
393
|
-
unsupportedSpecVersion: "The connected node specification version is not supported by this library"
|
|
387
|
+
unsupportedSpecVersion: "The connected node specification version is not supported by this library",
|
|
388
|
+
maxFeeInV3: "maxFee is not supported in V3 transactions, use resourceBounds instead"
|
|
394
389
|
};
|
|
395
390
|
|
|
396
391
|
// src/global/config.ts
|
|
@@ -642,7 +637,7 @@ var BlockTag = {
|
|
|
642
637
|
};
|
|
643
638
|
|
|
644
639
|
// src/provider/types/spec.type.ts
|
|
645
|
-
var RPCSPEC082 = __toESM(require("starknet-types-08"));
|
|
640
|
+
var RPCSPEC082 = __toESM(require("@starknet-io/starknet-types-08"));
|
|
646
641
|
var { ETransactionVersion: ETransactionVersion2 } = RPCSPEC082;
|
|
647
642
|
var { ETransactionVersion2: ETransactionVersion22 } = RPCSPEC082;
|
|
648
643
|
var { ETransactionVersion3 } = RPCSPEC082;
|
|
@@ -734,7 +729,7 @@ var OutsideExecutionVersion = {
|
|
|
734
729
|
};
|
|
735
730
|
|
|
736
731
|
// src/types/typedData.ts
|
|
737
|
-
var import_starknet_types_07 = require("starknet-types-07");
|
|
732
|
+
var import_starknet_types_07 = require("@starknet-io/starknet-types-07");
|
|
738
733
|
|
|
739
734
|
// src/utils/json.ts
|
|
740
735
|
var json_exports = {};
|
|
@@ -840,6 +835,15 @@ function assert(condition, message) {
|
|
|
840
835
|
throw new Error(message || "Assertion failure");
|
|
841
836
|
}
|
|
842
837
|
}
|
|
838
|
+
function assertX(condition, method) {
|
|
839
|
+
if (!condition) {
|
|
840
|
+
if (method.length === 0) {
|
|
841
|
+
method();
|
|
842
|
+
} else {
|
|
843
|
+
throw new Error("AssertionX failure: message function should not require arguments");
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
843
847
|
|
|
844
848
|
// src/utils/num.ts
|
|
845
849
|
var num_exports = {};
|
|
@@ -984,6 +988,7 @@ function isBigNumberish(input) {
|
|
|
984
988
|
// src/utils/hash/selector.ts
|
|
985
989
|
var selector_exports = {};
|
|
986
990
|
__export(selector_exports, {
|
|
991
|
+
getL1MessageHash: () => getL1MessageHash,
|
|
987
992
|
getL2MessageHash: () => getL2MessageHash,
|
|
988
993
|
getSelector: () => getSelector,
|
|
989
994
|
getSelectorFromName: () => getSelectorFromName,
|
|
@@ -1034,6 +1039,9 @@ function getL2MessageHash(l1FromAddress, l2ToAddress, l2Selector, l2Calldata, l1
|
|
|
1034
1039
|
...l2Calldata
|
|
1035
1040
|
]);
|
|
1036
1041
|
}
|
|
1042
|
+
function getL1MessageHash(fromL2Address, toL1Address, payload) {
|
|
1043
|
+
return solidityUint256PackedKeccak256([fromL2Address, toL1Address, payload.length, ...payload]);
|
|
1044
|
+
}
|
|
1037
1045
|
|
|
1038
1046
|
// src/utils/shortString.ts
|
|
1039
1047
|
var shortString_exports = {};
|
|
@@ -3187,6 +3195,7 @@ __export(hash_exports, {
|
|
|
3187
3195
|
computePoseidonHashOnElements: () => computePoseidonHashOnElements,
|
|
3188
3196
|
computeSierraContractClassHash: () => computeSierraContractClassHash,
|
|
3189
3197
|
formatSpaces: () => formatSpaces,
|
|
3198
|
+
getL1MessageHash: () => getL1MessageHash,
|
|
3190
3199
|
getL2MessageHash: () => getL2MessageHash,
|
|
3191
3200
|
getSelector: () => getSelector,
|
|
3192
3201
|
getSelectorFromName: () => getSelectorFromName,
|
|
@@ -4639,6 +4648,11 @@ var RpcChannel = class {
|
|
|
4639
4648
|
fee_data_availability_mode: details.feeDataAvailabilityMode
|
|
4640
4649
|
}
|
|
4641
4650
|
});
|
|
4651
|
+
assertX(!details.maxFee, () => {
|
|
4652
|
+
logger.warn(SYSTEM_MESSAGES.maxFeeInV3, {
|
|
4653
|
+
type: RPCSPEC07.ETransactionType.INVOKE
|
|
4654
|
+
});
|
|
4655
|
+
});
|
|
4642
4656
|
}
|
|
4643
4657
|
return this.waitMode ? this.waitForTransaction((await promise).transaction_hash) : promise;
|
|
4644
4658
|
}
|
|
@@ -4709,6 +4723,11 @@ var RpcChannel = class {
|
|
|
4709
4723
|
fee_data_availability_mode: details.feeDataAvailabilityMode
|
|
4710
4724
|
}
|
|
4711
4725
|
});
|
|
4726
|
+
assertX(!details.maxFee, () => {
|
|
4727
|
+
logger.warn(SYSTEM_MESSAGES.maxFeeInV3, {
|
|
4728
|
+
type: RPCSPEC07.ETransactionType.DECLARE
|
|
4729
|
+
});
|
|
4730
|
+
});
|
|
4712
4731
|
} else {
|
|
4713
4732
|
throw Error("declare unspotted parameters");
|
|
4714
4733
|
}
|
|
@@ -4750,6 +4769,11 @@ var RpcChannel = class {
|
|
|
4750
4769
|
fee_data_availability_mode: details.feeDataAvailabilityMode
|
|
4751
4770
|
}
|
|
4752
4771
|
});
|
|
4772
|
+
assertX(!details.maxFee, () => {
|
|
4773
|
+
logger.warn(SYSTEM_MESSAGES.maxFeeInV3, {
|
|
4774
|
+
type: RPCSPEC07.ETransactionType.DEPLOY_ACCOUNT
|
|
4775
|
+
});
|
|
4776
|
+
});
|
|
4753
4777
|
}
|
|
4754
4778
|
return this.waitMode ? this.waitForTransaction((await promise).transaction_hash) : promise;
|
|
4755
4779
|
}
|
|
@@ -4820,6 +4844,12 @@ var RpcChannel = class {
|
|
|
4820
4844
|
fee_data_availability_mode: invocation.feeDataAvailabilityMode,
|
|
4821
4845
|
account_deployment_data: invocation.accountDeploymentData.map((it) => toHex(it))
|
|
4822
4846
|
};
|
|
4847
|
+
assertX(!invocation.maxFee, () => {
|
|
4848
|
+
logger.warn(SYSTEM_MESSAGES.maxFeeInV3, {
|
|
4849
|
+
type: invocation.type,
|
|
4850
|
+
versionType
|
|
4851
|
+
});
|
|
4852
|
+
});
|
|
4823
4853
|
}
|
|
4824
4854
|
if (invocation.type === TransactionType.INVOKE) {
|
|
4825
4855
|
return {
|
|
@@ -8883,19 +8913,20 @@ function mergeAbiEvents(target, source) {
|
|
|
8883
8913
|
}
|
|
8884
8914
|
function parseEvents(providerReceivedEvents, abiEvents, abiStructs, abiEnums) {
|
|
8885
8915
|
const ret = providerReceivedEvents.flat().reduce((acc, recEvent) => {
|
|
8886
|
-
|
|
8916
|
+
const currentEvent = JSON.parse(JSON.stringify(recEvent));
|
|
8917
|
+
let abiEvent = abiEvents[currentEvent.keys.shift() ?? 0];
|
|
8887
8918
|
if (!abiEvent) {
|
|
8888
8919
|
return acc;
|
|
8889
8920
|
}
|
|
8890
8921
|
while (!abiEvent.name) {
|
|
8891
|
-
const hashName =
|
|
8922
|
+
const hashName = currentEvent.keys.shift();
|
|
8892
8923
|
assert(!!hashName, 'Not enough data in "keys" property of this event.');
|
|
8893
8924
|
abiEvent = abiEvent[hashName];
|
|
8894
8925
|
}
|
|
8895
8926
|
const parsedEvent = {};
|
|
8896
8927
|
parsedEvent[abiEvent.name] = {};
|
|
8897
|
-
const keysIter =
|
|
8898
|
-
const dataIter =
|
|
8928
|
+
const keysIter = currentEvent.keys[Symbol.iterator]();
|
|
8929
|
+
const dataIter = currentEvent.data[Symbol.iterator]();
|
|
8899
8930
|
const abiEventKeys = abiEvent.members?.filter((it) => it.kind === "key") || abiEvent.keys;
|
|
8900
8931
|
const abiEventData = abiEvent.members?.filter((it) => it.kind === "data") || abiEvent.data;
|
|
8901
8932
|
abiEventKeys.forEach((key) => {
|
|
@@ -8916,9 +8947,10 @@ function parseEvents(providerReceivedEvents, abiEvents, abiStructs, abiEnums) {
|
|
|
8916
8947
|
parsedEvent[abiEvent.name]
|
|
8917
8948
|
);
|
|
8918
8949
|
});
|
|
8919
|
-
if ("block_hash" in
|
|
8920
|
-
if ("block_number" in
|
|
8921
|
-
if ("transaction_hash" in
|
|
8950
|
+
if ("block_hash" in currentEvent) parsedEvent.block_hash = currentEvent.block_hash;
|
|
8951
|
+
if ("block_number" in currentEvent) parsedEvent.block_number = currentEvent.block_number;
|
|
8952
|
+
if ("transaction_hash" in currentEvent)
|
|
8953
|
+
parsedEvent.transaction_hash = currentEvent.transaction_hash;
|
|
8922
8954
|
acc.push(parsedEvent);
|
|
8923
8955
|
return acc;
|
|
8924
8956
|
}, []);
|
|
@@ -8952,8 +8984,19 @@ __export(outsideExecution_exports, {
|
|
|
8952
8984
|
buildExecuteFromOutsideCall: () => buildExecuteFromOutsideCall,
|
|
8953
8985
|
buildExecuteFromOutsideCallData: () => buildExecuteFromOutsideCallData,
|
|
8954
8986
|
getOutsideCall: () => getOutsideCall,
|
|
8955
|
-
getTypedData: () => getTypedData
|
|
8987
|
+
getTypedData: () => getTypedData,
|
|
8988
|
+
toOutsideCallV2: () => toOutsideCallV2
|
|
8956
8989
|
});
|
|
8990
|
+
function toOutsideCallV2(call) {
|
|
8991
|
+
if ("calldata_len" in call) {
|
|
8992
|
+
return {
|
|
8993
|
+
To: call.to,
|
|
8994
|
+
Selector: call.selector,
|
|
8995
|
+
Calldata: call.calldata
|
|
8996
|
+
};
|
|
8997
|
+
}
|
|
8998
|
+
return call;
|
|
8999
|
+
}
|
|
8957
9000
|
function getOutsideCall(call) {
|
|
8958
9001
|
const callData = call.calldata ?? [];
|
|
8959
9002
|
const callDataCompiled = Array.isArray(callData) ? callData : CallData.compile(callData);
|
|
@@ -9063,6 +9106,8 @@ async function supportsInterface(provider, contractAddress, interfaceId) {
|
|
|
9063
9106
|
// src/utils/paymaster.ts
|
|
9064
9107
|
var paymaster_exports = {};
|
|
9065
9108
|
__export(paymaster_exports, {
|
|
9109
|
+
assertCallsAreStrictlyEqual: () => assertCallsAreStrictlyEqual,
|
|
9110
|
+
assertPaymasterTransactionSafety: () => assertPaymasterTransactionSafety,
|
|
9066
9111
|
getDefaultPaymasterNodeUrl: () => getDefaultPaymasterNodeUrl
|
|
9067
9112
|
});
|
|
9068
9113
|
var getDefaultPaymasterNodeUrl = (networkName, mute = false) => {
|
|
@@ -9073,6 +9118,79 @@ var getDefaultPaymasterNodeUrl = (networkName, mute = false) => {
|
|
|
9073
9118
|
const randIdx = Math.floor(Math.random() * nodes.length);
|
|
9074
9119
|
return nodes[randIdx];
|
|
9075
9120
|
};
|
|
9121
|
+
var assertGasFeeFromUnsafeCalls = (unsafeCalls, fees) => {
|
|
9122
|
+
const unsafeCall = toOutsideCallV2(unsafeCalls[unsafeCalls.length - 1]);
|
|
9123
|
+
const unsafeGasTokenCalldata = CallData.toCalldata(unsafeCall.Calldata);
|
|
9124
|
+
const unsafeGasTokenValue = unsafeGasTokenCalldata[1];
|
|
9125
|
+
assert(
|
|
9126
|
+
BigInt(unsafeGasTokenValue) === BigInt(fees),
|
|
9127
|
+
"Gas token value is not equal to the provided gas fees"
|
|
9128
|
+
);
|
|
9129
|
+
};
|
|
9130
|
+
var assertGasTokenFromUnsafeCalls = (unsafeCalls, gasToken) => {
|
|
9131
|
+
const unsafeCall = toOutsideCallV2(unsafeCalls[unsafeCalls.length - 1]);
|
|
9132
|
+
assert(
|
|
9133
|
+
BigInt(unsafeCall.To) === BigInt(gasToken),
|
|
9134
|
+
"Gas token address is not equal to the provided gas token"
|
|
9135
|
+
);
|
|
9136
|
+
};
|
|
9137
|
+
function assertCallsAreStrictlyEqual(originalCalls, unsafeCalls) {
|
|
9138
|
+
const baseError = "Provided calls are not strictly equal to the returned calls";
|
|
9139
|
+
assert(
|
|
9140
|
+
unsafeCalls.length - 1 === originalCalls.length,
|
|
9141
|
+
`${baseError}: Expected ${originalCalls.length + 1} calls, got ${unsafeCalls.length}`
|
|
9142
|
+
);
|
|
9143
|
+
for (let callIndex = 0; callIndex < originalCalls.length; callIndex += 1) {
|
|
9144
|
+
const originalCall = originalCalls[callIndex];
|
|
9145
|
+
const unsafeCall = toOutsideCallV2(unsafeCalls[callIndex]);
|
|
9146
|
+
const normalizeAddress = (address) => {
|
|
9147
|
+
return toBigInt(address).toString(16).toLowerCase();
|
|
9148
|
+
};
|
|
9149
|
+
const originalAddress = normalizeAddress(originalCall.contractAddress);
|
|
9150
|
+
const unsafeAddress = normalizeAddress(unsafeCall.To);
|
|
9151
|
+
assert(
|
|
9152
|
+
originalAddress === unsafeAddress,
|
|
9153
|
+
`${baseError}: Contract address mismatch at call ${callIndex}. Expected: ${originalCall.contractAddress}, Got: ${unsafeCall.To}`
|
|
9154
|
+
);
|
|
9155
|
+
assert(
|
|
9156
|
+
getSelectorFromName(originalCall.entrypoint) === unsafeCall.Selector,
|
|
9157
|
+
`${baseError}: Entrypoint mismatch at call ${callIndex}. Expected: ${originalCall.entrypoint}, Got: ${unsafeCall.Selector}`
|
|
9158
|
+
);
|
|
9159
|
+
const originalCalldata = CallData.toCalldata(originalCall.calldata);
|
|
9160
|
+
const unsafeCalldata = CallData.toCalldata(unsafeCall.Calldata);
|
|
9161
|
+
assert(
|
|
9162
|
+
originalCalldata.length === unsafeCalldata.length,
|
|
9163
|
+
`${baseError}: Calldata length mismatch at call ${callIndex}. Expected length: ${originalCalldata.length}, Got length: ${unsafeCalldata.length}`
|
|
9164
|
+
);
|
|
9165
|
+
for (let dataIndex = 0; dataIndex < originalCalldata.length; dataIndex += 1) {
|
|
9166
|
+
const originalValue = BigInt(originalCalldata[dataIndex]);
|
|
9167
|
+
const unsafeValue = BigInt(unsafeCalldata[dataIndex]);
|
|
9168
|
+
assert(
|
|
9169
|
+
originalValue === unsafeValue,
|
|
9170
|
+
`${baseError}: Calldata value mismatch at call ${callIndex}, parameter ${dataIndex}. Expected: ${originalCalldata[dataIndex]}, Got: ${unsafeCalldata[dataIndex]}`
|
|
9171
|
+
);
|
|
9172
|
+
}
|
|
9173
|
+
}
|
|
9174
|
+
}
|
|
9175
|
+
var assertPaymasterTransactionSafety = (preparedTransaction, calls, paymasterDetails, maxFeeInGasToken) => {
|
|
9176
|
+
if (paymasterDetails.feeMode.mode !== "sponsored") {
|
|
9177
|
+
if (preparedTransaction.type === "invoke" || preparedTransaction.type === "deploy_and_invoke") {
|
|
9178
|
+
const unsafeCalls = "calls" in preparedTransaction.typed_data.message ? preparedTransaction.typed_data.message.calls : preparedTransaction.typed_data.message.Calls;
|
|
9179
|
+
assertCallsAreStrictlyEqual(calls, unsafeCalls);
|
|
9180
|
+
assertGasTokenFromUnsafeCalls(unsafeCalls, paymasterDetails.feeMode.gasToken);
|
|
9181
|
+
if (maxFeeInGasToken) {
|
|
9182
|
+
assert(
|
|
9183
|
+
preparedTransaction.fee.suggested_max_fee_in_gas_token <= maxFeeInGasToken,
|
|
9184
|
+
"Gas token price is too high"
|
|
9185
|
+
);
|
|
9186
|
+
assertGasFeeFromUnsafeCalls(
|
|
9187
|
+
unsafeCalls,
|
|
9188
|
+
preparedTransaction.fee.suggested_max_fee_in_gas_token
|
|
9189
|
+
);
|
|
9190
|
+
}
|
|
9191
|
+
}
|
|
9192
|
+
}
|
|
9193
|
+
};
|
|
9076
9194
|
|
|
9077
9195
|
// src/paymaster/rpc.ts
|
|
9078
9196
|
var convertCalls = (calls) => calls.map((call) => ({
|
|
@@ -9092,13 +9210,14 @@ var convertFEE_MODE = (feeMode) => {
|
|
|
9092
9210
|
}
|
|
9093
9211
|
return { mode: "default", gasToken: feeMode.gas_token };
|
|
9094
9212
|
};
|
|
9095
|
-
var convertTimeBounds = (timeBounds) => timeBounds
|
|
9096
|
-
execute_after: timeBounds.executeAfter
|
|
9097
|
-
|
|
9213
|
+
var convertTimeBounds = (timeBounds) => timeBounds ? {
|
|
9214
|
+
execute_after: timeBounds.executeAfter || 1,
|
|
9215
|
+
// If executeAfter is not provided, set it to 1, meaning the transaction can be executed immediately
|
|
9216
|
+
execute_before: timeBounds.executeBefore
|
|
9098
9217
|
} : void 0;
|
|
9099
|
-
var convertTIME_BOUNDS = (timeBounds) => timeBounds
|
|
9100
|
-
executeAfter:
|
|
9101
|
-
executeBefore:
|
|
9218
|
+
var convertTIME_BOUNDS = (timeBounds) => timeBounds ? {
|
|
9219
|
+
executeAfter: timeBounds.execute_after,
|
|
9220
|
+
executeBefore: timeBounds.execute_before
|
|
9102
9221
|
} : void 0;
|
|
9103
9222
|
var convertEXECUTION_PARAMETERS = (parameters) => ({
|
|
9104
9223
|
version: parameters.version,
|
|
@@ -9511,13 +9630,6 @@ var Account = class extends RpcProvider2 {
|
|
|
9511
9630
|
}
|
|
9512
9631
|
async execute(transactions, transactionsDetail = {}) {
|
|
9513
9632
|
const calls = Array.isArray(transactions) ? transactions : [transactions];
|
|
9514
|
-
if (transactionsDetail.paymaster) {
|
|
9515
|
-
return this.executePaymasterTransaction(
|
|
9516
|
-
calls,
|
|
9517
|
-
transactionsDetail.paymaster,
|
|
9518
|
-
transactionsDetail.maxFee
|
|
9519
|
-
);
|
|
9520
|
-
}
|
|
9521
9633
|
const nonce = toBigInt(transactionsDetail.nonce ?? await this.getNonce());
|
|
9522
9634
|
const version = toTransactionVersion(
|
|
9523
9635
|
this.getPreferredVersion(ETransactionVersion2.V1, ETransactionVersion2.V3),
|
|
@@ -9594,11 +9706,7 @@ var Account = class extends RpcProvider2 {
|
|
|
9594
9706
|
const preparedTransaction = await this.buildPaymasterTransaction(calls, paymasterDetails);
|
|
9595
9707
|
return preparedTransaction.fee;
|
|
9596
9708
|
}
|
|
9597
|
-
async
|
|
9598
|
-
const preparedTransaction = await this.buildPaymasterTransaction(calls, paymasterDetails);
|
|
9599
|
-
if (maxFee && preparedTransaction.fee.gas_token_price_in_strk > maxFee) {
|
|
9600
|
-
throw Error("Gas token price is too high");
|
|
9601
|
-
}
|
|
9709
|
+
async preparePaymasterTransaction(preparedTransaction) {
|
|
9602
9710
|
let transaction;
|
|
9603
9711
|
switch (preparedTransaction.type) {
|
|
9604
9712
|
case "deploy_and_invoke": {
|
|
@@ -9636,6 +9744,17 @@ var Account = class extends RpcProvider2 {
|
|
|
9636
9744
|
default:
|
|
9637
9745
|
throw Error("Invalid transaction type");
|
|
9638
9746
|
}
|
|
9747
|
+
return transaction;
|
|
9748
|
+
}
|
|
9749
|
+
async executePaymasterTransaction(calls, paymasterDetails, maxFeeInGasToken) {
|
|
9750
|
+
const preparedTransaction = await this.buildPaymasterTransaction(calls, paymasterDetails);
|
|
9751
|
+
assertPaymasterTransactionSafety(
|
|
9752
|
+
preparedTransaction,
|
|
9753
|
+
calls,
|
|
9754
|
+
paymasterDetails,
|
|
9755
|
+
maxFeeInGasToken
|
|
9756
|
+
);
|
|
9757
|
+
const transaction = await this.preparePaymasterTransaction(preparedTransaction);
|
|
9639
9758
|
return this.paymaster.executeTransaction(transaction, preparedTransaction.parameters).then((response) => ({ transaction_hash: response.transaction_hash }));
|
|
9640
9759
|
}
|
|
9641
9760
|
/**
|
|
@@ -10226,14 +10345,7 @@ var WalletAccount = class _WalletAccount extends Account {
|
|
|
10226
10345
|
/**
|
|
10227
10346
|
* ACCOUNT METHODS
|
|
10228
10347
|
*/
|
|
10229
|
-
execute(calls
|
|
10230
|
-
const details = arg2 === void 0 || Array.isArray(arg2) ? transactionsDetail : arg2;
|
|
10231
|
-
if (details.paymaster) {
|
|
10232
|
-
return this.executePaymasterTransaction(
|
|
10233
|
-
Array.isArray(calls) ? calls : [calls],
|
|
10234
|
-
details.paymaster
|
|
10235
|
-
);
|
|
10236
|
-
}
|
|
10348
|
+
execute(calls) {
|
|
10237
10349
|
const txCalls = [].concat(calls).map((it) => {
|
|
10238
10350
|
const { contractAddress, entrypoint, calldata } = it;
|
|
10239
10351
|
return {
|