@agoric/orchestration 0.1.1-dev-ecc38fc.0 → 0.1.1-dev-394a500.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/orchestration",
3
- "version": "0.1.1-dev-ecc38fc.0+ecc38fc",
3
+ "version": "0.1.1-dev-394a500.0+394a500",
4
4
  "description": "Chain abstraction for Agoric's orchestration clients",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -33,19 +33,19 @@
33
33
  },
34
34
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
35
35
  "dependencies": {
36
- "@agoric/async-flow": "0.1.1-dev-ecc38fc.0+ecc38fc",
37
- "@agoric/cosmic-proto": "0.4.1-dev-ecc38fc.0+ecc38fc",
38
- "@agoric/ertp": "0.16.3-dev-ecc38fc.0+ecc38fc",
39
- "@agoric/internal": "0.3.3-dev-ecc38fc.0+ecc38fc",
40
- "@agoric/network": "0.1.1-dev-ecc38fc.0+ecc38fc",
41
- "@agoric/notifier": "0.6.3-dev-ecc38fc.0+ecc38fc",
42
- "@agoric/store": "0.9.3-dev-ecc38fc.0+ecc38fc",
43
- "@agoric/time": "0.3.3-dev-ecc38fc.0+ecc38fc",
44
- "@agoric/vat-data": "0.5.3-dev-ecc38fc.0+ecc38fc",
45
- "@agoric/vats": "0.15.2-dev-ecc38fc.0+ecc38fc",
46
- "@agoric/vow": "0.1.1-dev-ecc38fc.0+ecc38fc",
47
- "@agoric/zoe": "0.26.3-dev-ecc38fc.0+ecc38fc",
48
- "@agoric/zone": "0.2.3-dev-ecc38fc.0+ecc38fc",
36
+ "@agoric/async-flow": "0.1.1-dev-394a500.0+394a500",
37
+ "@agoric/cosmic-proto": "0.4.1-dev-394a500.0+394a500",
38
+ "@agoric/ertp": "0.16.3-dev-394a500.0+394a500",
39
+ "@agoric/internal": "0.3.3-dev-394a500.0+394a500",
40
+ "@agoric/network": "0.1.1-dev-394a500.0+394a500",
41
+ "@agoric/notifier": "0.6.3-dev-394a500.0+394a500",
42
+ "@agoric/store": "0.9.3-dev-394a500.0+394a500",
43
+ "@agoric/time": "0.3.3-dev-394a500.0+394a500",
44
+ "@agoric/vat-data": "0.5.3-dev-394a500.0+394a500",
45
+ "@agoric/vats": "0.15.2-dev-394a500.0+394a500",
46
+ "@agoric/vow": "0.1.1-dev-394a500.0+394a500",
47
+ "@agoric/zoe": "0.26.3-dev-394a500.0+394a500",
48
+ "@agoric/zone": "0.2.3-dev-394a500.0+394a500",
49
49
  "@endo/base64": "^1.0.6",
50
50
  "@endo/errors": "^1.2.4",
51
51
  "@endo/far": "^1.1.4",
@@ -54,7 +54,7 @@
54
54
  "@noble/hashes": "github:paulmillr/noble-hashes#ae060daa6252f3ff2aa2f84e887de0aab491281d"
55
55
  },
