From 28067347e6f8e2ad409b81a8d741e067bfa03db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noah=20Bayindirli=20=F0=9F=A5=82?= Date: Fri, 10 May 2024 14:27:59 -0400 Subject: [PATCH] move EV5 submitter/transformer types into ethersV5 dir --- typescript/sdk/src/index.ts | 10 ++++------ .../transactions/submitter/TxSubmitterTypes.ts | 14 -------------- .../submitter/ethersV5/EV5GnosisSafeTxSubmitter.ts | 6 ++---- .../ethersV5/EV5ImpersonatedAccountTxSubmitter.ts | 6 ++---- .../submitter/ethersV5/EV5TxSubmitterTypes.ts | 13 +++++++++++++ .../transformer/ethersV5/EV5TxTransformerTypes.ts | 10 ++++++++++ 6 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5TxSubmitterTypes.ts create mode 100644 typescript/sdk/src/providers/transactions/transformer/ethersV5/EV5TxTransformerTypes.ts diff --git a/typescript/sdk/src/index.ts b/typescript/sdk/src/index.ts index cabe23127d..fd338351e7 100644 --- a/typescript/sdk/src/index.ts +++ b/typescript/sdk/src/index.ts @@ -304,21 +304,19 @@ export { protocolToDefaultProviderBuilder, } from './providers/providerBuilders.js'; export { TxSubmitterInterface } from './providers/transactions/submitter/TxSubmitterInterface.js'; +export { TxSubmitterType } from './providers/transactions/submitter/TxSubmitterTypes.js'; export { - TxSubmitterType, EV5GnosisSafeTxSubmitterProps, EV5ImpersonatedAccountTxSubmitterProps, -} from './providers/transactions/submitter/TxSubmitterTypes.js'; +} from './providers/transactions/submitter/ethersV5/EV5TxSubmitterTypes.js'; export { TxSubmitterBuilder } from './providers/transactions/submitter/builder/TxSubmitterBuilder.js'; export { EV5GnosisSafeTxSubmitter } from './providers/transactions/submitter/ethersV5/EV5GnosisSafeTxSubmitter.js'; export { EV5ImpersonatedAccountTxSubmitter } from './providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.js'; export { EV5JsonRpcTxSubmitter } from './providers/transactions/submitter/ethersV5/EV5JsonRpcTxSubmitter.js'; export { EV5TxSubmitterInterface } from './providers/transactions/submitter/ethersV5/EV5TxSubmitterInterface.js'; export { TxTransformerInterface } from './providers/transactions/transformer/TxTransformerInterface.js'; -export { - TxTransformerType, - EV5InterchainAccountTxTransformerProps, -} from './providers/transactions/transformer/TxTransformerTypes.js'; +export { TxTransformerType } from './providers/transactions/transformer/TxTransformerTypes.js'; +export { EV5InterchainAccountTxTransformerProps } from './providers/transactions/transformer/ethersV5/EV5TxTransformerTypes.js'; export { EV5InterchainAccountTxTransformer } from './providers/transactions/transformer/ethersV5/EV5InterchainAccountTxTransformer.js'; export { EV5TxTransformerInterface } from './providers/transactions/transformer/ethersV5/EV5TxTransformerInterface.js'; export { GasRouterDeployer } from './router/GasRouterDeployer.js'; diff --git a/typescript/sdk/src/providers/transactions/submitter/TxSubmitterTypes.ts b/typescript/sdk/src/providers/transactions/submitter/TxSubmitterTypes.ts index 7ed3eac7f5..4e38f9c25a 100644 --- a/typescript/sdk/src/providers/transactions/submitter/TxSubmitterTypes.ts +++ b/typescript/sdk/src/providers/transactions/submitter/TxSubmitterTypes.ts @@ -1,19 +1,5 @@ -import { Address } from '@hyperlane-xyz/utils'; - -import { ChainName } from '../../../types.js'; - export enum TxSubmitterType { JSON_RPC = 'JSON RPC', IMPERSONATED_ACCOUNT = 'Impersonated Account', GNOSIS_SAFE = 'Gnosis Safe', } - -export interface EV5GnosisSafeTxSubmitterProps { - chain: ChainName; - safeAddress: Address; -} - -export interface EV5ImpersonatedAccountTxSubmitterProps { - chain: ChainName; - userAddress: Address; -} diff --git a/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5GnosisSafeTxSubmitter.ts b/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5GnosisSafeTxSubmitter.ts index 9db0e15dbc..5fb760e327 100644 --- a/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5GnosisSafeTxSubmitter.ts +++ b/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5GnosisSafeTxSubmitter.ts @@ -6,12 +6,10 @@ import { Address, assert, rootLogger } from '@hyperlane-xyz/utils'; // @ts-ignore import { getSafe, getSafeService } from '../../../../utils/gnosisSafe.js'; import { MultiProvider } from '../../../MultiProvider.js'; -import { - EV5GnosisSafeTxSubmitterProps, - TxSubmitterType, -} from '../TxSubmitterTypes.js'; +import { TxSubmitterType } from '../TxSubmitterTypes.js'; import { EV5TxSubmitterInterface } from './EV5TxSubmitterInterface.js'; +import { EV5GnosisSafeTxSubmitterProps } from './EV5TxSubmitterTypes.js'; export class EV5GnosisSafeTxSubmitter implements EV5TxSubmitterInterface { public readonly txSubmitterType: TxSubmitterType = diff --git a/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.ts b/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.ts index 6c5f8369c9..7df62f825e 100644 --- a/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.ts +++ b/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.ts @@ -6,12 +6,10 @@ import { rootLogger } from '@hyperlane-xyz/utils'; import { impersonateAccount } from '../../../../utils/fork.js'; import { MultiProvider } from '../../../MultiProvider.js'; -import { - EV5ImpersonatedAccountTxSubmitterProps, - TxSubmitterType, -} from '../TxSubmitterTypes.js'; +import { TxSubmitterType } from '../TxSubmitterTypes.js'; import { EV5JsonRpcTxSubmitter } from './EV5JsonRpcTxSubmitter.js'; +import { EV5ImpersonatedAccountTxSubmitterProps } from './EV5TxSubmitterTypes.js'; export class EV5ImpersonatedAccountTxSubmitter extends EV5JsonRpcTxSubmitter { public readonly txSubmitterType: TxSubmitterType = diff --git a/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5TxSubmitterTypes.ts b/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5TxSubmitterTypes.ts new file mode 100644 index 0000000000..cf6f7f164c --- /dev/null +++ b/typescript/sdk/src/providers/transactions/submitter/ethersV5/EV5TxSubmitterTypes.ts @@ -0,0 +1,13 @@ +import { Address } from '@hyperlane-xyz/utils'; + +import { ChainName } from '../../../../types.js'; + +export interface EV5GnosisSafeTxSubmitterProps { + chain: ChainName; + safeAddress: Address; +} + +export interface EV5ImpersonatedAccountTxSubmitterProps { + chain: ChainName; + userAddress: Address; +} diff --git a/typescript/sdk/src/providers/transactions/transformer/ethersV5/EV5TxTransformerTypes.ts b/typescript/sdk/src/providers/transactions/transformer/ethersV5/EV5TxTransformerTypes.ts new file mode 100644 index 0000000000..e8c7eb06aa --- /dev/null +++ b/typescript/sdk/src/providers/transactions/transformer/ethersV5/EV5TxTransformerTypes.ts @@ -0,0 +1,10 @@ +import { InterchainAccount } from '../../../../middleware/account/InterchainAccount.js'; +import { AccountConfig } from '../../../../middleware/account/types.js'; +import { ChainName } from '../../../../types.js'; + +export interface EV5InterchainAccountTxTransformerProps { + chain: ChainName; + interchainAccount: InterchainAccount; + accountConfig: AccountConfig; + hookMetadata?: string; +}