Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion connect/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { Chain, Network, Platform } from "@wormhole-foundation/sdk-base";
import { circle, executor } from "@wormhole-foundation/sdk-base";
import type { ChainConfig, ChainsConfig } from "@wormhole-foundation/sdk-definitions";
import type {
CapabilitiesResponse,
ChainConfig,
ChainsConfig,
} from "@wormhole-foundation/sdk-definitions";
import { buildConfig } from "@wormhole-foundation/sdk-definitions";

export const DEFAULT_TASK_TIMEOUT = 60 * 1000; // 1 minute in milliseconds
Expand All @@ -10,6 +14,10 @@ export type WormholeConfig<N extends Network = Network, P extends Platform = Pla
circleAPI: string;
executorAPI: string;
chains: ChainsConfig<N, P>;
executor?: {
/** Override the default capabilities fetcher (e.g. to cache or use a custom endpoint). */
getCapabilities?: (network: Network) => Promise<CapabilitiesResponse>;
};
};

export const CONFIG = {
Expand Down Expand Up @@ -47,6 +55,8 @@ export function networkPlatformConfigs<N extends Network, P extends Platform>(
type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
? RecursivePartial<U>[]
: T[P] extends (...args: any[]) => any
? T[P]
: T[P] extends object | undefined
? RecursivePartial<T[P]>
Comment thread
kev1n-peters marked this conversation as resolved.
: T[P];
Expand Down
3 changes: 3 additions & 0 deletions connect/src/wormhole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ export class Wormhole<N extends Network> {
}

async getExecutorCapabilities(): Promise<CapabilitiesResponse> {
if (this.config.executor?.getCapabilities) {
return await this.config.executor.getCapabilities(this._network);
}
return await fetchCapabilities(this.config.executorAPI);
}

Expand Down
Loading