56
56
  "devDependencies": {
57
- "@agoric/swingset-liveslots": "0.10.3-dev-ecc38fc.0+ecc38fc",
57
+ "@agoric/swingset-liveslots": "0.10.3-dev-394a500.0+394a500",
58
58
  "@chain-registry/client": "^1.47.4",
59
59
  "@cosmjs/amino": "^0.32.3",
60
60
  "@cosmjs/proto-signing": "^0.32.3",
@@ -94,5 +94,5 @@
94
94
  "typeCoverage": {
95
95
  "atLeast": 98.1
96
96
  },
97
- "gitHead": "ecc38fcb4d0499026d6f8a2ac52d652dfe6e7bb9"
97
+ "gitHead": "394a5004a66d53fb6575fa6b66c44c843e6fc1e1"
98
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAgBlC;AAEH;;;;;;cAAsD;AAwB/C,2BAVI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,uBAA2B,EAAE,uBAAuB,CAAC;IACrD,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;GAmGjB;4BArHY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,SAAa,EAAE,MAAM,CAAC;IACtB,UAAc,EAAE,OAAO,CAAC;CACrB;yBAkHU,OAAO,KAAK;6BApJiB,cAAc;4BADhC,kBAAkB;6CAIwB,aAAa;kCAFjD,cAAc;6BAHnB,kBAAkB;mDAII,uBAAuB;qCAF5B,cAAc"}
1
+ {"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAgBlC;AAEH;;;;;;cAAsD;AAwB/C,2BAVI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,uBAA2B,EAAE,uBAAuB,CAAC;IACrD,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;GA0GjB;4BA5HY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,SAAa,EAAE,MAAM,CAAC;IACtB,UAAc,EAAE,OAAO,CAAC;CACrB;yBAyHU,OAAO,KAAK;6BA3JiB,cAAc;4BADhC,kBAAkB;6CAIwB,aAAa;kCAFjD,cAAc;6BAHnB,kBAAkB;mDAII,uBAAuB;qCAF5B,cAAc"}
@@ -115,17 +115,24 @@ export const start = async (zcf, privateArgs, baggage) => {
115
115
  ? await E(orchestration).provideICQConnection(controllerConnectionId)
116
116
  : undefined;
117
117
 
118
- const accountAddress = await E(account).getAddress();
119
- trace('account address', accountAddress);
118
+ const [chainAddress, localAddress, remoteAddress] = await Promise.all([
119
+ E(account).getAddress(),
120
+ E(account).getLocalAddress(),
121
+ E(account).getRemoteAddress(),
122
+ ]);
123
+ trace('account address', chainAddress);
120
124
  const accountNode = await E(accountsStorageNode).makeChildNode(
121
- accountAddress.value,
125
+ chainAddress.value,
126
+ );
127
+ const holder = makeCosmosOrchestrationAccount(
128
+ { chainAddress, bondDenom, localAddress, remoteAddress },
129
+ {
130
+ account,
131
+ storageNode: accountNode,
132
+ icqConnection,
133
+ timer,
134
+ },
122
135
  );
123
- const holder = makeCosmosOrchestrationAccount(accountAddress, bondDenom, {
124
- account,
125
- storageNode: accountNode,
126
- icqConnection,
127
- timer,
128
- });
129
136
  return holder;
130
137
  }
131
138
 
@@ -7,11 +7,19 @@
7
7
  * topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
8
8
  * account: IcaAccount;
9
9
  * chainAddress: ChainAddress;
10
+ * localAddress: LocalIbcAddress;
11
+ * remoteAddress: RemoteIbcAddress;
10
12
  * icqConnection: ICQConnection | undefined;
11
13
  * bondDenom: string;
12
14
  * timer: Remote<TimerService>;
13
15
  * }} State
14
16
  */
17
+ /**
18
+ * @typedef {{
19
+ * localAddress: LocalIbcAddress;
20
+ * remoteAddress: RemoteIbcAddress;
21
+ * }} CosmosOrchestrationAccountStorageState
22
+ */
15
23
  /** @see {OrchestrationAccountI} */
