@safe-global/relay-kit 4.0.4 → 4.1.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.
@@ -35,6 +35,7 @@ __export(src_exports, {
35
35
  DUMMY_CLIENT_DATA_FIELDS: () => DUMMY_CLIENT_DATA_FIELDS,
36
36
  EQ_OR_GT_0_3_0: () => EQ_OR_GT_0_3_0,
37
37
  GelatoRelayPack: () => GelatoRelayPack,
38
+ GenericFeeEstimator: () => GenericFeeEstimator,
38
39
  PimlicoFeeEstimator: () => PimlicoFeeEstimator,
39
40
  RelayKitBasePack: () => RelayKitBasePack,
40
41
  Safe4337Pack: () => Safe4337Pack,
@@ -411,12 +412,12 @@ var GelatoRelayPack = class extends RelayKitBasePack {
411
412
  };
412
413
 
413
414
  // src/packs/safe-4337/Safe4337Pack.ts
414
- var import_viem8 = require("viem");
415
+ var import_viem9 = require("viem");
415
416
  var import_satisfies = __toESM(require("semver/functions/satisfies.js"));
416
417
  var import_protocol_kit5 = __toESM(require("@safe-global/protocol-kit"));
417
418
  var import_types_kit3 = require("@safe-global/types-kit");
418
419
  var import_safe_modules_deployments = require("@safe-global/safe-modules-deployments");
419
- var import_viem9 = require("viem");
420
+ var import_viem10 = require("viem");
420
421
 
421
422
  // src/packs/safe-4337/BaseSafeOperation.ts
422
423
  var import_viem = require("viem");
@@ -776,9 +777,9 @@ async function createUserOperation(protocolKit, transactions, {
776
777
  nonce: nonce.toString(),
777
778
  initCode,
778
779
  callData,
779
- callGasLimit: 1n,
780
- verificationGasLimit: 1n,
781
- preVerificationGas: 1n,
780
+ callGasLimit: 0n,
781
+ verificationGasLimit: 0n,
782
+ preVerificationGas: 0n,
782
783
  maxFeePerGas: 1n,
783
784
  maxPriorityFeePerGas: 1n,
784
785
  paymasterAndData,
@@ -790,9 +791,9 @@ async function createUserOperation(protocolKit, transactions, {
790
791
  nonce: nonce.toString(),
791
792
  ...unpackInitCode(initCode),
792
793
  callData,
793
- callGasLimit: 1n,
794
- verificationGasLimit: 1n,
795
- preVerificationGas: 1n,
794
+ callGasLimit: 0n,
795
+ verificationGasLimit: 0n,
796
+ preVerificationGas: 0n,
796
797
  maxFeePerGas: 1n,
797
798
  maxPriorityFeePerGas: 1n,
798
799
  paymaster: paymasterAndData,
@@ -823,7 +824,7 @@ function userOperationToHexValues(userOperation, entryPointAddress) {
823
824
  }
824
825
 
825
826
  // src/packs/safe-4337/utils/getRelayKitVersion.ts
826
- var getRelayKitVersion = () => "4.0.4";
827
+ var getRelayKitVersion = () => "4.1.0";
827
828
 
828
829
  // src/packs/safe-4337/utils/encodeNonce.ts
829
830
  var import_viem6 = require("viem");
@@ -871,16 +872,18 @@ var SafeOperationFactory = class {
871
872
  var SafeOperationFactory_default = SafeOperationFactory;
872
873
 
873
874
  // src/packs/safe-4337/estimators/pimlico/PimlicoFeeEstimator.ts
875
+ var import_viem8 = require("viem");
874
876
  var PimlicoFeeEstimator = class {
875
877
  async preEstimateUserOperationGas({
876
878
  bundlerUrl,
877
879
  userOperation,
878
880
  entryPoint,
879
- paymasterOptions
881
+ paymasterOptions,
882
+ protocolKit
880
883
  }) {
881
884
  const bundlerClient = createBundlerClient(bundlerUrl);
882
885
  const feeData = await this.#getUserOperationGasPrices(bundlerClient);
883
- const chainId = await this.#getChainId(bundlerClient);
886
+ const chainId = await protocolKit.getChainId();
884
887
  let paymasterStubData = {};
885
888
  if (paymasterOptions) {
886
889
  const paymasterClient = createBundlerClient(
@@ -891,7 +894,12 @@ var PimlicoFeeEstimator = class {
891
894
  } : void 0;
892
895
  paymasterStubData = await paymasterClient.request({
893
896
  method: "pm_getPaymasterStubData" /* GET_PAYMASTER_STUB_DATA */,
894
- params: [userOperationToHexValues(userOperation, entryPoint), entryPoint, chainId, context]
897
+ params: [
898
+ userOperationToHexValues(userOperation, entryPoint),
899
+ entryPoint,
900
+ (0, import_viem8.toHex)(chainId),
901
+ context
902
+ ]
895
903
  });
896
904
  }
897
905
  return {
@@ -902,7 +910,8 @@ var PimlicoFeeEstimator = class {
902
910
  async postEstimateUserOperationGas({
903
911
  userOperation,
904
912
  entryPoint,
905
- paymasterOptions
913
+ paymasterOptions,
914
+ protocolKit
906
915
  }) {
907
916
  if (!paymasterOptions) return {};
908
917
  const paymasterClient = createBundlerClient(
@@ -924,13 +933,13 @@ var PimlicoFeeEstimator = class {
924
933
  });
925
934
  return sponsoredData;
926
935
  }
927
- const chainId = await this.#getChainId(paymasterClient);
936
+ const chainId = await protocolKit.getChainId();
928
937
  const erc20PaymasterData = await paymasterClient.request({
929
938
  method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
930
939
  params: [
931
940
  userOperationToHexValues(userOperation, entryPoint),
932
941
  entryPoint,
933
- chainId,
942
+ (0, import_viem8.toHex)(chainId),
934
943
  { token: paymasterOptions.paymasterTokenAddress }
935
944
  ]
936
945
  });
@@ -948,10 +957,6 @@ var PimlicoFeeEstimator = class {
948
957
  maxPriorityFeePerGas
949
958
  };
950
959
  }
951
- async #getChainId(client) {
952
- const chainId = await client.request({ method: "eth_chainId" });
953
- return chainId;
954
- }
955
960
  };
956
961
 
957
962
  // src/packs/safe-4337/Safe4337Pack.ts
@@ -1084,7 +1089,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1084
1089
  const enable4337ModuleTransaction = {
1085
1090
  to: safeModulesSetupAddress,
1086
1091
  value: "0",
1087
- data: (0, import_viem9.encodeFunctionData)({
1092
+ data: (0, import_viem10.encodeFunctionData)({
1088
1093
  abi: ABI,
1089
1094
  functionName: "enableModules",
1090
1095
  args: [[safe4337ModuleAddress]]
@@ -1098,7 +1103,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1098
1103
  const { paymasterAddress, amountToApprove = MAX_ERC20_AMOUNT_TO_APPROVE } = paymasterOptions;
1099
1104
  const approveToPaymasterTransaction = {
1100
1105
  to: paymasterOptions.paymasterTokenAddress,
1101
- data: (0, import_viem9.encodeFunctionData)({
1106
+ data: (0, import_viem10.encodeFunctionData)({
1102
1107
  abi: ABI,
1103
1108
  functionName: "approve",
1104
1109
  args: [paymasterAddress, amountToApprove]
@@ -1124,8 +1129,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1124
1129
  throw new Error(`safeWebAuthnSharedSignerAddress not available for chain ${network}`);
1125
1130
  }
1126
1131
  const passkeySigner = await safeProvider.getExternalSigner();
1127
- const checkSummedOwners = options.owners.map((owner) => (0, import_viem8.getAddress)(owner));
1128
- const checkSummedSignerAddress = (0, import_viem8.getAddress)(safeWebAuthnSharedSignerAddress);
1132
+ const checkSummedOwners = options.owners.map((owner) => (0, import_viem9.getAddress)(owner));
1133
+ const checkSummedSignerAddress = (0, import_viem9.getAddress)(safeWebAuthnSharedSignerAddress);
1129
1134
  if (!checkSummedOwners.includes(checkSummedSignerAddress)) {
1130
1135
  options.owners.push(checkSummedSignerAddress);
1131
1136
  }
@@ -1147,7 +1152,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1147
1152
  safeVersion,
1148
1153
  deploymentType: options.deploymentType || void 0
1149
1154
  });
1150
- const batchData = (0, import_viem9.encodeFunctionData)({
1155
+ const batchData = (0, import_viem10.encodeFunctionData)({
1151
1156
  abi: ABI,
1152
1157
  functionName: "multiSend",
1153
1158
  args: [(0, import_protocol_kit5.encodeMultiSendData)(setupTransactions)]
@@ -1173,9 +1178,9 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1173
1178
  to: deploymentTo,
1174
1179
  data: deploymentData,
1175
1180
  fallbackHandler: safe4337ModuleAddress,
1176
- paymentToken: import_viem9.zeroAddress,
1181
+ paymentToken: import_viem10.zeroAddress,
1177
1182
  payment: 0,
1178
- paymentReceiver: import_viem9.zeroAddress
1183
+ paymentReceiver: import_viem10.zeroAddress
1179
1184
  }
1180
1185
  },
1181
1186
  onchainAnalytics
@@ -1235,7 +1240,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1235
1240
  bundlerUrl: this.#BUNDLER_URL,
1236
1241
  entryPoint: this.#ENTRYPOINT_ADDRESS,
1237
1242
  userOperation: safeOperation.getUserOperation(),
1238
- paymasterOptions: this.#paymasterOptions
1243
+ paymasterOptions: this.#paymasterOptions,
1244
+ protocolKit: this.protocolKit
1239
1245
  });
1240
1246
  if (preEstimationData) {
1241
1247
  safeOperation.addEstimations(preEstimationData);
@@ -1260,7 +1266,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1260
1266
  ...safeOperation.getUserOperation(),
1261
1267
  signature: getDummySignature(this.#SAFE_WEBAUTHN_SHARED_SIGNER_ADDRESS, threshold)
1262
1268
  },
1263
- paymasterOptions: this.#paymasterOptions
1269
+ paymasterOptions: this.#paymasterOptions,
1270
+ protocolKit: this.protocolKit
1264
1271
  });
1265
1272
  if (postEstimationData) {
1266
1273
  safeOperation.addEstimations(postEstimationData);
@@ -1321,7 +1328,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1321
1328
  preVerificationGas: BigInt(userOperation?.preVerificationGas || 0),
1322
1329
  maxFeePerGas: BigInt(userOperation?.maxFeePerGas || 0),
1323
1330
  maxPriorityFeePerGas: BigInt(userOperation?.maxPriorityFeePerGas || 0),
1324
- paymasterAndData: (0, import_viem9.concat)([paymaster, paymasterData]),
1331
+ paymasterAndData: (0, import_viem10.concat)([paymaster, paymasterData]),
1325
1332
  signature: safeOperationResponse.preparedSignature || "0x"
1326
1333
  },
1327
1334
  {
@@ -1408,10 +1415,10 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1408
1415
  message: {
1409
1416
  ...safeOperation2,
1410
1417
  nonce: BigInt(safeOperation2.nonce),
1411
- validAfter: (0, import_viem8.toHex)(safeOperation2.validAfter),
1412
- validUntil: (0, import_viem8.toHex)(safeOperation2.validUntil),
1413
- maxFeePerGas: (0, import_viem8.toHex)(safeOperation2.maxFeePerGas),
1414
- maxPriorityFeePerGas: (0, import_viem8.toHex)(safeOperation2.maxPriorityFeePerGas)
1418
+ validAfter: (0, import_viem9.toHex)(safeOperation2.validAfter),
1419
+ validUntil: (0, import_viem9.toHex)(safeOperation2.validUntil),
1420
+ maxFeePerGas: (0, import_viem9.toHex)(safeOperation2.maxFeePerGas),
1421
+ maxPriorityFeePerGas: (0, import_viem9.toHex)(safeOperation2.maxPriorityFeePerGas)
1415
1422
  },
1416
1423
  primaryType: "SafeOp"
1417
1424
  });
@@ -1495,3 +1502,126 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1495
1502
  return this.#onchainIdentifier;
1496
1503
  }
1497
1504
  };
1505
+
1506
+ // src/packs/safe-4337/estimators/generic/GenericFeeEstimator.ts
1507
+ var import_viem11 = require("viem");
1508
+ var GenericFeeEstimator = class {
1509
+ constructor(rpcUrl, overrides = {}) {
1510
+ this.defaultVerificationGasLimitOverhead = overrides.defaultVerificationGasLimitOverhead ?? 35000n;
1511
+ this.overrides = overrides;
1512
+ this.rpcUrl = rpcUrl;
1513
+ }
1514
+ async preEstimateUserOperationGas({
1515
+ userOperation,
1516
+ entryPoint,
1517
+ paymasterOptions,
1518
+ protocolKit
1519
+ }) {
1520
+ let feeDataRes = {};
1521
+ let paymasterStubDataRes = {};
1522
+ if (paymasterOptions) {
1523
+ const chainId = await protocolKit.getChainId();
1524
+ const paymasterClient = createBundlerClient(paymasterOptions.paymasterUrl);
1525
+ const context = "paymasterTokenAddress" in paymasterOptions ? {
1526
+ token: paymasterOptions.paymasterTokenAddress
1527
+ } : paymasterOptions.paymasterContext ?? {};
1528
+ const [feeData, paymasterStubData] = await Promise.all([
1529
+ this.#getUserOperationGasPrices(this.rpcUrl),
1530
+ paymasterClient.request({
1531
+ method: "pm_getPaymasterStubData" /* GET_PAYMASTER_STUB_DATA */,
1532
+ params: [
1533
+ userOperationToHexValues(userOperation, entryPoint),
1534
+ entryPoint,
1535
+ (0, import_viem11.toHex)(chainId),
1536
+ context
1537
+ ]
1538
+ })
1539
+ ]);
1540
+ feeDataRes = feeData;
1541
+ paymasterStubDataRes = paymasterStubData;
1542
+ } else {
1543
+ const feeData = await this.#getUserOperationGasPrices(this.rpcUrl);
1544
+ feeDataRes = feeData;
1545
+ }
1546
+ feeDataRes.callGasLimit = this.overrides.callGasLimit ?? feeDataRes.callGasLimit;
1547
+ feeDataRes.verificationGasLimit = this.overrides.verificationGasLimit ?? feeDataRes.verificationGasLimit;
1548
+ feeDataRes.preVerificationGas = this.overrides.preVerificationGas ?? feeDataRes.preVerificationGas;
1549
+ feeDataRes.maxFeePerGas = this.overrides.maxFeePerGas ?? feeDataRes.maxFeePerGas;
1550
+ feeDataRes.maxPriorityFeePerGas = this.overrides.maxPriorityFeePerGas ?? feeDataRes.maxPriorityFeePerGas;
1551
+ const result = {
1552
+ ...feeDataRes,
1553
+ ...paymasterStubDataRes
1554
+ };
1555
+ if (result.verificationGasLimit != null) {
1556
+ const threshold = await protocolKit.getThreshold();
1557
+ result.verificationGasLimit = (BigInt(result.verificationGasLimit) + BigInt(threshold) * this.defaultVerificationGasLimitOverhead).toString();
1558
+ }
1559
+ return result;
1560
+ }
1561
+ async postEstimateUserOperationGas({
1562
+ userOperation,
1563
+ entryPoint,
1564
+ paymasterOptions,
1565
+ protocolKit
1566
+ }) {
1567
+ if (protocolKit == null) {
1568
+ throw new Error("Can't use GenericFeeEstimator if protocolKit is null.");
1569
+ }
1570
+ if (!paymasterOptions) return {};
1571
+ const paymasterClient = createBundlerClient(paymasterOptions.paymasterUrl);
1572
+ const chainId = await protocolKit.getChainId();
1573
+ if (paymasterOptions.isSponsored) {
1574
+ const params = [
1575
+ userOperationToHexValues(userOperation, entryPoint),
1576
+ entryPoint,
1577
+ (0, import_viem11.toHex)(chainId)
1578
+ ];
1579
+ if (paymasterOptions.paymasterContext) {
1580
+ params.push(paymasterOptions.paymasterContext);
1581
+ }
1582
+ const sponsoredData = await paymasterClient.request({
1583
+ method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
1584
+ params
1585
+ });
1586
+ return sponsoredData;
1587
+ }
1588
+ const erc20PaymasterData = await paymasterClient.request({
1589
+ method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
1590
+ params: [
1591
+ userOperationToHexValues(userOperation, entryPoint),
1592
+ entryPoint,
1593
+ (0, import_viem11.toHex)(chainId),
1594
+ { token: paymasterOptions.paymasterTokenAddress }
1595
+ ]
1596
+ });
1597
+ if ("verificationGasLimit" in erc20PaymasterData && erc20PaymasterData.verificationGasLimit != null) {
1598
+ const threshold = await protocolKit.getThreshold();
1599
+ erc20PaymasterData.verificationGasLimit = (BigInt(erc20PaymasterData.verificationGasLimit) + BigInt(threshold) * this.defaultVerificationGasLimitOverhead).toString();
1600
+ }
1601
+ return erc20PaymasterData;
1602
+ }
1603
+ async #getUserOperationGasPrices(rpcUrl) {
1604
+ const client = (0, import_viem11.createPublicClient)({
1605
+ transport: (0, import_viem11.http)(rpcUrl)
1606
+ });
1607
+ const [block, maxPriorityFeePerGas] = await Promise.all([
1608
+ client.getBlock({ blockTag: "latest" }),
1609
+ client.estimateMaxPriorityFeePerGas()
1610
+ ]);
1611
+ const baseFeePerGas = block.baseFeePerGas;
1612
+ if (!baseFeePerGas) {
1613
+ throw new Error("Base fee not available - probably not an EIP-1559 block.");
1614
+ }
1615
+ const maxFeePerGas = baseFeePerGas + maxPriorityFeePerGas;
1616
+ return {
1617
+ maxFeePerGas: BigInt(
1618
+ Math.ceil(Number(maxFeePerGas) * (this.overrides.maxFeePerGasMultiplier ?? 1.5))
1619
+ ),
1620
+ maxPriorityFeePerGas: BigInt(
1621
+ Math.ceil(
1622
+ Number(maxPriorityFeePerGas) * (this.overrides.maxPriorityFeePerGasMultiplier ?? 1.5)
1623
+ )
1624
+ )
1625
+ };
1626
+ }
1627
+ };
@@ -222,10 +222,10 @@ var USER_OPERATION_GAS_PRICE = {
222
222
  };
223
223
 
224
224
  // test-utils/helpers.ts
225
- var import_viem10 = require("viem");
225
+ var import_viem11 = require("viem");
226
226
 
227
227
  // src/packs/safe-4337/Safe4337Pack.ts
228
- var import_viem8 = require("viem");
228
+ var import_viem9 = require("viem");
229
229
  var import_satisfies = __toESM(require("semver/functions/satisfies.js"));
230
230
  var import_protocol_kit4 = __toESM(require("@safe-global/protocol-kit"));
231
231
 
@@ -244,7 +244,7 @@ var RelayKitBasePack = class {
244
244
  // src/packs/safe-4337/Safe4337Pack.ts
245
245
  var import_types_kit4 = require("@safe-global/types-kit");
246
246
  var import_safe_modules_deployments = require("@safe-global/safe-modules-deployments");
247
- var import_viem9 = require("viem");
247
+ var import_viem10 = require("viem");
248
248
 
249
249
  // src/packs/safe-4337/BaseSafeOperation.ts
250
250
  var import_viem = require("viem");
@@ -615,9 +615,9 @@ async function createUserOperation(protocolKit, transactions, {
615
615
  nonce: nonce.toString(),
616
616
  initCode,
617
617
  callData,
618
- callGasLimit: 1n,
619
- verificationGasLimit: 1n,
620
- preVerificationGas: 1n,
618
+ callGasLimit: 0n,
619
+ verificationGasLimit: 0n,
620
+ preVerificationGas: 0n,
621
621
  maxFeePerGas: 1n,
622
622
  maxPriorityFeePerGas: 1n,
623
623
  paymasterAndData,
@@ -629,9 +629,9 @@ async function createUserOperation(protocolKit, transactions, {
629
629
  nonce: nonce.toString(),
630
630
  ...unpackInitCode(initCode),
631
631
  callData,
632
- callGasLimit: 1n,
633
- verificationGasLimit: 1n,
634
- preVerificationGas: 1n,
632
+ callGasLimit: 0n,
633
+ verificationGasLimit: 0n,
634
+ preVerificationGas: 0n,
635
635
  maxFeePerGas: 1n,
636
636
  maxPriorityFeePerGas: 1n,
637
637
  paymaster: paymasterAndData,
@@ -662,7 +662,7 @@ function userOperationToHexValues(userOperation, entryPointAddress) {
662
662
  }
663
663
 
664
664
  // src/packs/safe-4337/utils/getRelayKitVersion.ts
665
- var getRelayKitVersion = () => "4.0.4";
665
+ var getRelayKitVersion = () => "4.1.0";
666
666
 
667
667
  // src/packs/safe-4337/utils/encodeNonce.ts
668
668
  var import_viem6 = require("viem");
@@ -705,16 +705,18 @@ var SafeOperationFactory = class {
705
705
  var SafeOperationFactory_default = SafeOperationFactory;
706
706
 
707
707
  // src/packs/safe-4337/estimators/pimlico/PimlicoFeeEstimator.ts
708
+ var import_viem8 = require("viem");
708
709
  var PimlicoFeeEstimator = class {
709
710
  async preEstimateUserOperationGas({
710
711
  bundlerUrl,
711
712
  userOperation,
712
713
  entryPoint,
713
- paymasterOptions
714
+ paymasterOptions,
715
+ protocolKit
714
716
  }) {
715
717
  const bundlerClient = createBundlerClient(bundlerUrl);
716
718
  const feeData = await this.#getUserOperationGasPrices(bundlerClient);
717
- const chainId = await this.#getChainId(bundlerClient);
719
+ const chainId = await protocolKit.getChainId();
718
720
  let paymasterStubData = {};
719
721
  if (paymasterOptions) {
720
722
  const paymasterClient = createBundlerClient(
@@ -725,7 +727,12 @@ var PimlicoFeeEstimator = class {
725
727
  } : void 0;
726
728
  paymasterStubData = await paymasterClient.request({
727
729
  method: "pm_getPaymasterStubData" /* GET_PAYMASTER_STUB_DATA */,
728
- params: [userOperationToHexValues(userOperation, entryPoint), entryPoint, chainId, context]
730
+ params: [
731
+ userOperationToHexValues(userOperation, entryPoint),
732
+ entryPoint,
733
+ (0, import_viem8.toHex)(chainId),
734
+ context
735
+ ]
729
736
  });
730
737
  }
731
738
  return {
@@ -736,7 +743,8 @@ var PimlicoFeeEstimator = class {
736
743
  async postEstimateUserOperationGas({
737
744
  userOperation,
738
745
  entryPoint,
739
- paymasterOptions
746
+ paymasterOptions,
747
+ protocolKit
740
748
  }) {
741
749
  if (!paymasterOptions) return {};
742
750
  const paymasterClient = createBundlerClient(
@@ -758,13 +766,13 @@ var PimlicoFeeEstimator = class {
758
766
  });
759
767
  return sponsoredData;
760
768
  }
761
- const chainId = await this.#getChainId(paymasterClient);
769
+ const chainId = await protocolKit.getChainId();
762
770
  const erc20PaymasterData = await paymasterClient.request({
763
771
  method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
764
772
  params: [
765
773
  userOperationToHexValues(userOperation, entryPoint),
766
774
  entryPoint,
767
- chainId,
775
+ (0, import_viem8.toHex)(chainId),
768
776
  { token: paymasterOptions.paymasterTokenAddress }
769
777
  ]
770
778
  });
@@ -782,10 +790,6 @@ var PimlicoFeeEstimator = class {
782
790
  maxPriorityFeePerGas
783
791
  };
784
792
  }
785
- async #getChainId(client) {
786
- const chainId = await client.request({ method: "eth_chainId" });
787
- return chainId;
788
- }
789
793
  };
790
794
 
791
795
  // src/packs/safe-4337/Safe4337Pack.ts
@@ -918,7 +922,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
918
922
  const enable4337ModuleTransaction = {
919
923
  to: safeModulesSetupAddress,
920
924
  value: "0",
921
- data: (0, import_viem9.encodeFunctionData)({
925
+ data: (0, import_viem10.encodeFunctionData)({
922
926
  abi: ABI,
923
927
  functionName: "enableModules",
924
928
  args: [[safe4337ModuleAddress]]
@@ -932,7 +936,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
932
936
  const { paymasterAddress, amountToApprove = MAX_ERC20_AMOUNT_TO_APPROVE } = paymasterOptions;
933
937
  const approveToPaymasterTransaction = {
934
938
  to: paymasterOptions.paymasterTokenAddress,
935
- data: (0, import_viem9.encodeFunctionData)({
939
+ data: (0, import_viem10.encodeFunctionData)({
936
940
  abi: ABI,
937
941
  functionName: "approve",
938
942
  args: [paymasterAddress, amountToApprove]
@@ -958,8 +962,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
958
962
  throw new Error(`safeWebAuthnSharedSignerAddress not available for chain ${network}`);
959
963
  }
960
964
  const passkeySigner = await safeProvider.getExternalSigner();
961
- const checkSummedOwners = options.owners.map((owner) => (0, import_viem8.getAddress)(owner));
962
- const checkSummedSignerAddress = (0, import_viem8.getAddress)(safeWebAuthnSharedSignerAddress);
965
+ const checkSummedOwners = options.owners.map((owner) => (0, import_viem9.getAddress)(owner));
966
+ const checkSummedSignerAddress = (0, import_viem9.getAddress)(safeWebAuthnSharedSignerAddress);
963
967
  if (!checkSummedOwners.includes(checkSummedSignerAddress)) {
964
968
  options.owners.push(checkSummedSignerAddress);
965
969
  }
@@ -981,7 +985,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
981
985
  safeVersion,
982
986
  deploymentType: options.deploymentType || void 0
983
987
  });
984
- const batchData = (0, import_viem9.encodeFunctionData)({
988
+ const batchData = (0, import_viem10.encodeFunctionData)({
985
989
  abi: ABI,
986
990
  functionName: "multiSend",
987
991
  args: [(0, import_protocol_kit4.encodeMultiSendData)(setupTransactions)]
@@ -1007,9 +1011,9 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1007
1011
  to: deploymentTo,
1008
1012
  data: deploymentData,
1009
1013
  fallbackHandler: safe4337ModuleAddress,
1010
- paymentToken: import_viem9.zeroAddress,
1014
+ paymentToken: import_viem10.zeroAddress,
1011
1015
  payment: 0,
1012
- paymentReceiver: import_viem9.zeroAddress
1016
+ paymentReceiver: import_viem10.zeroAddress
1013
1017
  }
1014
1018
  },
1015
1019
  onchainAnalytics
@@ -1069,7 +1073,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1069
1073
  bundlerUrl: this.#BUNDLER_URL,
1070
1074
  entryPoint: this.#ENTRYPOINT_ADDRESS,
1071
1075
  userOperation: safeOperation.getUserOperation(),
1072
- paymasterOptions: this.#paymasterOptions
1076
+ paymasterOptions: this.#paymasterOptions,
1077
+ protocolKit: this.protocolKit
1073
1078
  });
1074
1079
  if (preEstimationData) {
1075
1080
  safeOperation.addEstimations(preEstimationData);
@@ -1094,7 +1099,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1094
1099
  ...safeOperation.getUserOperation(),
1095
1100
  signature: getDummySignature(this.#SAFE_WEBAUTHN_SHARED_SIGNER_ADDRESS, threshold)
1096
1101
  },
1097
- paymasterOptions: this.#paymasterOptions
1102
+ paymasterOptions: this.#paymasterOptions,
1103
+ protocolKit: this.protocolKit
1098
1104
  });
1099
1105
  if (postEstimationData) {
1100
1106
  safeOperation.addEstimations(postEstimationData);
@@ -1155,7 +1161,7 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1155
1161
  preVerificationGas: BigInt(userOperation?.preVerificationGas || 0),
1156
1162
  maxFeePerGas: BigInt(userOperation?.maxFeePerGas || 0),
1157
1163
  maxPriorityFeePerGas: BigInt(userOperation?.maxPriorityFeePerGas || 0),
1158
- paymasterAndData: (0, import_viem9.concat)([paymaster, paymasterData]),
1164
+ paymasterAndData: (0, import_viem10.concat)([paymaster, paymasterData]),
1159
1165
  signature: safeOperationResponse.preparedSignature || "0x"
1160
1166
  },
1161
1167
  {
@@ -1242,10 +1248,10 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1242
1248
  message: {
1243
1249
  ...safeOperation2,
1244
1250
  nonce: BigInt(safeOperation2.nonce),
1245
- validAfter: (0, import_viem8.toHex)(safeOperation2.validAfter),
1246
- validUntil: (0, import_viem8.toHex)(safeOperation2.validUntil),
1247
- maxFeePerGas: (0, import_viem8.toHex)(safeOperation2.maxFeePerGas),
1248
- maxPriorityFeePerGas: (0, import_viem8.toHex)(safeOperation2.maxPriorityFeePerGas)
1251
+ validAfter: (0, import_viem9.toHex)(safeOperation2.validAfter),
1252
+ validUntil: (0, import_viem9.toHex)(safeOperation2.validUntil),
1253
+ maxFeePerGas: (0, import_viem9.toHex)(safeOperation2.maxFeePerGas),
1254
+ maxPriorityFeePerGas: (0, import_viem9.toHex)(safeOperation2.maxPriorityFeePerGas)
1249
1255
  },
1250
1256
  primaryType: "SafeOp"
1251
1257
  });
@@ -1332,8 +1338,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1332
1338
 
1333
1339
  // test-utils/helpers.ts
1334
1340
  var generateTransferCallData = (to, value) => {
1335
- const functionAbi = (0, import_viem10.parseAbi)(["function transfer(address _to, uint256 _value) returns (bool)"]);
1336
- return (0, import_viem10.encodeFunctionData)({
1341
+ const functionAbi = (0, import_viem11.parseAbi)(["function transfer(address _to, uint256 _value) returns (bool)"]);
1342
+ return (0, import_viem11.encodeFunctionData)({
1337
1343
  abi: functionAbi,
1338
1344
  functionName: "transfer",
1339
1345
  args: [to, value]
@@ -360,7 +360,7 @@ var GelatoRelayPack = class extends RelayKitBasePack {
360
360
  };
361
361
 
362
362
  // src/packs/safe-4337/Safe4337Pack.ts
363
- import { getAddress as getAddress2, toHex as toHex5 } from "viem";
363
+ import { getAddress as getAddress2, toHex as toHex6 } from "viem";
364
364
  import semverSatisfies from "semver/functions/satisfies.js";
365
365
  import Safe, {
366
366
  EthSafeSignature as EthSafeSignature2,
@@ -740,9 +740,9 @@ async function createUserOperation(protocolKit, transactions, {
740
740
  nonce: nonce.toString(),
741
741
  initCode,
742
742
  callData,
743
- callGasLimit: 1n,
744
- verificationGasLimit: 1n,
745
- preVerificationGas: 1n,
743
+ callGasLimit: 0n,
744
+ verificationGasLimit: 0n,
745
+ preVerificationGas: 0n,
746
746
  maxFeePerGas: 1n,
747
747
  maxPriorityFeePerGas: 1n,
748
748
  paymasterAndData,
@@ -754,9 +754,9 @@ async function createUserOperation(protocolKit, transactions, {
754
754
  nonce: nonce.toString(),
755
755
  ...unpackInitCode(initCode),
756
756
  callData,
757
- callGasLimit: 1n,
758
- verificationGasLimit: 1n,
759
- preVerificationGas: 1n,
757
+ callGasLimit: 0n,
758
+ verificationGasLimit: 0n,
759
+ preVerificationGas: 0n,
760
760
  maxFeePerGas: 1n,
761
761
  maxPriorityFeePerGas: 1n,
762
762
  paymaster: paymasterAndData,
@@ -787,7 +787,7 @@ function userOperationToHexValues(userOperation, entryPointAddress) {
787
787
  }
788
788
 
789
789
  // src/packs/safe-4337/utils/getRelayKitVersion.ts
790
- var getRelayKitVersion = () => "4.0.4";
790
+ var getRelayKitVersion = () => "4.1.0";
791
791
 
792
792
  // src/packs/safe-4337/utils/encodeNonce.ts
793
793
  import { toHex as toHex4 } from "viem";
@@ -835,16 +835,18 @@ var SafeOperationFactory = class {
835
835
  var SafeOperationFactory_default = SafeOperationFactory;
836
836
 
837
837
  // src/packs/safe-4337/estimators/pimlico/PimlicoFeeEstimator.ts
838
+ import { toHex as toHex5 } from "viem";
838
839
  var PimlicoFeeEstimator = class {
839
840
  async preEstimateUserOperationGas({
840
841
  bundlerUrl,
841
842
  userOperation,
842
843
  entryPoint,
843
- paymasterOptions
844
+ paymasterOptions,
845
+ protocolKit
844
846
  }) {
845
847
  const bundlerClient = createBundlerClient(bundlerUrl);
846
848
  const feeData = await this.#getUserOperationGasPrices(bundlerClient);
847
- const chainId = await this.#getChainId(bundlerClient);
849
+ const chainId = await protocolKit.getChainId();
848
850
  let paymasterStubData = {};
849
851
  if (paymasterOptions) {
850
852
  const paymasterClient = createBundlerClient(
@@ -855,7 +857,12 @@ var PimlicoFeeEstimator = class {
855
857
  } : void 0;
856
858
  paymasterStubData = await paymasterClient.request({
857
859
  method: "pm_getPaymasterStubData" /* GET_PAYMASTER_STUB_DATA */,
858
- params: [userOperationToHexValues(userOperation, entryPoint), entryPoint, chainId, context]
860
+ params: [
861
+ userOperationToHexValues(userOperation, entryPoint),
862
+ entryPoint,
863
+ toHex5(chainId),
864
+ context
865
+ ]
859
866
  });
860
867
  }
861
868
  return {
@@ -866,7 +873,8 @@ var PimlicoFeeEstimator = class {
866
873
  async postEstimateUserOperationGas({
867
874
  userOperation,
868
875
  entryPoint,
869
- paymasterOptions
876
+ paymasterOptions,
877
+ protocolKit
870
878
  }) {
871
879
  if (!paymasterOptions) return {};
872
880
  const paymasterClient = createBundlerClient(
@@ -888,13 +896,13 @@ var PimlicoFeeEstimator = class {
888
896
  });
889
897
  return sponsoredData;
890
898
  }
891
- const chainId = await this.#getChainId(paymasterClient);
899
+ const chainId = await protocolKit.getChainId();
892
900
  const erc20PaymasterData = await paymasterClient.request({
893
901
  method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
894
902
  params: [
895
903
  userOperationToHexValues(userOperation, entryPoint),
896
904
  entryPoint,
897
- chainId,
905
+ toHex5(chainId),
898
906
  { token: paymasterOptions.paymasterTokenAddress }
899
907
  ]
900
908
  });
@@ -912,10 +920,6 @@ var PimlicoFeeEstimator = class {
912
920
  maxPriorityFeePerGas
913
921
  };
914
922
  }
915
- async #getChainId(client) {
916
- const chainId = await client.request({ method: "eth_chainId" });
917
- return chainId;
918
- }
919
923
  };
920
924
 
921
925
  // src/packs/safe-4337/Safe4337Pack.ts
@@ -1199,7 +1203,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1199
1203
  bundlerUrl: this.#BUNDLER_URL,
1200
1204
  entryPoint: this.#ENTRYPOINT_ADDRESS,
1201
1205
  userOperation: safeOperation.getUserOperation(),
1202
- paymasterOptions: this.#paymasterOptions
1206
+ paymasterOptions: this.#paymasterOptions,
1207
+ protocolKit: this.protocolKit
1203
1208
  });
1204
1209
  if (preEstimationData) {
1205
1210
  safeOperation.addEstimations(preEstimationData);
@@ -1224,7 +1229,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1224
1229
  ...safeOperation.getUserOperation(),
1225
1230
  signature: getDummySignature(this.#SAFE_WEBAUTHN_SHARED_SIGNER_ADDRESS, threshold)
1226
1231
  },
1227
- paymasterOptions: this.#paymasterOptions
1232
+ paymasterOptions: this.#paymasterOptions,
1233
+ protocolKit: this.protocolKit
1228
1234
  });
1229
1235
  if (postEstimationData) {
1230
1236
  safeOperation.addEstimations(postEstimationData);
@@ -1372,10 +1378,10 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1372
1378
  message: {
1373
1379
  ...safeOperation2,
1374
1380
  nonce: BigInt(safeOperation2.nonce),
1375
- validAfter: toHex5(safeOperation2.validAfter),
1376
- validUntil: toHex5(safeOperation2.validUntil),
1377
- maxFeePerGas: toHex5(safeOperation2.maxFeePerGas),
1378
- maxPriorityFeePerGas: toHex5(safeOperation2.maxPriorityFeePerGas)
1381
+ validAfter: toHex6(safeOperation2.validAfter),
1382
+ validUntil: toHex6(safeOperation2.validUntil),
1383
+ maxFeePerGas: toHex6(safeOperation2.maxFeePerGas),
1384
+ maxPriorityFeePerGas: toHex6(safeOperation2.maxPriorityFeePerGas)
1379
1385
  },
1380
1386
  primaryType: "SafeOp"
1381
1387
  });
@@ -1459,12 +1465,136 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1459
1465
  return this.#onchainIdentifier;
1460
1466
  }
1461
1467
  };
1468
+
1469
+ // src/packs/safe-4337/estimators/generic/GenericFeeEstimator.ts
1470
+ import { createPublicClient as createPublicClient2, http as http2, toHex as toHex7 } from "viem";
1471
+ var GenericFeeEstimator = class {
1472
+ constructor(rpcUrl, overrides = {}) {
1473
+ this.defaultVerificationGasLimitOverhead = overrides.defaultVerificationGasLimitOverhead ?? 35000n;
1474
+ this.overrides = overrides;
1475
+ this.rpcUrl = rpcUrl;
1476
+ }
1477
+ async preEstimateUserOperationGas({
1478
+ userOperation,
1479
+ entryPoint,
1480
+ paymasterOptions,
1481
+ protocolKit
1482
+ }) {
1483
+ let feeDataRes = {};
1484
+ let paymasterStubDataRes = {};
1485
+ if (paymasterOptions) {
1486
+ const chainId = await protocolKit.getChainId();
1487
+ const paymasterClient = createBundlerClient(paymasterOptions.paymasterUrl);
1488
+ const context = "paymasterTokenAddress" in paymasterOptions ? {
1489
+ token: paymasterOptions.paymasterTokenAddress
1490
+ } : paymasterOptions.paymasterContext ?? {};
1491
+ const [feeData, paymasterStubData] = await Promise.all([
1492
+ this.#getUserOperationGasPrices(this.rpcUrl),
1493
+ paymasterClient.request({
1494
+ method: "pm_getPaymasterStubData" /* GET_PAYMASTER_STUB_DATA */,
1495
+ params: [
1496
+ userOperationToHexValues(userOperation, entryPoint),
1497
+ entryPoint,
1498
+ toHex7(chainId),
1499
+ context
1500
+ ]
1501
+ })
1502
+ ]);
1503
+ feeDataRes = feeData;
1504
+ paymasterStubDataRes = paymasterStubData;
1505
+ } else {
1506
+ const feeData = await this.#getUserOperationGasPrices(this.rpcUrl);
1507
+ feeDataRes = feeData;
1508
+ }
1509
+ feeDataRes.callGasLimit = this.overrides.callGasLimit ?? feeDataRes.callGasLimit;
1510
+ feeDataRes.verificationGasLimit = this.overrides.verificationGasLimit ?? feeDataRes.verificationGasLimit;
1511
+ feeDataRes.preVerificationGas = this.overrides.preVerificationGas ?? feeDataRes.preVerificationGas;
1512
+ feeDataRes.maxFeePerGas = this.overrides.maxFeePerGas ?? feeDataRes.maxFeePerGas;
1513
+ feeDataRes.maxPriorityFeePerGas = this.overrides.maxPriorityFeePerGas ?? feeDataRes.maxPriorityFeePerGas;
1514
+ const result = {
1515
+ ...feeDataRes,
1516
+ ...paymasterStubDataRes
1517
+ };
1518
+ if (result.verificationGasLimit != null) {
1519
+ const threshold = await protocolKit.getThreshold();
1520
+ result.verificationGasLimit = (BigInt(result.verificationGasLimit) + BigInt(threshold) * this.defaultVerificationGasLimitOverhead).toString();
1521
+ }
1522
+ return result;
1523
+ }
1524
+ async postEstimateUserOperationGas({
1525
+ userOperation,
1526
+ entryPoint,
1527
+ paymasterOptions,
1528
+ protocolKit
1529
+ }) {
1530
+ if (protocolKit == null) {
1531
+ throw new Error("Can't use GenericFeeEstimator if protocolKit is null.");
1532
+ }
1533
+ if (!paymasterOptions) return {};
1534
+ const paymasterClient = createBundlerClient(paymasterOptions.paymasterUrl);
1535
+ const chainId = await protocolKit.getChainId();
1536
+ if (paymasterOptions.isSponsored) {
1537
+ const params = [
1538
+ userOperationToHexValues(userOperation, entryPoint),
1539
+ entryPoint,
1540
+ toHex7(chainId)
1541
+ ];
1542
+ if (paymasterOptions.paymasterContext) {
1543
+ params.push(paymasterOptions.paymasterContext);
1544
+ }
1545
+ const sponsoredData = await paymasterClient.request({
1546
+ method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
1547
+ params
1548
+ });
1549
+ return sponsoredData;
1550
+ }
1551
+ const erc20PaymasterData = await paymasterClient.request({
1552
+ method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
1553
+ params: [
1554
+ userOperationToHexValues(userOperation, entryPoint),
1555
+ entryPoint,
1556
+ toHex7(chainId),
1557
+ { token: paymasterOptions.paymasterTokenAddress }
1558
+ ]
1559
+ });
1560
+ if ("verificationGasLimit" in erc20PaymasterData && erc20PaymasterData.verificationGasLimit != null) {
1561
+ const threshold = await protocolKit.getThreshold();
1562
+ erc20PaymasterData.verificationGasLimit = (BigInt(erc20PaymasterData.verificationGasLimit) + BigInt(threshold) * this.defaultVerificationGasLimitOverhead).toString();
1563
+ }
1564
+ return erc20PaymasterData;
1565
+ }
1566
+ async #getUserOperationGasPrices(rpcUrl) {
1567
+ const client = createPublicClient2({
1568
+ transport: http2(rpcUrl)
1569
+ });
1570
+ const [block, maxPriorityFeePerGas] = await Promise.all([
1571
+ client.getBlock({ blockTag: "latest" }),
1572
+ client.estimateMaxPriorityFeePerGas()
1573
+ ]);
1574
+ const baseFeePerGas = block.baseFeePerGas;
1575
+ if (!baseFeePerGas) {
1576
+ throw new Error("Base fee not available - probably not an EIP-1559 block.");
1577
+ }
1578
+ const maxFeePerGas = baseFeePerGas + maxPriorityFeePerGas;
1579
+ return {
1580
+ maxFeePerGas: BigInt(
1581
+ Math.ceil(Number(maxFeePerGas) * (this.overrides.maxFeePerGasMultiplier ?? 1.5))
1582
+ ),
1583
+ maxPriorityFeePerGas: BigInt(
1584
+ Math.ceil(
1585
+ Number(maxPriorityFeePerGas) * (this.overrides.maxPriorityFeePerGasMultiplier ?? 1.5)
1586
+ )
1587
+ )
1588
+ };
1589
+ }
1590
+ };
1462
1591
  export {
1463
1592
  BaseSafeOperation_default as BaseSafeOperation,
1464
1593
  DUMMY_AUTHENTICATOR_DATA,
1465
1594
  DUMMY_CLIENT_DATA_FIELDS,
1466
1595
  EQ_OR_GT_0_3_0,
1467
1596
  GelatoRelayPack,
1597
+ GenericFeeEstimator,
1468
1598
  PimlicoFeeEstimator,
1469
1599
  RelayKitBasePack,
1470
1600
  Safe4337Pack,
@@ -190,7 +190,7 @@ var USER_OPERATION_GAS_PRICE = {
190
190
  import { encodeFunctionData as encodeFunctionData4, parseAbi as parseAbi2 } from "viem";
191
191
 
192
192
  // src/packs/safe-4337/Safe4337Pack.ts
193
- import { getAddress as getAddress2, toHex as toHex5 } from "viem";
193
+ import { getAddress as getAddress2, toHex as toHex6 } from "viem";
194
194
  import semverSatisfies from "semver/functions/satisfies.js";
195
195
  import Safe, {
196
196
  EthSafeSignature as EthSafeSignature2,
@@ -595,9 +595,9 @@ async function createUserOperation(protocolKit, transactions, {
595
595
  nonce: nonce.toString(),
596
596
  initCode,
597
597
  callData,
598
- callGasLimit: 1n,
599
- verificationGasLimit: 1n,
600
- preVerificationGas: 1n,
598
+ callGasLimit: 0n,
599
+ verificationGasLimit: 0n,
600
+ preVerificationGas: 0n,
601
601
  maxFeePerGas: 1n,
602
602
  maxPriorityFeePerGas: 1n,
603
603
  paymasterAndData,
@@ -609,9 +609,9 @@ async function createUserOperation(protocolKit, transactions, {
609
609
  nonce: nonce.toString(),
610
610
  ...unpackInitCode(initCode),
611
611
  callData,
612
- callGasLimit: 1n,
613
- verificationGasLimit: 1n,
614
- preVerificationGas: 1n,
612
+ callGasLimit: 0n,
613
+ verificationGasLimit: 0n,
614
+ preVerificationGas: 0n,
615
615
  maxFeePerGas: 1n,
616
616
  maxPriorityFeePerGas: 1n,
617
617
  paymaster: paymasterAndData,
@@ -642,7 +642,7 @@ function userOperationToHexValues(userOperation, entryPointAddress) {
642
642
  }
643
643
 
644
644
  // src/packs/safe-4337/utils/getRelayKitVersion.ts
645
- var getRelayKitVersion = () => "4.0.4";
645
+ var getRelayKitVersion = () => "4.1.0";
646
646
 
647
647
  // src/packs/safe-4337/utils/encodeNonce.ts
648
648
  import { toHex as toHex4 } from "viem";
@@ -685,16 +685,18 @@ var SafeOperationFactory = class {
685
685
  var SafeOperationFactory_default = SafeOperationFactory;
686
686
 
687
687
  // src/packs/safe-4337/estimators/pimlico/PimlicoFeeEstimator.ts
688
+ import { toHex as toHex5 } from "viem";
688
689
  var PimlicoFeeEstimator = class {
689
690
  async preEstimateUserOperationGas({
690
691
  bundlerUrl,
691
692
  userOperation,
692
693
  entryPoint,
693
- paymasterOptions
694
+ paymasterOptions,
695
+ protocolKit
694
696
  }) {
695
697
  const bundlerClient = createBundlerClient(bundlerUrl);
696
698
  const feeData = await this.#getUserOperationGasPrices(bundlerClient);
697
- const chainId = await this.#getChainId(bundlerClient);
699
+ const chainId = await protocolKit.getChainId();
698
700
  let paymasterStubData = {};
699
701
  if (paymasterOptions) {
700
702
  const paymasterClient = createBundlerClient(
@@ -705,7 +707,12 @@ var PimlicoFeeEstimator = class {
705
707
  } : void 0;
706
708
  paymasterStubData = await paymasterClient.request({
707
709
  method: "pm_getPaymasterStubData" /* GET_PAYMASTER_STUB_DATA */,
708
- params: [userOperationToHexValues(userOperation, entryPoint), entryPoint, chainId, context]
710
+ params: [
711
+ userOperationToHexValues(userOperation, entryPoint),
712
+ entryPoint,
713
+ toHex5(chainId),
714
+ context
715
+ ]
709
716
  });
710
717
  }
711
718
  return {
@@ -716,7 +723,8 @@ var PimlicoFeeEstimator = class {
716
723
  async postEstimateUserOperationGas({
717
724
  userOperation,
718
725
  entryPoint,
719
- paymasterOptions
726
+ paymasterOptions,
727
+ protocolKit
720
728
  }) {
721
729
  if (!paymasterOptions) return {};
722
730
  const paymasterClient = createBundlerClient(
@@ -738,13 +746,13 @@ var PimlicoFeeEstimator = class {
738
746
  });
739
747
  return sponsoredData;
740
748
  }
741
- const chainId = await this.#getChainId(paymasterClient);
749
+ const chainId = await protocolKit.getChainId();
742
750
  const erc20PaymasterData = await paymasterClient.request({
743
751
  method: "pm_getPaymasterData" /* GET_PAYMASTER_DATA */,
744
752
  params: [
745
753
  userOperationToHexValues(userOperation, entryPoint),
746
754
  entryPoint,
747
- chainId,
755
+ toHex5(chainId),
748
756
  { token: paymasterOptions.paymasterTokenAddress }
749
757
  ]
750
758
  });
@@ -762,10 +770,6 @@ var PimlicoFeeEstimator = class {
762
770
  maxPriorityFeePerGas
763
771
  };
764
772
  }
765
- async #getChainId(client) {
766
- const chainId = await client.request({ method: "eth_chainId" });
767
- return chainId;
768
- }
769
773
  };
770
774
 
771
775
  // src/packs/safe-4337/Safe4337Pack.ts
@@ -1049,7 +1053,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1049
1053
  bundlerUrl: this.#BUNDLER_URL,
1050
1054
  entryPoint: this.#ENTRYPOINT_ADDRESS,
1051
1055
  userOperation: safeOperation.getUserOperation(),
1052
- paymasterOptions: this.#paymasterOptions
1056
+ paymasterOptions: this.#paymasterOptions,
1057
+ protocolKit: this.protocolKit
1053
1058
  });
1054
1059
  if (preEstimationData) {
1055
1060
  safeOperation.addEstimations(preEstimationData);
@@ -1074,7 +1079,8 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1074
1079
  ...safeOperation.getUserOperation(),
1075
1080
  signature: getDummySignature(this.#SAFE_WEBAUTHN_SHARED_SIGNER_ADDRESS, threshold)
1076
1081
  },
1077
- paymasterOptions: this.#paymasterOptions
1082
+ paymasterOptions: this.#paymasterOptions,
1083
+ protocolKit: this.protocolKit
1078
1084
  });
1079
1085
  if (postEstimationData) {
1080
1086
  safeOperation.addEstimations(postEstimationData);
@@ -1222,10 +1228,10 @@ var Safe4337Pack = class _Safe4337Pack extends RelayKitBasePack {
1222
1228
  message: {
1223
1229
  ...safeOperation2,
1224
1230
  nonce: BigInt(safeOperation2.nonce),
1225
- validAfter: toHex5(safeOperation2.validAfter),
1226
- validUntil: toHex5(safeOperation2.validUntil),
1227
- maxFeePerGas: toHex5(safeOperation2.maxFeePerGas),
1228
- maxPriorityFeePerGas: toHex5(safeOperation2.maxPriorityFeePerGas)
1231
+ validAfter: toHex6(safeOperation2.validAfter),
1232
+ validUntil: toHex6(safeOperation2.validUntil),
1233
+ maxFeePerGas: toHex6(safeOperation2.maxFeePerGas),
1234
+ maxPriorityFeePerGas: toHex6(safeOperation2.maxPriorityFeePerGas)
1229
1235
  },
1230
1236
  primaryType: "SafeOp"
1231
1237
  });
@@ -10,6 +10,8 @@ export * from './packs/safe-4337/estimators';
10
10
  export * from './packs/safe-4337/types';
11
11
  export * from './packs/safe-4337/utils';
12
12
  export * from './RelayKitBasePack';
13
+ export { GenericFeeEstimator } from './packs/safe-4337/estimators/generic/GenericFeeEstimator';
14
+ export { PimlicoFeeEstimator } from './packs/safe-4337/estimators/pimlico/PimlicoFeeEstimator';
13
15
  declare module 'abitype' {
14
16
  interface Register {
15
17
  AddressType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAE5B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,sBAAsB,CAAA;AAEpC,cAAc,gCAAgC,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAClF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAExF,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AAEvC,cAAc,oBAAoB,CAAA;AAElC,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAiB,QAAQ;QACvB,WAAW,EAAE,MAAM,CAAA;KACpB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAE5B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,sBAAsB,CAAA;AAEpC,cAAc,gCAAgC,CAAA;AAC9C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAA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;IACG,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAOnF;;;;;OAKG;IACG,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAOvF;;;;;OAKG;IACG,uBAAuB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAMlD;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,oBAAoB,IAAI,MAAM;CAG/B"}
@@ -0,0 +1,27 @@
1
+ import { EstimateGasData } from '@safe-global/types-kit';
2
+ import { EstimateFeeFunctionProps, IFeeEstimator } from '../../../../packs/safe-4337/types';
3
+ export type GenericFeeEstimatorOverrides = {
4
+ callGasLimit?: bigint;
5
+ verificationGasLimit?: bigint;
6
+ preVerificationGas?: bigint;
7
+ maxFeePerGas?: bigint;
8
+ maxPriorityFeePerGas?: bigint;
9
+ maxFeePerGasMultiplier?: number;
10
+ maxPriorityFeePerGasMultiplier?: number;
11
+ defaultVerificationGasLimitOverhead?: bigint;
12
+ };
13
+ /**
14
+ * GenericFeeEstimator is a class that implements the IFeeEstimator interface. You can implement three optional methods that will be called during the estimation process:
15
+ * - preEstimateUserOperationGas: Setup the userOperation before calling the eth_estimateUserOperation gas method.
16
+ * - postEstimateUserOperationGas: Adjust the userOperation values returned after calling the eth_estimateUserOperation method.
17
+ */
18
+ export declare class GenericFeeEstimator implements IFeeEstimator {
19
+ #private;
20
+ defaultVerificationGasLimitOverhead: bigint;
21
+ overrides: GenericFeeEstimatorOverrides;
22
+ rpcUrl: string;
23
+ constructor(rpcUrl: string, overrides?: GenericFeeEstimatorOverrides);
24
+ preEstimateUserOperationGas({ userOperation, entryPoint, paymasterOptions, protocolKit }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
25
+ postEstimateUserOperationGas({ userOperation, entryPoint, paymasterOptions, protocolKit }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
26
+ }
27
+ //# sourceMappingURL=GenericFeeEstimator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFeeEstimator.d.ts","sourceRoot":"","sources":["../../../../../../src/packs/safe-4337/estimators/generic/GenericFeeEstimator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,wBAAwB,EACxB,aAAa,EAEd,MAAM,8CAA8C,CAAA;AAOrD,MAAM,MAAM,4BAA4B,GAAG;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,8BAA8B,CAAC,EAAE,MAAM,CAAA;IACvC,mCAAmC,CAAC,EAAE,MAAM,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,aAAa;;IACvD,mCAAmC,EAAE,MAAM,CAAA;IAC3C,SAAS,EAAE,4BAA4B,CAAA;IACvC,MAAM,EAAE,MAAM,CAAA;gBAEF,MAAM,EAAE,MAAM,EAAE,SAAS,GAAE,4BAAiC;IAOlE,2BAA2B,CAAC,EAChC,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAwDhD,4BAA4B,CAAC,EACjC,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;CAiFvD"}
@@ -1,3 +1,5 @@
1
1
  import { PimlicoFeeEstimator } from './pimlico/PimlicoFeeEstimator';
2
+ import { GenericFeeEstimator } from './generic/GenericFeeEstimator';
2
3
  export { PimlicoFeeEstimator };
4
+ export { GenericFeeEstimator };
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packs/safe-4337/estimators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packs/safe-4337/estimators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,EAAE,mBAAmB,EAAE,CAAA;AAC9B,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -7,7 +7,7 @@ import { EstimateFeeFunctionProps, IFeeEstimator } from '../../../../packs/safe-
7
7
  */
8
8
  export declare class PimlicoFeeEstimator implements IFeeEstimator {
9
9
  #private;
10
- preEstimateUserOperationGas({ bundlerUrl, userOperation, entryPoint, paymasterOptions }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
11
- postEstimateUserOperationGas({ userOperation, entryPoint, paymasterOptions }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
10
+ preEstimateUserOperationGas({ bundlerUrl, userOperation, entryPoint, paymasterOptions, protocolKit }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
11
+ postEstimateUserOperationGas({ userOperation, entryPoint, paymasterOptions, protocolKit }: EstimateFeeFunctionProps): Promise<EstimateGasData>;
12
12
  }
13
13
  //# sourceMappingURL=PimlicoFeeEstimator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PimlicoFeeEstimator.d.ts","sourceRoot":"","sources":["../../../../../../src/packs/safe-4337/estimators/pimlico/PimlicoFeeEstimator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAEL,wBAAwB,EACxB,aAAa,EAEd,MAAM,8CAA8C,CAAA;AAQrD;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,aAAa;;IACjD,2BAA2B,CAAC,EAChC,UAAU,EACV,aAAa,EACb,UAAU,EACV,gBAAgB,EACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IA6BhD,4BAA4B,CAAC,EACjC,aAAa,EACb,UAAU,EACV,gBAAgB,EACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;CAgEvD"}
1
+ {"version":3,"file":"PimlicoFeeEstimator.d.ts","sourceRoot":"","sources":["../../../../../../src/packs/safe-4337/estimators/pimlico/PimlicoFeeEstimator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAEL,wBAAwB,EACxB,aAAa,EAEd,MAAM,8CAA8C,CAAA;AAQrD;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,aAAa;;IACjD,2BAA2B,CAAC,EAChC,UAAU,EACV,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAkChD,4BAA4B,CAAC,EACjC,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;CA0DvD"}
@@ -16,6 +16,7 @@ type PredictedSafeOptions = {
16
16
  export type SponsoredPaymasterOption = {
17
17
  isSponsored: true;
18
18
  sponsorshipPolicyId?: string;
19
+ paymasterContext?: Record<string, unknown>;
19
20
  };
20
21
  export type ERC20PaymasterOption = {
21
22
  isSponsored?: false;
@@ -118,8 +119,9 @@ export type EstimateFeeFunctionProps = {
118
119
  bundlerUrl: string;
119
120
  entryPoint: string;
120
121
  paymasterOptions?: PaymasterOptions;
122
+ protocolKit: Safe;
121
123
  };
122
- export type EstimateFeeFunction = ({ userOperation, bundlerUrl, entryPoint, paymasterOptions }: EstimateFeeFunctionProps) => Promise<EstimateGasData>;
124
+ export type EstimateFeeFunction = (props: EstimateFeeFunctionProps) => Promise<EstimateGasData>;
123
125
  export interface IFeeEstimator {
124
126
  preEstimateUserOperationGas?: EstimateFeeFunction;
125
127
  postEstimateUserOperationGas?: EstimateFeeFunction;
@@ -139,7 +141,7 @@ export type Safe4337RpcSchema = [
139
141
  {
140
142
  Method: RPC_4337_CALLS.GET_PAYMASTER_STUB_DATA;
141
143
  Parameters: [UserOperationStringValues, string, string, {
142
- token: string;
144
+ token?: string;
143
145
  }?];
144
146
  ReturnType: {
145
147
  paymasterAndData: string;
@@ -153,7 +155,7 @@ export type Safe4337RpcSchema = [
153
155
  {
154
156
  Method: RPC_4337_CALLS.GET_PAYMASTER_DATA;
155
157
  Parameters: [UserOperationStringValues, string, string, {
156
- token: string;
158
+ token?: string;
157
159
  }?];
158
160
  ReturnType: {
159
161
  paymasterAndData: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/packs/safe-4337/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AACnG,OAAO,IAAI,EAAE,EACX,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,EACX,aAAa,EACd,MAAM,wBAAwB,CAAA;AAC/B,OAAO,iBAAiB,MAAM,0DAA0D,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAA;AAEjF,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAA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U,EAAE,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAA;QAC/C,UAAU,EAAE,GAAG,CAAA;KAChB;IACD;QACE,MAAM,EAAE,cAAc,CAAC,0BAA0B,CAAA;QACjD,UAAU,EAAE,CAAC,IAAI,CAAC,CAAA;QAClB,UAAU,EAAE;YACV,aAAa,EAAE,aAAa,CAAA;YAC5B,UAAU,EAAE,OAAO,CAAA;YACnB,eAAe,EAAE,IAAI,CAAA;YACrB,SAAS,EAAE,IAAI,CAAA;YACf,WAAW,EAAE,MAAM,CAAA;SACpB,CAAA;KACF;IACD;QACE,MAAM,EAAE,cAAc,CAAC,0BAA0B,CAAA;QACjD,UAAU,EAAE,CAAC,IAAI,CAAC,CAAA;QAClB,UAAU,EAAE,oBAAoB,CAAA;KACjC;CACF,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,OAAO,EAAE,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,uBAAuB,SAAS,cAAc,EAAE,GAAG,EAAE,IAAI,YAAY,CAC7F,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB;IAAC,GAAG,eAAe;IAAE,GAAG,iBAAiB;IAAE,GAAG,uBAAuB;CAAC,CACvE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safe-global/relay-kit",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "description": "SDK for Safe Smart Accounts with support for ERC-4337 and Relay",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "main": "dist/cjs/src/index.cjs",
@@ -56,10 +56,10 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@gelatonetwork/relay-sdk": "^5.6.0",
59
- "@safe-global/protocol-kit": "^6.0.5",
60
- "@safe-global/safe-modules-deployments": "^2.2.9",
61
- "@safe-global/types-kit": "^2.0.1",
62
- "semver": "^7.7.1",
59
+ "@safe-global/protocol-kit": "^6.1.1",
60
+ "@safe-global/safe-modules-deployments": "^2.2.14",
61
+ "@safe-global/types-kit": "^3.0.0",
62
+ "semver": "^7.7.2",
63
63
  "viem": "^2.21.8"
64
64
  }
65
65
  }