@agoric/orchestration 0.1.1-dev-71db129.0 → 0.1.1-dev-4687f0d.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 +19 -16
- package/src/chain-info.d.ts +1776 -150
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +50 -99
- package/src/cosmos-api.d.ts +9 -18
- package/src/cosmos-api.d.ts.map +1 -1
- package/src/cosmos-api.ts +20 -20
- package/src/examples/{stakeAtom.contract.d.ts → stakeIca.contract.d.ts} +3 -3
- package/src/examples/stakeIca.contract.d.ts.map +1 -0
- package/src/examples/{stakeAtom.contract.js → stakeIca.contract.js} +2 -3
- package/src/exos/local-chain-account-kit.d.ts +1781 -3
- package/src/exos/local-chain-account-kit.d.ts.map +1 -1
- package/src/exos/local-chain-account-kit.js +0 -1
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +15 -18
- package/src/fetched-chain-info.d.ts +3073 -0
- package/src/fetched-chain-info.d.ts.map +1 -0
- package/src/fetched-chain-info.js +1752 -0
- package/src/orchestration-api.d.ts +1 -3
- package/src/orchestration-api.d.ts.map +1 -1
- package/src/orchestration-api.ts +1 -3
- package/src/proposals/orchestration-proposal.d.ts +39 -37
- package/src/proposals/orchestration-proposal.d.ts.map +1 -1
- package/src/proposals/orchestration-proposal.js +74 -1
- package/src/proposals/start-stakeAtom.d.ts +5 -7
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeAtom.js +39 -33
- package/src/proposals/start-stakeBld.d.ts +1 -2
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.js +1 -7
- package/src/service.d.ts +7 -6
- package/src/service.d.ts.map +1 -1
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +2 -9
- package/src/utils/chainHub.d.ts +1792 -4
- package/src/utils/chainHub.d.ts.map +1 -1
- package/src/utils/chainHub.js +21 -8
- package/src/vat-orchestration.d.ts +4 -4
- package/src/examples/stakeAtom.contract.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainHub.d.ts","sourceRoot":"","sources":["chainHub.js"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"chainHub.d.ts","sourceRoot":"","sources":["chainHub.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH,wCAAwC;AACxC,gCAAiC;AACjC,kCAAkC;AAClC,gDAAiD;AAU1C,wCAHI,MAAM,YACN,MAAM,UAG4B;AAMtC;IAaH;;;;;;;;;;;OAWG;wBAFQ,MAAM;IAMjB;;;;;;;;OAQG;iBAHuB,CAAC,4BAAD,CAAC,AAHf;;;;;;;;;;;;;;;;;;;;;;;;;gBA7Bd,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBArBlD,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkFpC;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAdH;;;;OAIG;mCAHQ,MAAM,eACN,MAAM;IAQjB;;;;OAIG;kCAHQ,MAAM,eACN,MAAM;EAsBpB;AASM,gDALI,IAAI,CAAC,OAAO,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,QACpD,MAAM,oCAEN,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,iBAsBzC;uBA5Ba,UAAU,CAAC,OAAO,YAAY,CAAC;6BAlHnB,cAAc;4BAGf,kBAAkB;0BACpB,cAAc;qCAHgB,kBAAkB;+BAC9B,kBAAkB;uCADN,kBAAkB"}
|
package/src/utils/chainHub.js
CHANGED
|
@@ -6,6 +6,7 @@ import { CosmosChainInfoShape, IBCConnectionInfoShape } from '../typeGuards.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* @import {NameHub} from '@agoric/vats';
|
|
8
8
|
* @import {CosmosChainInfo, IBCConnectionInfo} from '../cosmos-api.js';
|
|
9
|
+
* @import {ChainInfo, KnownChains} from '../chain-info.js';
|
|
9
10
|
* @import {Remote} from '@agoric/internal';
|
|
10
11
|
* @import {Zone} from '@agoric/zone';
|
|
11
12
|
*/
|
|
@@ -59,12 +60,18 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => {
|
|
|
59
60
|
chainInfos.init(name, chainInfo);
|
|
60
61
|
},
|
|
61
62
|
/**
|
|
62
|
-
* @
|
|
63
|
-
* @
|
|
63
|
+
* @template {string} K
|
|
64
|
+
* @param {K} chainName
|
|
65
|
+
* @returns {Promise<
|
|
66
|
+
* K extends keyof KnownChains
|
|
67
|
+
* ? Omit<KnownChains[K], 'connections'>
|
|
68
|
+
* : ChainInfo
|
|
69
|
+
* >}
|
|
64
70
|
*/
|
|
65
71
|
async getChainInfo(chainName) {
|
|
66
72
|
// Either from registerChain or memoized remote lookup()
|
|
67
73
|
if (chainInfos.has(chainName)) {
|
|
74
|
+
// @ts-expect-error cast
|
|
68
75
|
return chainInfos.get(chainName);
|
|
69
76
|
}
|
|
70
77
|
|
|
@@ -117,20 +124,26 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => {
|
|
|
117
124
|
* @param {ERef<import('@agoric/vats').NameHubKit['nameAdmin']>} agoricNamesAdmin
|
|
118
125
|
* @param {string} name
|
|
119
126
|
* @param {CosmosChainInfo} chainInfo
|
|
127
|
+
* @param {(...messages: string[]) => void} log
|
|
120
128
|
*/
|
|
121
|
-
export const registerChain = async (
|
|
129
|
+
export const registerChain = async (
|
|
130
|
+
agoricNamesAdmin,
|
|
131
|
+
name,
|
|
132
|
+
chainInfo,
|
|
133
|
+
log = () => {},
|
|
134
|
+
) => {
|
|
122
135
|
const { nameAdmin } = await E(agoricNamesAdmin).provideChild('chain');
|
|
123
136
|
const { nameAdmin: connAdmin } =
|
|
124
137
|
await E(agoricNamesAdmin).provideChild('chainConnection');
|
|
125
138
|
|
|
126
139
|
mustMatch(chainInfo, CosmosChainInfoShape);
|
|
127
|
-
|
|
128
|
-
|
|
140
|
+
const { connections = {}, ...vertex } = chainInfo;
|
|
141
|
+
log(`registering agoricNames chain.${name}`);
|
|
142
|
+
await E(nameAdmin).update(name, vertex);
|
|
129
143
|
|
|
130
|
-
for await (const [destChainId, connInfo] of Object.entries(
|
|
131
|
-
chainInfo.connections,
|
|
132
|
-
)) {
|
|
144
|
+
for await (const [destChainId, connInfo] of Object.entries(connections)) {
|
|
133
145
|
const key = connectionKey(chainInfo.chainId, destChainId);
|
|
146
|
+
log(`registering agoricNames chainConnection.${key}`);
|
|
134
147
|
await E(connAdmin).update(key, connInfo);
|
|
135
148
|
}
|
|
136
149
|
};
|
|
@@ -2,8 +2,8 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
2
2
|
/** @param {Partial<OrchestrationPowers>} [initialPowers] */
|
|
3
3
|
makeOrchestrationKit(initialPowers?: Partial<OrchestrationPowers> | undefined): import("@endo/exo").GuardedKit<{
|
|
4
4
|
self: {
|
|
5
|
-
allocateICAControllerPort(): Promise<
|
|
6
|
-
allocateICQControllerPort(): Promise<
|
|
5
|
+
allocateICAControllerPort(): Promise<import("@agoric/network").Port>;
|
|
6
|
+
allocateICQControllerPort(): Promise<import("@agoric/network").Port>;
|
|
7
7
|
};
|
|
8
8
|
public: {
|
|
9
9
|
makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("./cosmos-api.js").IcaAccount>;
|
|
@@ -18,8 +18,8 @@ export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
|
18
18
|
/** @param {Partial<OrchestrationPowers>} [initialPowers] */
|
|
19
19
|
makeOrchestrationKit(initialPowers?: Partial<OrchestrationPowers> | undefined): import("@endo/exo").GuardedKit<{
|
|
20
20
|
self: {
|
|
21
|
-
allocateICAControllerPort(): Promise<
|
|
22
|
-
allocateICQControllerPort(): Promise<
|
|
21
|
+
allocateICAControllerPort(): Promise<import("@agoric/network").Port>;
|
|
22
|
+
allocateICQControllerPort(): Promise<import("@agoric/network").Port>;
|
|
23
23
|
};
|
|
24
24
|
public: {
|
|
25
25
|
makeAccount(hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("./cosmos-api.js").IcaAccount>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stakeAtom.contract.d.ts","sourceRoot":"","sources":["stakeAtom.contract.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAqDO,2BATI,GAAG,CAAC,cAAc,CAAC;;;;;;;;;iBAGZ,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;mGA0EwoF,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAH/qF;;;;eAhFe,MAAM;;0BAkFR,OAAO,KAAK;iCAtHmB,kBAAkB;kCAC7B,cAAc;kCAYjB,cAAc;6BAFnB,kBAAkB"}
|