16
24
  export const IcaAccountHolderI: import("@endo/patterns").InterfaceGuard<{
17
25
  delegate: import("@endo/patterns").MethodGuard;
@@ -37,7 +45,12 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
37
45
  timerService: Remote<TimerService>;
38
46
  vowTools: VowTools;
39
47
  zcf: ZCF;
40
- }): (chainAddress: ChainAddress, bondDenom: string, io: {
48
+ }): (args_0: {
49
+ chainAddress: ChainAddress;
50
+ bondDenom: string;
51
+ localAddress: LocalIbcAddress;
52
+ remoteAddress: RemoteIbcAddress;
53
+ }, io: {
41
54
  account: IcaAccount;
42
55
  storageNode: Remote<StorageNode>;
43
56
  icqConnection: ICQConnection | undefined;
@@ -184,10 +197,16 @@ export type State = {
184
197
  topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
185
198
  account: IcaAccount;
186
199
  chainAddress: ChainAddress;
200
+ localAddress: LocalIbcAddress;
201
+ remoteAddress: RemoteIbcAddress;
187
202
  icqConnection: ICQConnection | undefined;
188
203
  bondDenom: string;
189
204
  timer: Remote<TimerService>;
190
205
  };
206
+ export type CosmosOrchestrationAccountStorageState = {
207
+ localAddress: LocalIbcAddress;
208
+ remoteAddress: RemoteIbcAddress;
209
+ };
191
210
  export type CosmosOrchestrationAccountKit = ReturnType<ReturnType<typeof prepareCosmosOrchestrationAccountKit>>;
192
211
  export type CosmosOrchestrationAccount = CosmosOrchestrationAccountKit["holder"];
193
212
  import type { Zone } from '@agoric/zone';
@@ -197,6 +216,8 @@ import type { TimerService } from '@agoric/time';
197
216
  import type { Remote } from '@agoric/internal';
198
217
  import type { VowTools } from '@agoric/vow';
199
218
  import type { ChainAddress } from '../types.js';
219
+ import type { LocalIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
220
+ import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
200
221
  import type { IcaAccount } from '../types.js';
201
222
  import type { ICQConnection } from '../types.js';
202
223
  import type { AmountArg } from '../types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAyDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,mCAAmC;AACnC;;;;;;;;;;;;;;;;;GAeG;AAmBI,2DARI,IAAI,gGAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC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;gCAG5L,wDAAwD;iCAFtC,6CAA6C"}
@@ -49,6 +49,7 @@ import { makeTimestampHelper } from '../utils/time.js';
49
49
  * @import {ResponseQuery} from '@agoric/cosmic-proto/tendermint/abci/types.js';
50
50
  * @import {JsonSafe} from '@agoric/cosmic-proto';
51
51
  * @import {Matcher} from '@endo/patterns';
52
+ * @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
52
53
  */
53
54
 
54
55
  const trace = makeTracer('ComosOrchestrationAccountHolder');
@@ -65,12 +66,21 @@ const { Vow$ } = NetworkShape; // TODO #9611
65
66
  * topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
66
67
  * account: IcaAccount;
67
68
  * chainAddress: ChainAddress;
69
+ * localAddress: LocalIbcAddress;
70
+ * remoteAddress: RemoteIbcAddress;
68
71
  * icqConnection: ICQConnection | undefined;
69
72
  * bondDenom: string;
70
73
  * timer: Remote<TimerService>;
71
74
  * }} State
72
75
  */
73
76
 
77
+ /**
78
+ * @typedef {{
79
+ * localAddress: LocalIbcAddress;
80
+ * remoteAddress: RemoteIbcAddress;
81
+ * }} CosmosOrchestrationAccountStorageState
82
+ */
83
+
74
84
  /** @see {OrchestrationAccountI} */
75
85
  export const IcaAccountHolderI = M.interface('IcaAccountHolder', {
76
86
  ...orchestrationAccountMethods,
@@ -178,8 +188,11 @@ export const prepareCosmosOrchestrationAccountKit = (
178
188
  }),
179
189
  },
180
190
  /**
181
- * @param {ChainAddress} chainAddress
182
- * @param {string} bondDenom e.g. 'uatom'
191
+ * @param {object} info
192
+ * @param {ChainAddress} info.chainAddress
193
+ * @param {string} info.bondDenom e.g. 'uatom'
194
+ * @param {LocalIbcAddress} info.localAddress
195
+ * @param {RemoteIbcAddress} info.remoteAddress
183
196
  * @param {object} io
184
197
  * @param {IcaAccount} io.account
185
198
  * @param {Remote<StorageNode>} io.storageNode
@@ -187,14 +200,29 @@ export const prepareCosmosOrchestrationAccountKit = (
187
200
  * @param {Remote<TimerService>} io.timer
188
201
  * @returns {State}
189
202
  */
190
- (chainAddress, bondDenom, io) => {
203
+ ({ chainAddress, bondDenom, localAddress, remoteAddress }, io) => {
191
204
  const { storageNode, ...rest } = io;
192
205
  // must be the fully synchronous maker because the kit is held in durable state
193
206
  const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]);
194
207
  // TODO determine what goes in vstorage https://github.com/Agoric/agoric-sdk/issues/9066
195
- void E(topicKit.recorder).write('');
196
-
197
- return { chainAddress, bondDenom, topicKit, ...rest };
208
+ // XXX consider parsing local/remoteAddr to portId, channelId, counterpartyPortId, counterpartyChannelId, connectionId, counterpartyConnectionId
209
+ // FIXME these values will not update if IcaAccount gets new values after reopening.
210
+ // consider having IcaAccount responsible for the owning the writer. It might choose to share it with COA.
211
+ void E(topicKit.recorder).write(
212
+ /** @type {CosmosOrchestrationAccountStorageState} */ ({
213
+ localAddress,
214
+ remoteAddress,
215
+ }),
216
+ );
217
+
218
+ return {
219
+ chainAddress,
220
+ bondDenom,
221
+ localAddress,
222
+ remoteAddress,
223
+ topicKit,
224
+ ...rest,
225
+ };
198
226
  },
