@toruslabs/ethereum-controllers 8.3.2 → 8.3.4

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.
@@ -15,7 +15,7 @@ class MetamaskSmartAccount {
15
15
  this.options = options;
16
16
  }
17
17
  async getSmartAccount(input) {
18
- var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options$multiSi, _this$options8, _this$options9, _this$options$deployS;
18
+ var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options$multiSi, _this$options8, _this$options9, _this$options$deployS, _this$options10, _this$options$impleme, _this$options11;
19
19
  const hybridSignatory = {
20
20
  walletClient: input.walletClient,
21
21
  webAuthnAccount: (_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.hybridParams) === null || _this$options === void 0 ? void 0 : _this$options.webAuthnAccount,
@@ -31,18 +31,19 @@ class MetamaskSmartAccount {
31
31
  const multiSigDeployParams = [[eoaAddress, ...(((_this$options7 = this.options) === null || _this$options7 === void 0 || (_this$options7 = _this$options7.multiSigParams) === null || _this$options7 === void 0 ? void 0 : _this$options7.additionalSignerAddresses) || [])], (_this$options$multiSi = (_this$options8 = this.options) === null || _this$options8 === void 0 || (_this$options8 = _this$options8.multiSigParams) === null || _this$options8 === void 0 ? void 0 : _this$options8.threshold) !== null && _this$options$multiSi !== void 0 ? _this$options$multiSi : BigInt(1 + (((_this$options9 = this.options) === null || _this$options9 === void 0 || (_this$options9 = _this$options9.multiSigParams) === null || _this$options9 === void 0 || (_this$options9 = _this$options9.additionalSignerWalletClients) === null || _this$options9 === void 0 ? void 0 : _this$options9.length) || 0))];
32
32
  const baseParams = {
33
33
  client: input.client,
34
- deploySalt: (_this$options$deployS = this.options.deploySalt) !== null && _this$options$deployS !== void 0 ? _this$options$deployS : "0x0"
34
+ deploySalt: (_this$options$deployS = (_this$options10 = this.options) === null || _this$options10 === void 0 ? void 0 : _this$options10.deploySalt) !== null && _this$options$deployS !== void 0 ? _this$options$deployS : "0x0"
35
35
  };
36
- if (isImplementationHybrid(this.options.implementation)) {
36
+ const implementation = (_this$options$impleme = (_this$options11 = this.options) === null || _this$options11 === void 0 ? void 0 : _this$options11.implementation) !== null && _this$options$impleme !== void 0 ? _this$options$impleme : delegationToolkit.Implementation.Hybrid;
37
+ if (isImplementationHybrid(implementation)) {
37
38
  const params = _objectSpread(_objectSpread({}, baseParams), {}, {
38
- implementation: this.options.implementation,
39
+ implementation,
39
40
  deployParams: hybridDeployParams,
40
41
  signatory: hybridSignatory
41
42
  });
42
43
  return delegationToolkit.toMetaMaskSmartAccount(params);
43
44
  } else {
44
45
  const params = _objectSpread(_objectSpread({}, baseParams), {}, {
45
- implementation: this.options.implementation,
46
+ implementation,
46
47
  deployParams: multiSigDeployParams,
47
48
  signatory: multiSigSignatory
48
49
  });
@@ -435,7 +435,8 @@ export type PaymasterConfig = Omit<Parameters<typeof createPaymasterClient>[0],
435
435
  export type BiconomySmartAccountConfig = Pick<ToBiconomySmartAccountParameters, "entryPoint" | "ecdsaModuleAddress" | "factoryAddress">;
436
436
  export type KernelSmartAccountParameters = Parameters<typeof toEcdsaKernelSmartAccount>[0];
437
437
  export type KernelSmartAccountConfig = Omit<KernelSmartAccountParameters, "owners" | "client" | "address" | "nonceKey" | "index">;
438
- export type MetamaskSmartAccountConfig<TImplementation extends Implementation> = Omit<ToMetaMaskSmartAccountParameters<TImplementation>, "client" | "signatory" | "deployParams"> & {
438
+ export type MetamaskSmartAccountConfig<TImplementation extends Implementation = Implementation.Hybrid> = Omit<ToMetaMaskSmartAccountParameters<TImplementation>, "client" | "signatory" | "deployParams" | "implementation"> & {
439
+ implementation?: TImplementation;
439
440
  hybridParams?: {
440
441
  p256KeyIds?: string[];
441
442
  p256XValues?: bigint[];
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
- import { toMetaMaskSmartAccount, Implementation } from '@metamask/delegation-toolkit';
3
+ import { Implementation, toMetaMaskSmartAccount } from '@metamask/delegation-toolkit';
4
4
  import { SMART_ACCOUNT } from '../../utils/constants.js';
5
5
 
6
6
  function isImplementationHybrid(implementation) {
@@ -13,7 +13,7 @@ class MetamaskSmartAccount {
13
13
  this.options = options;
14
14
  }
15
15
  async getSmartAccount(input) {
16
- var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options$multiSi, _this$options8, _this$options9, _this$options$deployS;
16
+ var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options$multiSi, _this$options8, _this$options9, _this$options$deployS, _this$options10, _this$options$impleme, _this$options11;
17
17
  const hybridSignatory = {
18
18
  walletClient: input.walletClient,
19
19
  webAuthnAccount: (_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.hybridParams) === null || _this$options === void 0 ? void 0 : _this$options.webAuthnAccount,
@@ -29,18 +29,19 @@ class MetamaskSmartAccount {
29
29
  const multiSigDeployParams = [[eoaAddress, ...(((_this$options7 = this.options) === null || _this$options7 === void 0 || (_this$options7 = _this$options7.multiSigParams) === null || _this$options7 === void 0 ? void 0 : _this$options7.additionalSignerAddresses) || [])], (_this$options$multiSi = (_this$options8 = this.options) === null || _this$options8 === void 0 || (_this$options8 = _this$options8.multiSigParams) === null || _this$options8 === void 0 ? void 0 : _this$options8.threshold) !== null && _this$options$multiSi !== void 0 ? _this$options$multiSi : BigInt(1 + (((_this$options9 = this.options) === null || _this$options9 === void 0 || (_this$options9 = _this$options9.multiSigParams) === null || _this$options9 === void 0 || (_this$options9 = _this$options9.additionalSignerWalletClients) === null || _this$options9 === void 0 ? void 0 : _this$options9.length) || 0))];
30
30
  const baseParams = {
31
31
  client: input.client,
32
- deploySalt: (_this$options$deployS = this.options.deploySalt) !== null && _this$options$deployS !== void 0 ? _this$options$deployS : "0x0"
32
+ deploySalt: (_this$options$deployS = (_this$options10 = this.options) === null || _this$options10 === void 0 ? void 0 : _this$options10.deploySalt) !== null && _this$options$deployS !== void 0 ? _this$options$deployS : "0x0"
33
33
  };
34
- if (isImplementationHybrid(this.options.implementation)) {
34
+ const implementation = (_this$options$impleme = (_this$options11 = this.options) === null || _this$options11 === void 0 ? void 0 : _this$options11.implementation) !== null && _this$options$impleme !== void 0 ? _this$options$impleme : Implementation.Hybrid;
35
+ if (isImplementationHybrid(implementation)) {
35
36
  const params = _objectSpread(_objectSpread({}, baseParams), {}, {
36
- implementation: this.options.implementation,
37
+ implementation,
37
38
  deployParams: hybridDeployParams,
38
39
  signatory: hybridSignatory
39
40
  });
40
41
  return toMetaMaskSmartAccount(params);
41
42
  } else {
42
43
  const params = _objectSpread(_objectSpread({}, baseParams), {}, {
43
- implementation: this.options.implementation,
44
+ implementation,
44
45
  deployParams: multiSigDeployParams,
45
46
  signatory: multiSigSignatory
46
47
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toruslabs/ethereum-controllers",
3
- "version": "8.3.2",
3
+ "version": "8.3.4",
4
4
  "homepage": "https://github.com/torusresearch/controllers#readme",
5
5
  "license": "ISC",
6
6
  "sideEffects": false,
@@ -20,8 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@ethereumjs/util": "^9.1.0",
23
- "@metamask/delegation-toolkit": "^0.9.0",
24
- "@toruslabs/base-controllers": "^8.3.1",
23
+ "@metamask/delegation-toolkit": "^0.10.0",
24
+ "@toruslabs/base-controllers": "^8.3.3",
25
25
  "@toruslabs/http-helpers": "^8.1.1",
26
26
  "@web3auth/auth": "^10.4.0",
27
27
  "async-mutex": "^0.5.0",
@@ -63,7 +63,7 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "d7d25f174a59b331bb6399e10812655902232862",
66
+ "gitHead": "6bb1a6fd6a3e6b96827c1d1d69e4b3012241224a",
67
67
  "devDependencies": {
68
68
  "@typechain/ethers-v6": "^0.5.1",
69
69
  "typechain": "^8.3.2"