@agoric/orchestration 0.1.1-dev-1d94913.0 → 0.1.1-dev-0282e58.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.
Files changed (35) hide show
  1. package/package.json +15 -15
  2. package/src/chain-info.d.ts +261 -1
  3. package/src/chain-info.d.ts.map +1 -1
  4. package/src/chain-info.js +3 -1
  5. package/src/examples/sendAnywhere.contract.d.ts +1 -1
  6. package/src/examples/stakeIca.contract.d.ts +3 -1
  7. package/src/examples/stakeIca.contract.d.ts.map +1 -1
  8. package/src/examples/stakeIca.contract.js +4 -2
  9. package/src/examples/swapExample.contract.d.ts +1 -1
  10. package/src/examples/swapExample.contract.d.ts.map +1 -1
  11. package/src/examples/swapExample.contract.js +7 -7
  12. package/src/examples/unbondExample.contract.d.ts +2 -3
  13. package/src/examples/unbondExample.contract.d.ts.map +1 -1
  14. package/src/examples/unbondExample.contract.js +3 -3
  15. package/src/exos/chainAccountKit.d.ts +2 -1
  16. package/src/exos/chainAccountKit.d.ts.map +1 -1
  17. package/src/exos/chainAccountKit.js +5 -4
  18. package/src/exos/local-chain-account-kit.d.ts +275 -23
  19. package/src/exos/local-chain-account-kit.d.ts.map +1 -1
  20. package/src/facade.d.ts +1 -1
  21. package/src/facade.d.ts.map +1 -1
  22. package/src/facade.js +20 -14
  23. package/src/fetched-chain-info.d.ts +324 -61
  24. package/src/fetched-chain-info.js +262 -0
  25. package/src/proposals/orchestration-proposal.d.ts +3 -3
  26. package/src/proposals/start-stakeAtom.d.ts +1 -1
  27. package/src/proposals/start-stakeAtom.d.ts.map +1 -1
  28. package/src/proposals/start-stakeAtom.js +4 -2
  29. package/src/service.d.ts +2 -1
  30. package/src/service.d.ts.map +1 -1
  31. package/src/service.js +8 -3
  32. package/src/utils/chainHub.d.ts +300 -19
  33. package/src/utils/chainHub.d.ts.map +1 -1
  34. package/src/utils/chainHub.js +11 -13
  35. package/src/vat-orchestration.d.ts +2 -2
@@ -33,8 +33,8 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
33
33
  * : ChainInfo
34
34
  * >}
35
35
  */
