@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
@@ -1,5 +1,141 @@
1
1
  /** @file Generated by fetch-chain-info.ts */
2
2
  export default {
3
+ agoric: {
4
+ chainId: 'agoric-3',
5
+ stakingTokens: [
6
+ {
7
+ denom: 'ubld',
8
+ },
9
+ ],
10
+ connections: {
11
+ 'cosmoshub-4': {
12
+ id: 'connection-8',
13
+ client_id: '07-tendermint-6',
14
+ counterparty: {
15
+ client_id: '07-tendermint-927',
16
+ connection_id: 'connection-649',
17
+ prefix: {
18
+ key_prefix: 'FIXME',
19
+ },
20
+ },
21
+ state: 3,
22
+ transferChannel: {
23
+ channelId: 'channel-405',
24
+ portId: 'transfer',
25
+ counterPartyChannelId: 'channel-5',
26
+ counterPartyPortId: 'transfer',
27
+ ordering: 0,
28
+ state: 3,
29
+ version: 'ics20-1',
30
+ },
31
+ },
32
+ 'noble-1': {
33
+ id: 'connection-72',
34
+ client_id: '07-tendermint-77',
35
+ counterparty: {
36
+ client_id: '07-tendermint-32',
37
+ connection_id: 'connection-40',
38
+ prefix: {
39
+ key_prefix: 'FIXME',
40
+ },
41
+ },
42
+ state: 3,
43
+ transferChannel: {
44
+ channelId: 'channel-21',
45
+ portId: 'transfer',
46
+ counterPartyChannelId: 'channel-62',
47
+ counterPartyPortId: 'transfer',
48
+ ordering: 0,
49
+ state: 3,
50
+ version: 'ics20-1',
51
+ },
52
+ },
53
+ 'omniflixhub-1': {
54
+ id: 'connection-67',
55
+ client_id: '07-tendermint-73',
56
+ counterparty: {
57
+ client_id: '07-tendermint-47',
58
+ connection_id: 'connection-40',
59
+ prefix: {
60
+ key_prefix: 'FIXME',
61
+ },
62
+ },
63
+ state: 3,
64
+ transferChannel: {
65
+ channelId: 'channel-30',
66
+ portId: 'transfer',
67
+ counterPartyChannelId: 'channel-58',
68
+ counterPartyPortId: 'transfer',
69
+ ordering: 0,
70
+ state: 3,
71
+ version: 'ics20-1',
72
+ },
73
+ },
74
+ 'osmosis-1': {
75
+ id: 'connection-1',
76
+ client_id: '07-tendermint-1',
77
+ counterparty: {
78
+ client_id: '07-tendermint-2109',
79
+ connection_id: 'connection-1649',
80
+ prefix: {
81
+ key_prefix: 'FIXME',
82
+ },
83
+ },
84
+ state: 3,
85
+ transferChannel: {
86
+ channelId: 'channel-320',
87
+ portId: 'transfer',
88
+ counterPartyChannelId: 'channel-1',
89
+ counterPartyPortId: 'transfer',
90
+ ordering: 0,
91
+ state: 3,
92
+ version: 'ics20-1',
93
+ },
94
+ },
95
+ 'secret-4': {
96
+ id: 'connection-17',
97
+ client_id: '07-tendermint-17',
98
+ counterparty: {
99
+ client_id: '07-tendermint-111',
100
+ connection_id: 'connection-80',
101
+ prefix: {
102
+ key_prefix: 'FIXME',
103
+ },
104
+ },
105
+ state: 3,
106
+ transferChannel: {
107
+ channelId: 'channel-51',
108
+ portId: 'transfer',
109
+ counterPartyChannelId: 'channel-10',
110
+ counterPartyPortId: 'transfer',
111
+ ordering: 0,
112
+ state: 3,
113
+ version: 'ics20-1',
114
+ },
115
+ },
116
+ 'stride-1': {
117
+ id: 'connection-68',
118
+ client_id: '07-tendermint-74',
119
+ counterparty: {
120
+ client_id: '07-tendermint-129',
121
+ connection_id: 'connection-118',
122
+ prefix: {
123
+ key_prefix: 'FIXME',
124
+ },
125
+ },
126
+ state: 3,
127
+ transferChannel: {
128
+ channelId: 'channel-148',
129
+ portId: 'transfer',
130
+ counterPartyChannelId: 'channel-59',
131
+ counterPartyPortId: 'transfer',
132
+ ordering: 0,
133
+ state: 3,
134
+ version: 'ics20-1',
135
+ },
136
+ },
137
+ },
138
+ },
3
139
  celestia: {
4
140
  chainId: 'celestia',
5
141
  stakingTokens: [
@@ -123,6 +259,27 @@ export default {
123
259
  },
124
260
  ],
125
261
  connections: {
262
+ 'agoric-3': {
263
+ id: 'connection-649',
264
+ client_id: '07-tendermint-927',
265
+ counterparty: {
266
+ client_id: '07-tendermint-6',
267
+ connection_id: 'connection-8',
268
+ prefix: {
269
+ key_prefix: 'FIXME',
270
+ },
271
+ },
272
+ state: 3,
273
+ transferChannel: {
274
+ channelId: 'channel-5',
275
+ portId: 'transfer',
276
+ counterPartyChannelId: 'channel-405',
277
+ counterPartyPortId: 'transfer',
278
+ ordering: 0,
279
+ state: 3,
280
+ version: 'ics20-1',
281
+ },
282
+ },
126
283
  'juno-1': {
127
284
  id: 'connection-372',
128
285
  client_id: '07-tendermint-439',
@@ -751,6 +908,27 @@ export default {
751
908
  },
752
909
  ],
753
910
  connections: {
911
+ 'agoric-3': {
912
+ id: 'connection-40',
913
+ client_id: '07-tendermint-32',
914
+ counterparty: {
915
+ client_id: '07-tendermint-77',
916
+ connection_id: 'connection-72',
917
+ prefix: {
918
+ key_prefix: 'FIXME',
919
+ },
920
+ },
921
+ state: 3,
922
+ transferChannel: {
923
+ channelId: 'channel-62',
924
+ portId: 'transfer',
925
+ counterPartyChannelId: 'channel-21',
926
+ counterPartyPortId: 'transfer',
927
+ ordering: 0,
928
+ state: 3,
929
+ version: 'ics20-1',
930
+ },
931
+ },
754
932
  'cosmoshub-4': {
755
933
  id: 'connection-12',
756
934
  client_id: '07-tendermint-4',
@@ -929,6 +1107,27 @@ export default {
929
1107
  },
930
1108
  ],
931
1109
  connections: {
1110
+ 'agoric-3': {
1111
+ id: 'connection-40',
1112
+ client_id: '07-tendermint-47',
1113
+ counterparty: {
1114
+ client_id: '07-tendermint-73',
1115
+ connection_id: 'connection-67',
1116
+ prefix: {
1117
+ key_prefix: 'FIXME',
1118
+ },
1119
+ },
1120
+ state: 3,
1121
+ transferChannel: {
1122
+ channelId: 'channel-58',
1123
+ portId: 'transfer',
1124
+ counterPartyChannelId: 'channel-30',
1125
+ counterPartyPortId: 'transfer',
1126
+ ordering: 0,
1127
+ state: 3,
1128
+ version: 'ics20-1',
1129
+ },
1130
+ },
932
1131
  'cosmoshub-4': {
933
1132
  id: 'connection-19',
934
1133
  client_id: '07-tendermint-23',
@@ -1003,6 +1202,27 @@ export default {
1003
1202
  ],
1004
1203
  icqEnabled: true,
1005
1204
  connections: {
1205
+ 'agoric-3': {
1206
+ id: 'connection-1649',
1207
+ client_id: '07-tendermint-2109',
1208
+ counterparty: {
1209
+ client_id: '07-tendermint-1',
1210
+ connection_id: 'connection-1',
1211
+ prefix: {
1212
+ key_prefix: 'FIXME',
1213
+ },
1214
+ },
1215
+ state: 3,
1216
+ transferChannel: {
1217
+ channelId: 'channel-1',
1218
+ portId: 'transfer',
1219
+ counterPartyChannelId: 'channel-320',
1220
+ counterPartyPortId: 'transfer',
1221
+ ordering: 0,
1222
+ state: 3,
1223
+ version: 'ics20-1',
1224
+ },
1225
+ },
1006
1226
  celestia: {
1007
1227
  id: 'connection-2503',
1008
1228
  client_id: '07-tendermint-3012',
@@ -1223,6 +1443,27 @@ export default {
1223
1443
  },
1224
1444
  ],
1225
1445
  connections: {
1446
+ 'agoric-3': {
1447
+ id: 'connection-80',
1448
+ client_id: '07-tendermint-111',
1449
+ counterparty: {
1450
+ client_id: '07-tendermint-17',
1451
+ connection_id: 'connection-17',
1452
+ prefix: {
1453
+ key_prefix: 'FIXME',
1454
+ },
1455
+ },
1456
+ state: 3,
1457
+ transferChannel: {
1458
+ channelId: 'channel-10',
1459
+ portId: 'transfer',
1460
+ counterPartyChannelId: 'channel-51',
1461
+ counterPartyPortId: 'transfer',
1462
+ ordering: 0,
1463
+ state: 3,
1464
+ version: 'ics20-1',
1465
+ },
1466
+ },
1226
1467
  celestia: {
1227
1468
  id: 'connection-131',
1228
1469
  client_id: '07-tendermint-174',
@@ -1579,6 +1820,27 @@ export default {
1579
1820
  },
1580
1821
  ],
1581
1822
  connections: {
1823
+ 'agoric-3': {
1824
+ id: 'connection-118',
1825
+ client_id: '07-tendermint-129',
1826
+ counterparty: {
1827
+ client_id: '07-tendermint-74',
1828
+ connection_id: 'connection-68',
1829
+ prefix: {
1830
+ key_prefix: 'FIXME',
1831
+ },
1832
+ },
1833
+ state: 3,
1834
+ transferChannel: {
1835
+ channelId: 'channel-59',
1836
+ portId: 'transfer',
1837
+ counterPartyChannelId: 'channel-148',
1838
+ counterPartyPortId: 'transfer',
1839
+ ordering: 0,
1840
+ state: 3,
1841
+ version: 'ics20-1',
1842
+ },
1843
+ },
1582
1844
  celestia: {
1583
1845
  id: 'connection-125',
1584
1846
  client_id: '07-tendermint-137',
@@ -560,7 +560,7 @@ export function addOrchestrationToClient({ consume: { client, orchestration } }:
560
560
  } & {
561
561
  consume: {
562
562
  orchestration: import("@endo/exo").Guarded<{
563
- makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
563
+ makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
564
564
  provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
565
565
  getLocalAddress(): `/ibc-port/${string}`;
566
566
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
@@ -607,7 +607,7 @@ export type OrchestrationVats = {
607
607
  allocateICQControllerPort(): Promise<import("@agoric/network").Port>;
608
608
  };
609
609
  public: {
610
- makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
610
+ makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
611
611
  provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
612
612
  getLocalAddress(): `/ibc-port/${string}`;
613
613
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
@@ -622,7 +622,7 @@ export type OrchestrationVats = {
622
622
  allocateICQControllerPort(): Promise<import("@agoric/network").Port>;
623
623
  };
624
624
  public: {
625
- makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
625
+ makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
626
626
  provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
627
627
  getLocalAddress(): `/ibc-port/${string}`;
628
628
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
@@ -3,7 +3,7 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
3
3
  consume: {
4
4
  stakeIca: Installation<(zcf: ZCF<StakeIcaTerms>, privateArgs: {
5
5
  orchestration: import("@endo/exo").Guarded<{
6
- makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
6
+ makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
7
7
  provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
8
8
  getLocalAddress(): `/ibc-port/${string}`;
9
9
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
@@ -1 +1 @@
1
- {"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAuBO,yOAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,OAmCH,IAAI,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+GA2DojH,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA5FrmH,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBAyDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;mCAtG6C,+BAA+B"}
1
+ {"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAuBO,yOAVI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,QAAgB,EAAE,YAAY,OAoCZ,IAAI,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+GA4D89G,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA9FtgH,CAAC;SACH,CAAC;KACH,CAAC;CACH,iBA2DH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;mCAxG6C,+BAA+B"}
@@ -48,10 +48,11 @@ export const startStakeAtom = async ({
48
48
 
49
49
  const chainHub = makeChainHub(await agoricNames);
50
50
 
51
+ const agoric = await chainHub.getChainInfo('agoric');
51
52
  const cosmoshub = await chainHub.getChainInfo('cosmoshub');
52
53
  const connectionInfo = await chainHub.getConnectionInfo(
53
- 'agoriclocal',
54
- 'cosmoshub-4',
54
+ agoric.chainId,
55
+ cosmoshub.chainId,
55
56
  );
56
57
 
57
58
  /** @type {StartUpgradableOpts<StakeAtomSF>} */
@@ -60,6 +61,7 @@ export const startStakeAtom = async ({
60
61
  installation: stakeIca,
61
62
  issuerKeywordRecord: harden({ ATOM: atomIssuer }),
62
63
  terms: {
64
+ chainId: cosmoshub.chainId,
63
65
  hostConnectionId: /** @type {IBCConnectionID} */ (connectionInfo.id),
64
66
  controllerConnectionId: /** @type {IBCConnectionID} */ (
65
67
  connectionInfo.counterparty.connection_id
package/src/service.d.ts CHANGED
@@ -10,12 +10,13 @@ export function prepareOrchestrationTools(zone: Zone): {
10
10
  };
11
11
  public: {
12
12
  /**
13
+ * @param {string} chainId
13
14
  * @param {IBCConnectionID} hostConnectionId the counterparty
14
15
  * connection_id
15
16
  * @param {IBCConnectionID} controllerConnectionId self connection_id
16
17
  * @returns {Promise<IcaAccount>}
17
18
  */
18
- makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<IcaAccount>;
19
+ makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<IcaAccount>;
19
20
  /**
20
21
  * @param {IBCConnectionID} controllerConnectionId
21
22
  * @returns {Promise<ICQConnection>}
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["service.js"],"names":[],"mappings":"AAoDA;;;GAOG;AA2GI;;;;;;;YAxDC;;;;;eAKG;;YAkBH;;;eAGG;;;;;;;;EAwCV;;;;;;;;;;;;;;yBAhJY,QAAQ,CACpB,MAAU,mBAAmB,EAC7B,mBAAuB,CAAC,MAAM,mBAAmB,CAAC,CAC/C;;;;;;;;;;;;;iCA0BU;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,kBAAkB,CAAA;CAAE;iCAsH1D,UAAU,CAAC,OAAO,yBAAyB,CAAC;+BAC5C,UAAU,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;mCACtD,gBAAgB,CAAC,QAAQ,CAAC;0BAxKjB,mBAAmB;0BAEJ,iBAAiB;gCAEO,YAAY;4BAHjD,kBAAkB"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["service.js"],"names":[],"mappings":"AAoDA;;;GAOG;AAgHI;;;;;;;YA7DC;;;;;;eAMG;iCALQ,MAAM;YA2BjB;;;eAGG;;;;;;;;EAwCV;;;;;;;;;;;;;;yBArJY,QAAQ,CACpB,MAAU,mBAAmB,EAC7B,mBAAuB,CAAC,MAAM,mBAAmB,CAAC,CAC/C;;;;;;;;;;;;;iCA0BU;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,kBAAkB,CAAA;CAAE;iCA2H1D,UAAU,CAAC,OAAO,yBAAyB,CAAC;+BAC5C,UAAU,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;mCACtD,gBAAgB,CAAC,QAAQ,CAAC;0BA7KjB,mBAAmB;0BAEJ,iBAAiB;gCAEO,YAAY;4BAHjD,kBAAkB"}
package/src/service.js CHANGED
@@ -51,7 +51,7 @@ const getPower = (powers, name) => {
51
51
  };
52
52
 
53
53
  export const OrchestrationI = M.interface('Orchestration', {
54
- makeAccount: M.callWhen(M.string(), M.string()).returns(
54
+ makeAccount: M.callWhen(M.string(), M.string(), M.string()).returns(
55
55
  M.remotable('ChainAccount'),
56
56
  ),
57
57
  provideICQConnection: M.callWhen(M.string()).returns(
@@ -109,19 +109,24 @@ const prepareOrchestrationKit = (
109
109
  },
110
110
  public: {
111
111
  /**
112
+ * @param {string} chainId
112
113
  * @param {IBCConnectionID} hostConnectionId the counterparty
113
114
  * connection_id
114
115
  * @param {IBCConnectionID} controllerConnectionId self connection_id
115
116
  * @returns {Promise<IcaAccount>}
116
117
  */
117
- async makeAccount(hostConnectionId, controllerConnectionId) {
118
+ async makeAccount(chainId, hostConnectionId, controllerConnectionId) {
118
119
  const port = await this.facets.self.allocateICAControllerPort();
119
120
 
120
121
  const remoteConnAddr = makeICAChannelAddress(
121
122
  hostConnectionId,
122
123
  controllerConnectionId,
123
124
  );
124
- const chainAccountKit = makeChainAccountKit(port, remoteConnAddr);
125
+ const chainAccountKit = makeChainAccountKit(
126
+ chainId,
127
+ port,
128
+ remoteConnAddr,
129
+ );
125
130
 
126
131
  // await so we do not return a ChainAccount before it successfully instantiates
127
132
  await E(port).connect(