diff --git a/packages/protocol-utils/src/endpoint/types.ts b/packages/protocol-utils/src/endpoint/types.ts index 93b80c4f9..1507a4973 100644 --- a/packages/protocol-utils/src/endpoint/types.ts +++ b/packages/protocol-utils/src/endpoint/types.ts @@ -1,7 +1,7 @@ -import type { Address, OmniGraph, OmniPointBasedFactory, OmniTransaction } from '@layerzerolabs/utils' +import type { Address, OmniGraph, OmniPointBasedFactory, OmniTransaction, IOmniSDK } from '@layerzerolabs/utils' import type { EndpointId } from '@layerzerolabs/lz-definitions' -export interface IEndpoint { +export interface IEndpoint extends IOmniSDK { getDefaultReceiveLibrary(eid: EndpointId): Promise
setDefaultReceiveLibrary( eid: EndpointId, diff --git a/packages/protocol-utils/src/uln302/types.ts b/packages/protocol-utils/src/uln302/types.ts index 1e59bb93f..f5b5ee3f0 100644 --- a/packages/protocol-utils/src/uln302/types.ts +++ b/packages/protocol-utils/src/uln302/types.ts @@ -1,7 +1,7 @@ -import type { Address, OmniGraph, OmniPointBasedFactory, OmniTransaction } from '@layerzerolabs/utils' +import type { Address, OmniGraph, OmniPointBasedFactory, OmniTransaction, IOmniSDK } from '@layerzerolabs/utils' import type { EndpointId } from '@layerzerolabs/lz-definitions' -export interface IUln302 { +export interface IUln302 extends IOmniSDK { getUlnConfig(eid: EndpointId, address?: Address | null | undefined): Promise getExecutorConfig(eid: EndpointId, address?: Address | null | undefined): Promise setDefaultExecutorConfig(eid: EndpointId, config: Uln302ExecutorConfig): Promise diff --git a/packages/ua-utils/src/oapp/types.ts b/packages/ua-utils/src/oapp/types.ts index 320e5f2a7..dc3c177a7 100644 --- a/packages/ua-utils/src/oapp/types.ts +++ b/packages/ua-utils/src/oapp/types.ts @@ -1,10 +1,10 @@ import type { EndpointId } from '@layerzerolabs/lz-definitions' import type { IEndpoint } from '@layerzerolabs/protocol-utils' -import type { Address, OmniGraph, OmniTransaction } from '@layerzerolabs/utils' +import type { Address, OmniGraph, OmniTransaction, IOmniSDK } from '@layerzerolabs/utils' import type { Bytes32 } from '@layerzerolabs/utils' import type { OmniPointBasedFactory } from '@layerzerolabs/utils' -export interface IOApp { +export interface IOApp extends IOmniSDK { getEndpoint(): Promise getPeer(eid: EndpointId): Promise hasPeer(eid: EndpointId, address: Bytes32 | Address | null | undefined): Promise diff --git a/packages/utils/src/omnigraph/types.ts b/packages/utils/src/omnigraph/types.ts index 2782d646e..abfdb15ad 100644 --- a/packages/utils/src/omnigraph/types.ts +++ b/packages/utils/src/omnigraph/types.ts @@ -68,3 +68,10 @@ export type OmniPointBasedFactory = (point: OmniPoint) => TValue | Promi * Helper type that adds eid property to an underlying type */ export type WithEid = TValue & { eid: EndpointId } + +/** + * Base interface for all SDKs + */ +export interface IOmniSDK { + point: OmniPoint +}