@agoric/orchestration 0.1.1-dev-66bf702.0 → 0.1.1-dev-76f3e6f.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { Fail } from '@endo/errors';
2
2
  import { E, Far } from '@endo/far';
3
3
  import { makeMarshal } from '@endo/marshal';
4
4
  import { makeTracer } from '@agoric/internal';
5
- import { registerChainNamespace } from '../chain-info.js';
5
+ import { registerKnownChains } from '../chain-info.js';
6
6
  import { CHAIN_KEY, CONNECTIONS_KEY } from '../exos/chain-hub.js';
7
7
 
8
8
  const trace = makeTracer('CoreEvalOrchestration', true);
@@ -127,7 +127,7 @@ export const initChainInfo = async ({
127
127
  await publishChainInfoToChainStorage(agoricNamesAdmin, chainStorageP);
128
128
 
129
129
  // Now register the names
130
- await registerChainNamespace(agoricNamesAdmin, trace);
130
+ await registerKnownChains(agoricNamesAdmin, trace);
131
131
  };
132
132
  harden(initChainInfo);
133
133
 
@@ -59,8 +59,8 @@ export const startStakeAtom = async ({
59
59
  installation: stakeIca,
60
60
  terms: {
61
61
  chainId: cosmoshub.chainId,
62
- hostConnectionId: connectionInfo.id,
63
- controllerConnectionId: connectionInfo.counterparty.connection_id,
62
+ hostConnectionId: connectionInfo.counterparty.connection_id,
63
+ controllerConnectionId: connectionInfo.id,
64
64
  bondDenom: cosmoshub.stakingTokens[0].denom,
65
65
  icqEnabled: cosmoshub.icqEnabled,
66
66
  },
@@ -64,8 +64,8 @@ export const startStakeOsmo = async ({
64
64
  installation: stakeIca,
65
65
  terms: {
66
66
  chainId: osmosis.chainId,
67
- hostConnectionId: connectionInfo.id,
68
- controllerConnectionId: connectionInfo.counterparty.connection_id,
67
+ hostConnectionId: connectionInfo.counterparty.connection_id,
68
+ controllerConnectionId: connectionInfo.id,
69
69
  bondDenom: osmosis.stakingTokens[0].denom,
70
70
  icqEnabled: osmosis.icqEnabled,
71
71
  },
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @import {TypedPattern} from '@agoric/internal';
3
- * @import {CosmosChainInfo} from './cosmos-api.js';
3
+ * @import {ChainInfo, CosmosChainInfo} from './types.js';
4
4
  */
5
5
  /**
6
6
  * Used for IBC Channel Connections that only send outgoing transactions. If
@@ -42,11 +42,10 @@ export const IBCChannelIDShape: import("@endo/patterns").Matcher;
42
42
  export const IBCChannelInfoShape: import("@endo/patterns").Matcher;
43
43
  export const IBCConnectionIDShape: import("@endo/patterns").Matcher;
44
44
  export const IBCConnectionInfoShape: import("@endo/patterns").Matcher;
45
- /**
46
- * @type {TypedPattern<CosmosChainInfo>}
47
- */
45
+ /** @type {TypedPattern<CosmosChainInfo>} */
48
46
  export const CosmosChainInfoShape: TypedPattern<CosmosChainInfo>;
49
- export const ChainInfoShape: import("@endo/patterns").Matcher;
47
+ /** @type {TypedPattern<ChainInfo>} */
48
+ export const ChainInfoShape: TypedPattern<ChainInfo>;
50
49
  export const LocalChainAccountShape: import("@endo/patterns").Matcher;
51
50
  export const DenomShape: import("@endo/patterns").Matcher;
52
51
  export const BrandInfoShape: import("@endo/patterns").Matcher;
@@ -64,6 +63,7 @@ export namespace TimestampProtoShape {
64
63
  let seconds: import("@endo/patterns").Matcher;
65
64
  let nanos: import("@endo/patterns").Matcher;
66
65
  }
67
- import type { CosmosChainInfo } from './cosmos-api.js';
66
+ import type { CosmosChainInfo } from './types.js';
68
67
  import type { TypedPattern } from '@agoric/internal';
68
+ import type { ChainInfo } from './types.js';
69
69
  //# sourceMappingURL=typeGuards.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH;;;;GAIG;AACH;;;GAQE;;;;;;;;;;;;;;;;;;;;;;AAiBF,8DAAkE;;;;;AAOlE,uEAUE;AAEF,iEAA4C;AAC5C,mEAQG;AACH,oEAA+C;AAC/C,sEAYG;AAEH;;GAEG;AACH,mCAFU,aAAa,eAAe,CAAC,CAYrC;AAGF,8DAAsC;AACtC,sEAAuE;AACvE,0DAAqC;AAErC,8DAAsC;;;;;;AAItC,mBAAmB;AACnB;;;GAGG;;;;;qCAzG+B,iBAAiB;kCADpB,kBAAkB"}
1
+ {"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH;;;;GAIG;AACH;;;GAQE;;;;;;;;;;;;;;;;;;;;;;AAiBF,8DAAkE;;;;;AAOlE,uEAUE;AAEF,iEAA4C;AAC5C,mEAQG;AACH,oEAA+C;AAC/C,sEAYG;AAEH,4CAA4C;AAC5C,mCADW,aAAa,eAAe,CAAC,CAWtC;AAEF,sCAAsC;AACtC,6BADW,aAAa,SAAS,CAAC,CAG/B;AACH,sEAAuE;AACvE,0DAAqC;AAErC,8DAAsC;;;;;;AAItC,mBAAmB;AACnB;;;GAGG;;;;;qCAzG0C,YAAY;kCAD1B,kBAAkB;+BACJ,YAAY"}
package/src/typeGuards.js CHANGED
@@ -4,7 +4,7 @@ import { M } from '@endo/patterns';
4
4
 
5
5
  /**
6
6
  * @import {TypedPattern} from '@agoric/internal';
7
- * @import {CosmosChainInfo} from './cosmos-api.js';
7
+ * @import {ChainInfo, CosmosChainInfo} from './types.js';
8
8
  */
9
9
 
10
10
  /**
@@ -81,9 +81,7 @@ export const IBCConnectionInfoShape = M.splitRecord({
81
81
  transferChannel: IBCChannelInfoShape,
82
82
  });
83
83
 
84
- /**
85
- * @type {TypedPattern<CosmosChainInfo>}
86
- */
84
+ /** @type {TypedPattern<CosmosChainInfo>} */
87
85
  export const CosmosChainInfoShape = M.splitRecord(
88
86
  {
89
87
  chainId: M.string(),
@@ -96,11 +94,13 @@ export const CosmosChainInfoShape = M.splitRecord(
96
94
  },
97
95
  );
98
96
 
99
- // FIXME more validation
100
- export const ChainInfoShape = M.any();
97
+ /** @type {TypedPattern<ChainInfo>} */
98
+ export const ChainInfoShape = M.splitRecord({
99
+ chainId: M.string(),
100
+ });
101
101
  export const LocalChainAccountShape = M.remotable('LocalChainAccount');
102
102
  export const DenomShape = M.string();
103
- // FIXME more validation
103
+ // TODO define for #9211
104
104
  export const BrandInfoShape = M.any();
105
105
 
106
106
  export const DenomAmountShape = { denom: DenomShape, value: M.bigint() };
@@ -7,7 +7,7 @@ import { Fail } from '@endo/errors';
7
7
  */
8
8
 
9
9
  /**
10
- * @param {IBCConnectionID} hostConnectionId Counterpart Connection ID
10
+ * @param {IBCConnectionID} hostConnectionId Counterparty Connection ID
11
11
  * @param {IBCConnectionID} controllerConnectionId Self Connection ID
12
12
  * @param {object} [opts]
13
13
  * @param {string} [opts.encoding] - message encoding format for the channel.
@@ -53,8 +53,8 @@ function toConnectionEntry(ibcInfo, name, chainInfo) {
53
53
  }
54
54
  const [channel] = transferChannels;
55
55
  const [channelFrom, channelTo] = fromChain1
56
- ? [channel.chain_2, channel.chain_1]
57
- : [channel.chain_1, channel.chain_2];
56
+ ? [channel.chain_1, channel.chain_2]
57
+ : [channel.chain_2, channel.chain_1];
58
58
  const record = {
59
59
  id: /** @type {IBCConnectionID} */ (from.connection_id),
60
60
  client_id: from.client_id,
@@ -2,13 +2,13 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
2
2
  chainHub: import("@endo/exo").Guarded<{
3
3
  registerChain(name: string, chainInfo: import("../cosmos-api.js").CosmosChainInfo): void;
4
4
  getChainInfo<K extends string>(chainName: K): import("@agoric/vow").Vow<ActualChainInfo<K>>;
5
- registerConnection(chainId1: string, chainId2: string, connectionInfo: import("../cosmos-api.js").IBCConnectionInfo): void;
6
- getConnectionInfo(chain1: string | {
5
+ registerConnection(primaryChainId: string, counterpartyChainId: string, connectionInfo: import("../cosmos-api.js").IBCConnectionInfo): void;
6
+ getConnectionInfo(primary: string | {
7
7
  chainId: string;
8
- }, chain2: string | {
8
+ }, counter: string | {
9
9
  chainId: string;
10
10
  }): import("@agoric/vow").Vow<import("../cosmos-api.js").IBCConnectionInfo>;
11
- getChainsAndConnection<C1 extends string, C2 extends string>(chainName1: C1, chainName2: C2): import("@agoric/vow").Vow<[ActualChainInfo<C1>, ActualChainInfo<C2>, import("../cosmos-api.js").IBCConnectionInfo]>;
11
+ getChainsAndConnection<C1 extends string, C2 extends string>(primaryName: C1, counterName: C2): import("@agoric/vow").Vow<[ActualChainInfo<C1>, ActualChainInfo<C2>, import("../cosmos-api.js").IBCConnectionInfo]>;
12
12
  }>;
13
13
  vowTools: {
14
14
  when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;