@toruslabs/ethereum-controllers 8.3.0 → 8.3.1

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.
@@ -1,21 +1,7 @@
1
- import { Implementation, ToMetaMaskSmartAccountParameters } from "@metamask/delegation-toolkit";
2
- import { Client, Hex, WalletClient } from "viem";
3
- import { SmartAccount, WebAuthnAccount } from "viem/account-abstraction";
4
- import { ISmartAccount } from "../../utils/interfaces";
5
- type MetamaskSmartAccountConfig<TImplementation extends Implementation> = Omit<ToMetaMaskSmartAccountParameters<TImplementation>, "client" | "signatory" | "deployParams"> & {
6
- hybridParams?: {
7
- p256KeyIds?: string[];
8
- p256XValues?: bigint[];
9
- p256YValues?: bigint[];
10
- webAuthnAccount?: WebAuthnAccount;
11
- keyId?: Hex;
12
- };
13
- multiSigParams?: {
14
- additionalSignerAddresses: Hex[];
15
- additionalSignerWalletClients: WalletClient[];
16
- threshold: bigint;
17
- };
18
- };
1
+ import { Implementation } from "@metamask/delegation-toolkit";
2
+ import { Client, WalletClient } from "viem";
3
+ import { SmartAccount } from "viem/account-abstraction";
4
+ import { ISmartAccount, MetamaskSmartAccountConfig } from "../../utils/interfaces";
19
5
  export declare class MetamaskSmartAccount<TImplementation extends Implementation> implements ISmartAccount {
20
6
  readonly name: string;
21
7
  private options;
@@ -25,4 +11,3 @@ export declare class MetamaskSmartAccount<TImplementation extends Implementation
25
11
  client: Client;
26
12
  }): Promise<SmartAccount>;
27
13
  }
28
- export {};
@@ -1,10 +1,11 @@
1
+ import { Implementation, ToMetaMaskSmartAccountParameters } from "@metamask/delegation-toolkit";
1
2
  import { BASE_TX_EVENT_TYPE, BaseBlockTrackerState, BaseControllerEvents, BaseFormattedTransactionActivity, BaseTokenInfo, BaseTransactionEvents, MESSAGE_EVENTS, MessageStatus, NetworkConfig, NetworkState, PaymentTransaction, PollingBlockTrackerConfig, PopupWhitelabelData, ProviderConfig, TRANSACTION_TYPE, TransactionMeta, TransactionState, TransactionStatus, TX_CONFIRMED_EVENT_TYPE, TX_DROPPED_EVENT_TYPE, TX_EVENTS, TX_FAILED_EVENT_TYPE, TX_WARNING_EVENT_TYPE, User } from "@toruslabs/base-controllers";
2
3
  import { JRPCRequest, Json } from "@web3auth/auth";
3
4
  import { MutexInterface } from "async-mutex";
4
5
  import { AccessList, TypedDataDomain, TypedDataField } from "ethers";
5
6
  import { ToBiconomySmartAccountParameters, toEcdsaKernelSmartAccount, ToLightSmartAccountParameters, ToNexusSmartAccountParameters, toSafeSmartAccount, toSimpleSmartAccount, toTrustSmartAccount } from "permissionless/accounts";
6
- import { Client, WalletClient } from "viem";
7
- import { createBundlerClient, createPaymasterClient, SmartAccount, UserOperationReceipt } from "viem/account-abstraction";
7
+ import { Client, Hex, WalletClient } from "viem";
8
+ import { createBundlerClient, createPaymasterClient, SmartAccount, UserOperationReceipt, WebAuthnAccount } from "viem/account-abstraction";
8
9
  import { METHOD_TYPES, SMART_ACCOUNT, TRANSACTION_ENVELOPE_TYPES } from "./constants";
9
10
  export type CustomTokenInfo = BaseTokenInfo & {
10
11
  erc20: boolean;
@@ -434,6 +435,20 @@ export type PaymasterConfig = Omit<Parameters<typeof createPaymasterClient>[0],
434
435
  export type BiconomySmartAccountConfig = Pick<ToBiconomySmartAccountParameters, "entryPoint" | "ecdsaModuleAddress" | "factoryAddress">;
435
436
  export type KernelSmartAccountParameters = Parameters<typeof toEcdsaKernelSmartAccount>[0];
436
437
  export type KernelSmartAccountConfig = Omit<KernelSmartAccountParameters, "owners" | "client" | "address" | "nonceKey" | "index">;
438
+ export type MetamaskSmartAccountConfig<TImplementation extends Implementation> = Omit<ToMetaMaskSmartAccountParameters<TImplementation>, "client" | "signatory" | "deployParams"> & {
439
+ hybridParams?: {
440
+ p256KeyIds?: string[];
441
+ p256XValues?: bigint[];
442
+ p256YValues?: bigint[];
443
+ webAuthnAccount?: WebAuthnAccount;
444
+ keyId?: Hex;
445
+ };
446
+ multiSigParams?: {
447
+ additionalSignerAddresses: Hex[];
448
+ additionalSignerWalletClients: WalletClient[];
449
+ threshold: bigint;
450
+ };
451
+ };
437
452
  export type LightSmartAccountConfig = Omit<ToLightSmartAccountParameters, "owner" | "client" | "index" | "address" | "nonceKey">;
438
453
  export type NexusSmartAccountConfig = Omit<ToNexusSmartAccountParameters, "owners" | "client" | "index" | "address">;
439
454
  export type SafeSmartAccountParameters = Parameters<typeof toSafeSmartAccount>[0];
@@ -449,7 +464,7 @@ export interface ISmartAccount {
449
464
  }): Promise<SmartAccount>;
450
465
  }
451
466
  export type SmartAccountType = (typeof SMART_ACCOUNT)[keyof typeof SMART_ACCOUNT];
452
- export type SmartAccountConfig = BiconomySmartAccountConfig | KernelSmartAccountConfig | NexusSmartAccountConfig | SafeSmartAccountConfig | TrustSmartAccountConfig;
467
+ export type SmartAccountConfig = BiconomySmartAccountConfig | KernelSmartAccountConfig | NexusSmartAccountConfig | SafeSmartAccountConfig | TrustSmartAccountConfig | MetamaskSmartAccountConfig<Implementation>;
453
468
  /**
454
469
  * @deprecated Use MultiChainAccountAbstractionConfig instead, will be deprecated in v8
455
470
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toruslabs/ethereum-controllers",
3
- "version": "8.3.0",
3
+ "version": "8.3.1",
4
4
  "homepage": "https://github.com/torusresearch/controllers#readme",
5
5
  "license": "ISC",
6
6
  "sideEffects": false,
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@ethereumjs/util": "^9.1.0",
23
23
  "@metamask/delegation-toolkit": "^0.9.0",
24
- "@toruslabs/base-controllers": "^8.3.0",
24
+ "@toruslabs/base-controllers": "^8.3.1",
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": "2a59a607de44fd524f284cf61584861b5f798f25",
66
+ "gitHead": "b07835e1ad17e72684cefd4a007d3f845f14e67b",
67
67
  "devDependencies": {
68
68
  "@typechain/ethers-v6": "^0.5.1",
69
69
  "typechain": "^8.3.2"