Skip to content

Commit

Permalink
chore: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ljankovic-txfusion committed Jan 17, 2025
1 parent b75d2db commit 328d256
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .changeset/wicked-cherries-pump.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@hyperlane-xyz/sdk': minor
'@hyperlane-xyz/sdk': major
---

Support for ZKSync contract deployment and verification
1 change: 0 additions & 1 deletion typescript/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,5 +645,4 @@ export {
WarpTypedTransaction,
} from './warp/types.js';
export { WarpCore, WarpCoreOptions } from './warp/WarpCore.js';

export { MailboxClientConfigSchema as mailboxClientConfigSchema } from './router/types.js';
43 changes: 23 additions & 20 deletions typescript/sdk/src/providers/ProviderType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import {
import { Annotated, ProtocolType } from '@hyperlane-xyz/utils';

export enum ProviderType {
ZkSync = 'zksync',
EthersV5 = 'ethers-v5',
Viem = 'viem',
SolanaWeb3 = 'solana-web3',
CosmJs = 'cosmjs',
CosmJsWasm = 'cosmjs-wasm',
GnosisTxBuilder = 'gnosis-txBuilder',
ZkSync = 'zksync',
}

export const PROTOCOL_TO_DEFAULT_PROVIDER_TYPE: Record<
Expand Down Expand Up @@ -102,11 +102,6 @@ interface TypedProviderBase<T> {
provider: T;
}

export interface ZKSyncProvider extends TypedProviderBase<ZKSyncBaseProvider> {
type: ProviderType.ZkSync;
provider: ZKSyncBaseProvider;
}

export interface EthersV5Provider
extends TypedProviderBase<EV5Providers.Provider> {
type: ProviderType.EthersV5;
Expand Down Expand Up @@ -135,6 +130,11 @@ export interface CosmJsWasmProvider
provider: Promise<CosmWasmClient>;
}

export interface ZKSyncProvider extends TypedProviderBase<ZKSyncBaseProvider> {
type: ProviderType.ZkSync;
provider: ZKSyncBaseProvider;
}

export type TypedProvider =
| EthersV5Provider
// | EthersV6Provider
Expand All @@ -153,10 +153,6 @@ interface TypedContractBase<T> {
contract: T;
}

export interface ZKSyncContract extends TypedContractBase<ZKSyncBaseContract> {
type: ProviderType.ZkSync;
contract: ZKSyncBaseContract;
}
export interface EthersV5Contract extends TypedContractBase<EV5Contract> {
type: ProviderType.EthersV5;
contract: EV5Contract;
Expand Down Expand Up @@ -185,6 +181,11 @@ export interface CosmJsWasmContract
contract: CosmWasmContract;
}

export interface ZKSyncContract extends TypedContractBase<ZKSyncBaseContract> {
type: ProviderType.ZkSync;
contract: ZKSyncBaseContract;
}

export type TypedContract =
| EthersV5Contract
// | EthersV6Contract
Expand All @@ -208,11 +209,6 @@ export interface EthersV5Transaction
type: ProviderType.EthersV5;
transaction: EV5Transaction;
}
export interface ZKSyncTransaction
extends TypedTransactionBase<zkSyncTypes.TransactionRequest> {
type: ProviderType.ZkSync;
transaction: zkSyncTypes.TransactionRequest;
}

export type AnnotatedEV5Transaction = Annotated<EV5Transaction>;

Expand All @@ -238,6 +234,12 @@ export interface CosmJsWasmTransaction
transaction: ExecuteInstruction;
}

export interface ZKSyncTransaction
extends TypedTransactionBase<zkSyncTypes.TransactionRequest> {
type: ProviderType.ZkSync;
transaction: zkSyncTypes.TransactionRequest;
}

export type TypedTransaction =
| EthersV5Transaction
// | EthersV6Transaction
Expand All @@ -255,11 +257,6 @@ interface TypedTransactionReceiptBase<T> {
receipt: T;
}

export interface ZKSyncTransactionReceipt
extends TypedTransactionReceiptBase<zkSyncTypes.TransactionReceipt> {
type: ProviderType.ZkSync;
receipt: zkSyncTypes.TransactionReceipt;
}
export interface EthersV5TransactionReceipt
extends TypedTransactionReceiptBase<EV5Providers.TransactionReceipt> {
type: ProviderType.EthersV5;
Expand Down Expand Up @@ -290,6 +287,12 @@ export interface CosmJsWasmTransactionReceipt
receipt: DeliverTxResponse;
}

export interface ZKSyncTransactionReceipt
extends TypedTransactionReceiptBase<zkSyncTypes.TransactionReceipt> {
type: ProviderType.ZkSync;
receipt: zkSyncTypes.TransactionReceipt;
}

export type TypedTransactionReceipt =
| EthersV5TransactionReceipt
| ViemTransactionReceipt
Expand Down

0 comments on commit 328d256

Please sign in to comment.