36
- getChainInfo<K extends string>(chainName: K): Promise<K extends "celestia" | "agoric" | "cosmoshub" | "dydx" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" ? Omit<{
37
- agoric: {
36
+ getChainInfo<K extends string>(chainName: K): Promise<K extends "celestia" | "agoriclocal" | "agoric" | "cosmoshub" | "dydx" | "juno" | "neutron" | "noble" | "omniflixhub" | "osmosis" | "secretnetwork" | "stargaze" | "stride" ? Omit<{
37
+ agoriclocal: {
38
38
  chainId: string;
39
39
  connections: {
40
40
  'cosmoshub-4': {
@@ -52,6 +52,14 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
52
52
  portId: string;
53
53
  channelId: string;
54
54
  counterPartyChannelId: string;
55
+ /**
56
+ * The entries of the top-level namehubs in agoricNames are reflected to
57
+ * vstorage. But only the top level. So we combine the 2 chain ids into 1 key.
58
+ * Connections are directionless, so we sort the ids.
59
+ *
60
+ * @param {string} chainId1
61
+ * @param {string} chainId2
62
+ */
55
63
  counterPartyPortId: string;
56
64
  ordering: 1;
57
65
  state: 3;
@@ -81,13 +89,13 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
81
89
  };
82
90
  };
83
91
  };
84
- celestia: {
92
+ agoric: {
85
93
  chainId: string;
86
94
  stakingTokens: {
87
95
  denom: string;
88
96
  }[];
89
97
  connections: {
90
- 'neutron-1': {
98
+ 'cosmoshub-4': {
91
99
  id: string;
92
100
  client_id: string;
93
101
  counterparty: {
@@ -103,12 +111,21 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
103
111
  portId: string;
104
112
  counterPartyChannelId: string;
105
113
  counterPartyPortId: string;
114
+ /**
115
+ * Character used in a connection tuple key to separate the two chain ids. Valid
116
+ * because a chainId can contain only alphanumerics and dash.
117
+ *
118
+ * Vstorage keys can be only alphanumerics, dash or underscore. That leaves
119
+ * underscore as the only valid separator.
120
+ *
121
+ * @see {@link https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-2.md}
122
+ */
106
123
  ordering: number;
107
124
  state: number;
108
125
  version: string;
109
126
  };
110
127
  };
111
- 'osmosis-1': {
128
+ 'noble-1': {
112
129
  id: string;
113
130
  client_id: string;
114
131
  counterparty: {
@@ -129,7 +146,7 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
129
146
  version: string;
130
147
  };
131
148
  };
132
- 'secret-4': {
149
+ 'omniflixhub-1': {
133
150
  id: string;
134
151
  client_id: string;
135
152
  counterparty: {
@@ -143,14 +160,14 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
143
160
  transferChannel: {
144
161
  channelId: string;
145
162
  portId: string;
146
- counterPartyChannelId: string;
163
+ counterPartyChannelId: string; /** @type {MapStore<string, CosmosChainInfo>} */
147
164
  counterPartyPortId: string;
148
165
  ordering: number;
149
166
  state: number;
150
167
  version: string;
151
168
  };
152
169
  };
153
- 'stargaze-1': {
170
+ 'osmosis-1': {
154
171
  id: string;
155
172
  client_id: string;
156
173
  counterparty: {
@@ -182,6 +199,148 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
182
199
  version: string;
183
200
  };
184
201
  };
202
+ 'secret-4': {
203
+ id: string;
204
+ client_id: string;
205
+ counterparty: {
206
+ client_id: string;
207
+ connection_id: string;
208
+ prefix: {
209
+ key_prefix: string;
210
+ }; /**
211
+ * @template {string} K
212
+ * @param {K} chainName
213
+ * @returns {Promise<
214
+ * K extends keyof KnownChains
215
+ * ? Omit<KnownChains[K], 'connections'>
216
+ * : ChainInfo
217
+ * >}
218
+ */
219
+ };
220
+ state: number;
221
+ transferChannel: {
222
+ channelId: string;
223
+ portId: string;
224
+ counterPartyChannelId: string;
225
+ counterPartyPortId: string;
226
+ ordering: number;
227
+ state: number;
228
+ version: string;
229
+ };
230
+ };
231
+ 'stride-1': {
232
+ id: string;
233
+ client_id: string;
234
+ counterparty: {
235
+ client_id: string;
236
+ connection_id: string;
237
+ prefix: {
238
+ key_prefix: string;
239
+ };
240
+ };
241
+ state: number;
242
+ transferChannel: {
243
+ channelId: string;
244
+ portId: string;
245
+ counterPartyChannelId: string;
246
+ counterPartyPortId: string;
247
+ ordering: number;
248
+ state: number;
249
+ version: string;
250
+ };
251
+ };
252
+ };
253
+ };
254
+ celestia: {
255
+ chainId: string;
256
+ stakingTokens: {
257
+ denom: string;
258
+ }[];
259
+ connections: {
260
+ 'neutron-1': {
261
+ id: string;
262
+ client_id: string;
263
+ counterparty: {
264
+ client_id: string;
265
+ connection_id: string;
266
+ prefix: {
267
+ key_prefix: string;
268
+ };
269
+ };
270
+ state: number;
271
+ transferChannel: {
272
+ channelId: string;
273
+ portId: string;
274
+ counterPartyChannelId: string;
275
+ counterPartyPortId: string;
276
+ ordering: number;
277
+ state: number;
278
+ version: string;
279
+ };
280
+ };
281
+ 'osmosis-1': {
282
+ id: string;
283
+ client_id: string;
284
+ counterparty: {
285
+ client_id: string;
286
+ connection_id: string;
287
+ prefix: {
288
+ key_prefix: string;
289
+ };
290
+ };
291
+ state: number;
292
+ transferChannel: {
293
+ channelId: string;
294
+ portId: string;
295
+ counterPartyChannelId: string;
296
+ counterPartyPortId: string;
297
+ ordering: number;
298
+ state: number;
299
+ version: string;
300
+ };
301
+ };
302
+ 'secret-4': {
303
+ id: string;
304
+ client_id: string;
305
+ counterparty: {
306
+ client_id: string;
307
+ connection_id: string;
308
+ prefix: {
309
+ key_prefix: string;
310
+ };
311
+ };
312
+ state: number;
313
+ transferChannel: {
314
+ channelId: string;
315
+ portId: string;
316
+ counterPartyChannelId: string;
317
+ counterPartyPortId: string;
318
+ ordering: number;
319
+ state: number;
320
+ version: string;
321
+ };
322
+ };
323
+ 'stargaze-1': {
324
+ id: string;
325
+ client_id: string;
326
+ counterparty: {
327
+ client_id: string;
328
+ connection_id: string;
329
+ prefix: {
330
+ key_prefix: string;
331
+ };
332
+ };
333
+ state: number;
334
+ transferChannel: {
335
+ channelId: string;
336
+ portId: string;
337
+ counterPartyChannelId: string;
338
+ counterPartyPortId: string;
339
+ ordering: number;
340
+ state: number;
341
+ version: string;
342
+ };
343
+ };
185
344
  'stride-1': {
186
345
  id: string;
187
346
  client_id: string;
@@ -211,6 +370,27 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
211
370
  denom: string;
212
371
  }[];
213
372
  connections: {
373
+ 'agoric-3': {
374
+ id: string;
375
+ client_id: string;
376
+ counterparty: {
377
+ client_id: string;
378
+ connection_id: string;
379
+ prefix: {
380
+ key_prefix: string;
381
+ };
382
+ };
383
+ state: number;
384
+ transferChannel: {
385
+ channelId: string;
386
+ portId: string;
387
+ counterPartyChannelId: string;
388
+ counterPartyPortId: string;
389
+ ordering: number;
390
+ state: number;
391
+ version: string;
392
+ };
393
+ };
214
394
  'juno-1': {
215
395
  id: string;
216
396
  client_id: string;
@@ -231,11 +411,7 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
231
411
  state: number;
232
412
  version: string;
233
413
  };
234
- }; /**
235
- * @param {string} srcChainId
236
- * @param {string} destChainId
237
- * @returns {Promise<IBCConnectionInfo>}
238
- */
414
+ };
239
415
  'neutron-1': {
240
416
  id: string;
241
417
  client_id: string;
@@ -835,6 +1011,27 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
835
1011
  denom: string;
836
1012
  }[];
837
1013
  connections: {
1014
+ 'agoric-3': {
1015
+ id: string;
1016
+ client_id: string;
1017
+ counterparty: {
1018
+ client_id: string;
1019
+ connection_id: string;
1020
+ prefix: {
1021
+ key_prefix: string;
1022
+ };
1023
+ };
1024
+ state: number;
1025
+ transferChannel: {
1026
+ channelId: string;
1027
+ portId: string;
1028
+ counterPartyChannelId: string;
1029
+ counterPartyPortId: string;
1030
+ ordering: number;
1031
+ state: number;
1032
+ version: string;
1033
+ };
1034
+ };
838
1035
  'cosmoshub-4': {
839
1036
  id: string;
840
1037
  client_id: string;
@@ -1011,6 +1208,27 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
1011
1208
  denom: string;
1012
1209
  }[];
1013
1210
  connections: {
1211
+ 'agoric-3': {
1212
+ id: string;
1213
+ client_id: string;
1214
+ counterparty: {
1215
+ client_id: string;
1216
+ connection_id: string;
1217
+ prefix: {
1218
+ key_prefix: string;
1219
+ };
1220
+ };
1221
+ state: number;
1222
+ transferChannel: {
1223
+ channelId: string;
1224
+ portId: string;
1225
+ counterPartyChannelId: string;
1226
+ counterPartyPortId: string;
1227
+ ordering: number;
1228
+ state: number;
1229
+ version: string;
1230
+ };
1231
+ };
1014
1232
  'cosmoshub-4': {
1015
1233
  id: string;
1016
1234
  client_id: string;
@@ -1083,6 +1301,27 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
1083
1301
  }[];
1084
1302
  icqEnabled: boolean;
1085
1303
  connections: {
1304
+ 'agoric-3': {
1305
+ id: string;
1306
+ client_id: string;
1307
+ counterparty: {
1308
+ client_id: string;
1309
+ connection_id: string;
1310
+ prefix: {
1311
+ key_prefix: string;
1312
+ };
1313
+ };
1314
+ state: number;
1315
+ transferChannel: {
1316
+ channelId: string;
1317
+ portId: string;
1318
+ counterPartyChannelId: string;
1319
+ counterPartyPortId: string;
1320
+ ordering: number;
1321
+ state: number;
1322
+ version: string;
1323
+ };
1324
+ };
1086
1325
  celestia: {
1087
1326
  id: string;
1088
1327
  client_id: string;
@@ -1301,6 +1540,27 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
1301
1540
  denom: string;
1302
1541
  }[];
1303
1542
  connections: {
1543
+ 'agoric-3': {
1544
+ id: string;
1545
+ client_id: string;
1546
+ counterparty: {
1547
+ client_id: string;
1548
+ connection_id: string;
1549
+ prefix: {
1550
+ key_prefix: string;
1551
+ };
1552
+ };
1553
+ state: number;
1554
+ transferChannel: {
1555
+ channelId: string;
1556
+ portId: string;
1557
+ counterPartyChannelId: string;
1558
+ counterPartyPortId: string;
1559
+ ordering: number;
1560
+ state: number;
1561
+ version: string;
1562
+ };
1563
+ };
1304
1564
  celestia: {
1305
1565
  id: string;
1306
1566
  client_id: string;
@@ -1653,6 +1913,27 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
1653
1913
  denom: string;
1654
1914
  }[];
1655
1915
  connections: {
1916
+ 'agoric-3': {
1917
+ id: string;
1918
+ client_id: string;
1919
+ counterparty: {
1920
+ client_id: string;
1921
+ connection_id: string;
1922
+ prefix: {
1923
+ key_prefix: string;
1924
+ };
1925
+ };
1926
+ state: number;
1927
+ transferChannel: {
1928
+ channelId: string;
1929
+ portId: string;
1930
+ counterPartyChannelId: string;
1931
+ counterPartyPortId: string;
1932
+ ordering: number;
1933
+ state: number;
1934
+ version: string;
1935
+ };
1936
+ };
1656
1937
  celestia: {
1657
1938
  id: string;
1658
1939
  client_id: string;
@@ -1825,17 +2106,17 @@ export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefin
1825
2106
  };
1826
2107
  }[K], "connections"> : ChainInfo>;
1827
2108
  /**
1828
- * @param {string} srcChainId
1829
- * @param {string} destChainId
2109
+ * @param {string} chainId1
2110
+ * @param {string} chainId2
1830
2111
  * @param {IBCConnectionInfo} connectionInfo
1831
2112
  */
1832
- registerConnection(srcChainId: string, destChainId: string, connectionInfo: IBCConnectionInfo): void;
2113
+ registerConnection(chainId1: string, chainId2: string, connectionInfo: IBCConnectionInfo): void;
1833
2114
  /**
1834
- * @param {string} srcChainId
1835
- * @param {string} destChainId
2115
+ * @param {string} chainId1
2116
+ * @param {string} chainId2
1836
2117
  * @returns {Promise<IBCConnectionInfo>}
1837
2118
  */
1838
- getConnectionInfo(srcChainId: string, destChainId: string): Promise<IBCConnectionInfo>;
2119
+ getConnectionInfo(chainId1: string, chainId2: string): Promise<IBCConnectionInfo>;
1839
2120
  };
1840
2121
  export function registerChain(agoricNamesAdmin: ERef<import("@agoric/vats").NameHubKit["nameAdmin"]>, name: string, chainInfo: CosmosChainInfo, log?: (...messages: string[]) => void): Promise<void>;
1841
2122
  export type ChainHub = ReturnType<typeof makeChainHub>;
@@ -1 +1 @@
1
- {"version":3,"file":"chainHub.d.ts","sourceRoot":"","sources":["chainHub.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AAEH,wCAAwC;AACxC,gCAAiC;AACjC,kCAAkC;AAClC,gDAAiD;AAqB1C,wCAHI,MAAM,YACN,MAAM,UAUhB;AAMM;IAaH;;;;;;;;;;;OAWG;wBAFQ,MAAM;IAMjB;;;;;;;;OAQG;iBAHuB,CAAC,4BAAD,CAAC,AAHf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAjBZ;;;;;;;;;;;+BAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAsCH;;;;mBAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAc;4BAGf,kBAAkB;0BACpB,cAAc;qCAHgB,kBAAkB;+BAC9B,kBAAkB;uCADN,kBAAkB"}
@@ -104,22 +104,22 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => {
104
104
  return chainInfo;
105
105
  },
106
106
  /**
107
- * @param {string} srcChainId
108
- * @param {string} destChainId
107
+ * @param {string} chainId1
108
+ * @param {string} chainId2
109
109
  * @param {IBCConnectionInfo} connectionInfo
110
110
  */
111
- registerConnection(srcChainId, destChainId, connectionInfo) {
112
- const key = connectionKey(srcChainId, destChainId);
111
+ registerConnection(chainId1, chainId2, connectionInfo) {
112
+ const key = connectionKey(chainId1, chainId2);
113
113
  connectionInfos.init(key, connectionInfo);
114
114
  },
115
115
 
116
116
  /**
117
- * @param {string} srcChainId
118
- * @param {string} destChainId
117
+ * @param {string} chainId1
118
+ * @param {string} chainId2
119
119
  * @returns {Promise<IBCConnectionInfo>}
120
120
  */
121
- async getConnectionInfo(srcChainId, destChainId) {
122
- const key = connectionKey(srcChainId, destChainId);
121
+ async getConnectionInfo(chainId1, chainId2) {
122
+ const key = connectionKey(chainId1, chainId2);
123
123
  if (connectionInfos.has(key)) {
124
124
  return connectionInfos.get(key);
125
125
  }
@@ -127,9 +127,7 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => {
127
127
  const connectionInfo = await E(agoricNames)
128
128
  .lookup(CONNECTIONS_KEY, key)
129
129
  .catch(_cause => {
130
- throw assert.error(
131
- `connection not found: ${srcChainId}<->${destChainId}`,
132
- );
130
+ throw assert.error(`connection not found: ${chainId1}<->${chainId2}`);
133
131
  });
134
132
  connectionInfos.init(key, connectionInfo);
135
133
  return connectionInfo;
@@ -166,8 +164,8 @@ export const registerChain = async (
166
164
  ];
167
165
 
168
166
  // XXX updates redundantly, twice per edge
169
- for await (const [destChainId, connInfo] of Object.entries(connections)) {
170
- const key = connectionKey(chainInfo.chainId, destChainId);
167
+ for await (const [counterChainId, connInfo] of Object.entries(connections)) {
168
+ const key = connectionKey(chainInfo.chainId, counterChainId);
171
169
  promises.push(
172
170
  E(connAdmin)
173
171
  .update(key, connInfo)
@@ -6,7 +6,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
6
6
  allocateICQControllerPort(): Promise<import("@agoric/network").Port>;
7
7
  };
8
8
  public: {
9
- makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("./cosmos-api.js").IcaAccount>;
9
+ makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("./cosmos-api.js").IcaAccount>;
10
10
  provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
11
11
  getLocalAddress(): `/ibc-port/${string}`;
12
12
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
@@ -22,7 +22,7 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
22
22
  allocateICQControllerPort(): Promise<import("@agoric/network").Port>;
23
23
  };
24
24
  public: {
25
- makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("./cosmos-api.js").IcaAccount>;
25
+ makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("./cosmos-api.js").IcaAccount>;
26
26
  provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
27
27
  getLocalAddress(): `/ibc-port/${string}`;
28
28
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;