199
227
  {
200
228
  helper: {
@@ -52,12 +52,12 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
52
52
  */
53
53
  onFulfilled(icqConnection: ICQConnection, msgs: JsonSafe<RequestQuery>[]): Vow<JsonSafe<ResponseQuery>[]>;
54
54
  };
55
- getAddressWatcher: {
55
+ getAddressesWatcher: {
56
56
  /**
57
- * @param {ChainAddress} chainAddress
57
+ * @param {[ChainAddress, LocalIbcAddress, RemoteIbcAddress]} chainAddresses
58
58
  * @param {IcaAccount} account
59
59
  */
60
- onFulfilled(chainAddress: ChainAddress, account: IcaAccount): Vow<import("@endo/exo").Guarded<{
60
+ onFulfilled([chainAddress, localAddress, remoteAddress]: [ChainAddress, LocalIbcAddress, RemoteIbcAddress], account: IcaAccount): Vow<import("@endo/exo").Guarded<{
61
61
  asContinuingOffer(): Vow<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & import("../utils/zoe-tools.js").ResolvedContinuingOfferResult : import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
62
62
  getPublicTopics(): Vow<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> : import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
63
63
  getAddress(): import("@agoric/async-flow").HostInterface<ChainAddress>;
@@ -82,11 +82,15 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
82
82
  * @param {{
83
83
  * account: IcaAccount;
84
84
  * chainAddress: ChainAddress;
85
+ * localAddress: LocalIbcAddress;
86
+ * remoteAddress: RemoteIbcAddress;
85
87
  * }} ctx
86
88
  */
87
- onFulfilled(childNode: Remote<StorageNode>, { account, chainAddress }: {
89
+ onFulfilled(childNode: Remote<StorageNode>, { account, chainAddress, localAddress, remoteAddress }: {
88
90
  account: IcaAccount;
89
91
  chainAddress: ChainAddress;
92
+ localAddress: LocalIbcAddress;
93
+ remoteAddress: RemoteIbcAddress;
90
94
  }): import("@endo/exo").Guarded<{
91
95
  asContinuingOffer(): Vow<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & import("../utils/zoe-tools.js").ResolvedContinuingOfferResult : import("@agoric/async-flow").HostInterface<import("../utils/zoe-tools.js").ResolvedContinuingOfferResult>>;
92
96
  getPublicTopics(): Vow<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> extends import("@endo/pass-style").Passable ? import("@endo/pass-style").Passable & Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>> : import("@agoric/async-flow").HostInterface<Record<string, import("@agoric/zoe/src/contractSupport/topics.js").ResolvedPublicTopic<unknown>>>>;
@@ -130,6 +134,8 @@ import type { ResponseQuery } from '@agoric/cosmic-proto/tendermint/abci/types.j
130
134
  import type { IcaAccount } from '../types.js';
131
135
  import type { ICQConnection } from '../types.js';
132
136
  import type { ChainAddress } from '../types.js';
137
+ import type { LocalIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
138
+ import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
133
139
  import type { Remote } from '@agoric/internal';
134
140
  import type { prepareCosmosOrchestrationAccount } from './cosmos-orchestration-account.js';
135
141
  import type { CosmosInterchainService } from './cosmos-interchain-service.js';
@@ -1 +1 @@
1
- {"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"AA0OO,+CAHI,IAAI,UACJ,uBAAuB;;;;;;;;;;;;;;;;QA/H1B,4CAA4C;;QAK5C,2CAA2C;;QA4B3C,qCAAqC;;;;QAyBrC;;WAEG;8CADQ,CAAC,UAAU,EAAE,aAAa,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;QAelD;;;;WAIG;mCAHQ,aAAa,QACb,SAAS,YAAY,CAAC,EAAE,GACtB,IAAI,SAAS,aAAa,CAAC,EAAE,CAAC;;;QAU3C;;;WAGG;kCAFQ,YAAY,WACZ,UAAU;;;;;;;;;;;;;;;;;;;;QAWrB;;;;;;WAMG;+BALQ,OAAO,WAAW,CAAC,6BACnB;YACV,OAAW,EAAE,UAAU,CAAC;YACxB,YAAgB,EAAE,YAAY,CAAC;SAC5B;;;;;;;;;;;;;;;;;;;cA2BX;sCApNY;IACZ,8BAAkC,EAAE,UAAU,CAC9C,wCAA8C,CACzC,CAAC;IACN,aAAiB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACnD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KA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,CAC9C,wCAA8C,CACzC,CAAC;IACN,aAAiB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACnD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,QAAY,EAAE,QAAQ,CAAC;CACpB;qCAIS;IACZ,eAAmB,EAAE,eAAe,CAAC;IACrC,cAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAiB,EAAE,aAAa,GAAG,SAAS,CAAC;CAC1C;oCA6NU,UAAU,CAAC,OAAO,wBAAwB,CAAC;gCAC3C,UAAU,CAAC,qBAAqB,CAAC;0BA9PxB,mBAAmB;uCAS2D,aAAa;yBAJlF,aAAa;kCAHC,+CAA+C;8BADlE,sBAAsB;mCACH,+CAA+C;gCAOQ,aAAa;mCAAb,aAAa;kCAAb,aAAa;qCAH9D,iCAAiC;sCAAjC,iCAAiC;4BAF5D,kBAAkB;uDAIS,mCAAmC;6CAD7C,gCAAgC;kCAJ3C,cAAc;8BAEb,aAAa;qCAIwD,aAAa"}
@@ -14,6 +14,7 @@ import { ChainAddressShape, ChainFacadeI, ICQMsgShape } from '../typeGuards.js';
14
14
  * @import {TimerService} from '@agoric/time';
15
15
  * @import {Remote} from '@agoric/internal';
16
16
  * @import {Vow, VowTools} from '@agoric/vow';
17
+ * @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
17
18
  * @import {CosmosInterchainService} from './cosmos-interchain-service.js';
18
19
  * @import {prepareCosmosOrchestrationAccount} from './cosmos-orchestration-account.js';
19
20
  * @import {CosmosChainInfo, IBCConnectionInfo, ChainAddress, IcaAccount, Chain, ICQConnection} from '../types.js';
@@ -79,13 +80,18 @@ const prepareRemoteChainFacadeKit = (
79
80
  ]).returns(VowShape),
80
81
  },
81
82
  ),
82
- getAddressWatcher: M.interface('getAddressWatcher', {
83
- onFulfilled: M.call(ChainAddressShape, M.remotable()).returns(VowShape),
83
+ getAddressesWatcher: M.interface('getAddressWatcher', {
84
+ onFulfilled: M.call(
85
+ [ChainAddressShape, M.string(), M.string()],
86
+ M.remotable(),
87
+ ).returns(VowShape),
84
88
  }),
85
89
  makeChildNodeWatcher: M.interface('makeChildNodeWatcher', {
86
90
  onFulfilled: M.call(M.remotable(), {
87
91
  account: M.remotable(),
88
92
  chainAddress: ChainAddressShape,
93
+ localAddress: M.string(),
94
+ remoteAddress: M.string(),
89
95
  }).returns(M.remotable()),
90
96
  }),
91
97
  },
@@ -170,8 +176,12 @@ const prepareRemoteChainFacadeKit = (
170
176
  // no need to pass icqConnection in ctx; we can get it from state
171
177
  }
172
178
  return watch(
173
- E(account).getAddress(),
174
- this.facets.getAddressWatcher,
179
+ allVows([
180
+ E(account).getAddress(),
181
+ E(account).getLocalAddress(),
182
+ E(account).getRemoteAddress(),
183
+ ]),
184
+ this.facets.getAddressesWatcher,
175
185
  account,
176
186
  );
177
187
  },
@@ -189,16 +199,16 @@ const prepareRemoteChainFacadeKit = (
189
199
  return watch(E(icqConnection).query(msgs));
190
200
  },
191
201
  },
192
- getAddressWatcher: {
202
+ getAddressesWatcher: {
193
203
  /**
194
- * @param {ChainAddress} chainAddress
204
+ * @param {[ChainAddress, LocalIbcAddress, RemoteIbcAddress]} chainAddresses
195
205
  * @param {IcaAccount} account
196
206
  */
197
- onFulfilled(chainAddress, account) {
207
+ onFulfilled([chainAddress, localAddress, remoteAddress], account) {
198
208
  return watch(
199
209
  E(storageNode).makeChildNode(chainAddress.value),
200
210
  this.facets.makeChildNodeWatcher,
201
- { account, chainAddress },
211
+ { account, chainAddress, localAddress, remoteAddress },
202
212
  );
203
213
  },
204
214
  },
@@ -208,20 +218,33 @@ const prepareRemoteChainFacadeKit = (
208
218
  * @param {{
209
219
  * account: IcaAccount;
210
220
  * chainAddress: ChainAddress;
221
+ * localAddress: LocalIbcAddress;
222
+ * remoteAddress: RemoteIbcAddress;
211
223
  * }} ctx
212
224
  */
213
- onFulfilled(childNode, { account, chainAddress }) {
225
+ onFulfilled(
226
+ childNode,
227
+ { account, chainAddress, localAddress, remoteAddress },
228
+ ) {
214
229
  const { remoteChainInfo, icqConnection } = this.state;
215
230
  const stakingDenom = remoteChainInfo.stakingTokens?.[0]?.denom;
216
231
  if (!stakingDenom) throw Fail`chain info lacks staking denom`;
217
232
 
218
- return makeCosmosOrchestrationAccount(chainAddress, stakingDenom, {
219
- account,
220
- // FIXME storage path https://github.com/Agoric/agoric-sdk/issues/9066
221
- storageNode: childNode,
222
- icqConnection,
223
- timer,
224
- });
233
+ return makeCosmosOrchestrationAccount(
234
+ {
235
+ chainAddress,
236
+ bondDenom: stakingDenom,
237
+ localAddress,
238
+ remoteAddress,
239
+ },
240
+ {
241
+ account,
242
+ // FIXME storage path https://github.com/Agoric/agoric-sdk/issues/9066
243
+ storageNode: childNode,
244
+ icqConnection,
245
+ timer,
246
+ },
247
+ );
225
248
  },
226
249
  },
227
250
  },