diff --git a/packages/orchestration/src/cosmos-api.ts b/packages/orchestration/src/cosmos-api.ts index 06c4587e4043..ea2a2424a58e 100644 --- a/packages/orchestration/src/cosmos-api.ts +++ b/packages/orchestration/src/cosmos-api.ts @@ -1,4 +1,4 @@ -import type { AnyJson, TypedJson } from '@agoric/cosmic-proto'; +import type { AnyJson, TypedJson, JsonSafe } from '@agoric/cosmic-proto'; import type { Delegation, Redelegation, @@ -11,6 +11,10 @@ import type { Order, } from '@agoric/cosmic-proto/ibc/core/channel/v1/channel.js'; import type { State as IBCConnectionState } from '@agoric/cosmic-proto/ibc/core/connection/v1/connection.js'; +import type { + RequestQuery, + ResponseQuery, +} from '@agoric/cosmic-proto/tendermint/abci/types.js'; import type { Brand, Purse, Payment, Amount } from '@agoric/ertp/src/types.js'; import type { Port } from '@agoric/network'; import type { IBCChannelID, IBCConnectionID } from '@agoric/vats'; @@ -265,3 +269,7 @@ export type CosmosChainAccountMethods = } ? StakingAccountActions : {}; + +export type ICQQueryFunction = ( + msgs: JsonSafe[], +) => Promise[]>; diff --git a/packages/orchestration/src/examples/basic-flows.flows.js b/packages/orchestration/src/examples/basic-flows.flows.js index d0bf98c9d9a4..f3664bfcc154 100644 --- a/packages/orchestration/src/examples/basic-flows.flows.js +++ b/packages/orchestration/src/examples/basic-flows.flows.js @@ -99,7 +99,6 @@ export const sendQuery = async (orch, _ctx, seat, { chainName, msgs }) => { mustMatch(chainName, M.string()); if (chainName === 'agoric') throw Fail`ICQ not supported on local chain`; const remoteChain = await orch.getChain(chainName); - // @ts-expect-error FIXME implement Chain.query const queryResponse = await remoteChain.query(msgs); console.debug('sendQuery response:', queryResponse); return queryResponse; diff --git a/packages/orchestration/src/orchestration-api.ts b/packages/orchestration/src/orchestration-api.ts index 3f9bc0aa37b9..8bc5aa2abec6 100644 --- a/packages/orchestration/src/orchestration-api.ts +++ b/packages/orchestration/src/orchestration-api.ts @@ -18,6 +18,7 @@ import type { IBCMsgTransferOptions, KnownChains, LocalAccountMethods, + ICQQueryFunction, } from './types.js'; import type { ResolvedContinuingOfferResult } from './utils/zoe-tools.js'; @@ -88,6 +89,8 @@ export interface Chain { makeAccount: () => Promise>; // FUTURE supply optional port object; also fetch port object + query: CI extends { icqEnabled: true } ? ICQQueryFunction : never; + // TODO provide a way to get the local denom/brand/whatever for this chain }