@agoric/orchestration 0.1.1-dev-52e0339.0 → 0.1.1-dev-788647d.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 +16 -16
- package/src/chain-info.d.ts +2 -2
- package/src/chain-info.d.ts.map +1 -1
- package/src/chain-info.js +2 -2
- package/src/examples/sendAnywhere.contract.d.ts.map +1 -1
- package/src/examples/sendAnywhere.contract.js +7 -2
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +5 -2
- package/src/exos/local-chain-facade.d.ts +7 -4
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +28 -18
- package/src/exos/orchestrator.d.ts +5 -4
- package/src/exos/orchestrator.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.d.ts +7 -4
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +31 -18
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +3 -2
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-788647d.0+788647d",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@agoric/assert": "0.6.1-dev-
|
|
37
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
38
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
39
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
40
|
-
"@agoric/internal": "0.3.3-dev-
|
|
41
|
-
"@agoric/network": "0.1.1-dev-
|
|
42
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
43
|
-
"@agoric/store": "0.9.3-dev-
|
|
44
|
-
"@agoric/time": "0.3.3-dev-
|
|
45
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
46
|
-
"@agoric/vats": "0.15.2-dev-
|
|
47
|
-
"@agoric/vow": "0.1.1-dev-
|
|
48
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
49
|
-
"@agoric/zone": "0.2.3-dev-
|
|
36
|
+
"@agoric/assert": "0.6.1-dev-788647d.0+788647d",
|
|
37
|
+
"@agoric/async-flow": "0.1.1-dev-788647d.0+788647d",
|
|
38
|
+
"@agoric/cosmic-proto": "0.4.1-dev-788647d.0+788647d",
|
|
39
|
+
"@agoric/ertp": "0.16.3-dev-788647d.0+788647d",
|
|
40
|
+
"@agoric/internal": "0.3.3-dev-788647d.0+788647d",
|
|
41
|
+
"@agoric/network": "0.1.1-dev-788647d.0+788647d",
|
|
42
|
+
"@agoric/notifier": "0.6.3-dev-788647d.0+788647d",
|
|
43
|
+
"@agoric/store": "0.9.3-dev-788647d.0+788647d",
|
|
44
|
+
"@agoric/time": "0.3.3-dev-788647d.0+788647d",
|
|
45
|
+
"@agoric/vat-data": "0.5.3-dev-788647d.0+788647d",
|
|
46
|
+
"@agoric/vats": "0.15.2-dev-788647d.0+788647d",
|
|
47
|
+
"@agoric/vow": "0.1.1-dev-788647d.0+788647d",
|
|
48
|
+
"@agoric/zoe": "0.26.3-dev-788647d.0+788647d",
|
|
49
|
+
"@agoric/zone": "0.2.3-dev-788647d.0+788647d",
|
|
50
50
|
"@endo/base64": "^1.0.5",
|
|
51
51
|
"@endo/far": "^1.1.2",
|
|
52
52
|
"@endo/marshal": "^1.5.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"typeCoverage": {
|
|
91
91
|
"atLeast": 97.1
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "788647d162386a8ab80ce1928645dc3712d7c0f6"
|
|
94
94
|
}
|
package/src/chain-info.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export function registerChain(agoricNamesAdmin: ERef<import("@agoric/vats").NameHubKit["nameAdmin"]>, name: string, chainInfo: CosmosChainInfo, log?: (...messages: string[]) => void): Promise<void>;
|
|
2
|
-
export function registerChainNamespace(agoricNamesAdmin: ERef<import("@agoric/vats").NameHubKit["nameAdmin"]>, log
|
|
1
|
+
export function registerChain(agoricNamesAdmin: ERef<import("@agoric/vats").NameHubKit["nameAdmin"]>, name: string, chainInfo: CosmosChainInfo, log?: ((...messages: string[]) => void) | undefined): Promise<void>;
|
|
2
|
+
export function registerChainNamespace(agoricNamesAdmin: ERef<import("@agoric/vats").NameHubKit["nameAdmin"]>, log?: ((...messages: string[]) => void) | undefined): Promise<void>;
|
|
3
3
|
export type ChainInfo = CosmosChainInfo | EthChainInfo;
|
|
4
4
|
export type KnownChains = typeof knownChains;
|
|
5
5
|
import type { CosmosChainInfo } from './types.js';
|
package/src/chain-info.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-info.d.ts","sourceRoot":"","sources":["chain-info.js"],"names":[],"mappings":"AAyEO,gDALI,IAAI,CAAC,OAAO,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,QACpD,MAAM,aACN,eAAe,
|
|
1
|
+
{"version":3,"file":"chain-info.d.ts","sourceRoot":"","sources":["chain-info.js"],"names":[],"mappings":"AAyEO,gDALI,IAAI,CAAC,OAAO,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,QACpD,MAAM,aACN,eAAe,uBACD,MAAM,EAAE,KAAK,IAAI,8BAgCzC;AAMM,yDAHI,IAAI,CAAC,OAAO,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,uBACtC,MAAM,EAAE,KAAK,IAAI,8BAMzC;wBAzGa,eAAe,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDE"}
|
package/src/chain-info.js
CHANGED
|
@@ -69,7 +69,7 @@ const knownChains = /** @satisfies {Record<string, ChainInfo>} */ (
|
|
|
69
69
|
* @param {ERef<import('@agoric/vats').NameHubKit['nameAdmin']>} agoricNamesAdmin
|
|
70
70
|
* @param {string} name
|
|
71
71
|
* @param {CosmosChainInfo} chainInfo
|
|
72
|
-
* @param {(...messages: string[]) => void} log
|
|
72
|
+
* @param {(...messages: string[]) => void} [log]
|
|
73
73
|
*/
|
|
74
74
|
export const registerChain = async (
|
|
75
75
|
agoricNamesAdmin,
|
|
@@ -105,7 +105,7 @@ export const registerChain = async (
|
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* @param {ERef<import('@agoric/vats').NameHubKit['nameAdmin']>} agoricNamesAdmin
|
|
108
|
-
* @param {(...messages: string[]) => void} log
|
|
108
|
+
* @param {(...messages: string[]) => void} [log]
|
|
109
109
|
*/
|
|
110
110
|
export const registerChainNamespace = async (agoricNamesAdmin, log) => {
|
|
111
111
|
for await (const [name, info] of Object.entries(knownChains)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;;;
|
|
1
|
+
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;;;QA2FZ;;;WAGG;4BAFQ,eAAe,kBACf,iBAAiB;;GAmBjC;kCArIY;IACZ,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,oBAAwB,EAAE,OAAO,oBAAoB,CAAC,CAAC;IACvD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;6BAhBsB,kBAAkB;qCACS,eAAe;uCAAf,eAAe;gCAEvC,gCAAgC;4BAGpC,aAAa;0CAFC,eAAe;kCAFX,cAAc;6BAG/B,cAAc"}
|
|
@@ -83,11 +83,16 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
83
83
|
// FIXME ok to use a heap var crossing the membrane scope this way?
|
|
84
84
|
if (!contractAccount) {
|
|
85
85
|
const agoricChain = await orch.getChain('agoric');
|
|
86
|
-
|
|
86
|
+
// XXX when() until membrane
|
|
87
|
+
contractAccount = await V.when(agoricChain.makeAccount());
|
|
88
|
+
console.log('contractAccount', contractAccount);
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
// XXX when() until membrane
|
|
92
|
+
const info = await V.when(chain.getChainInfo());
|
|
93
|
+
console.log('info', info);
|
|
90
94
|
const { chainId } = info;
|
|
95
|
+
assert(typeof chainId === 'string', 'bad chainId');
|
|
91
96
|
const { [kw]: pmtP } = await withdrawFromSeat(zcf, seat, give);
|
|
92
97
|
await E.when(pmtP, pmt => contractAccount.deposit(pmt));
|
|
93
98
|
await contractAccount.transfer(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAWnC;AASK,0CAHI,KAAK;;;EAIsC;AAc/C,2BAXI,GAAG,eACH;IACV,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;IACjC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,oBAAwB,EAAE,OAAO,oBAAoB,CAAC,CAAC;IACvD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,UAAc,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;oBA+BD,MAAM,CAAC,KAAK,CAAC;uBAAa,sBAAsB;;;;oBAAhD,MAAM,CAAC,KAAK,CAAC;uBAAa,sBAAsB;;;GAsEhE;6BAzIyB,cAAc;4BAHf,kBAAkB;gCADd,gCAAgC;0CAEtB,eAAe;kCAHvB,cAAc;6BAInB,kBAAkB;4CALuB,aAAa"}
|
|
@@ -4,6 +4,7 @@ import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js'
|
|
|
4
4
|
import { Far } from '@endo/far';
|
|
5
5
|
import { deeplyFulfilled } from '@endo/marshal';
|
|
6
6
|
import { M, objectMap } from '@endo/patterns';
|
|
7
|
+
import { when } from '@agoric/vow/vat.js';
|
|
7
8
|
import { orcUtils } from '../utils/orc.js';
|
|
8
9
|
import { provideOrchestration } from '../utils/start-helper.js';
|
|
9
10
|
|
|
@@ -95,8 +96,10 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
95
96
|
const agoric = await orch.getChain('agoric');
|
|
96
97
|
|
|
97
98
|
const [omniAccount, localAccount] = await Promise.all([
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
// XXX when() until membrane
|
|
100
|
+
when(omni.makeAccount()),
|
|
101
|
+
// XXX when() until membrane
|
|
102
|
+
when(agoric.makeAccount()),
|
|
100
103
|
]);
|
|
101
104
|
|
|
102
105
|
const omniAddress = omniAccount.getAddress();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export function prepareLocalChainFacade(zone: Zone, { makeLocalOrchestrationAccountKit, localchain, storageNode }: {
|
|
1
|
+
export function prepareLocalChainFacade(zone: Zone, { makeLocalOrchestrationAccountKit, localchain, storageNode, vowTools: { allVows }, }: {
|
|
2
2
|
makeLocalOrchestrationAccountKit: MakeLocalOrchestrationAccountKit;
|
|
3
3
|
orchestration: Remote<OrchestrationService>;
|
|
4
4
|
storageNode: Remote<StorageNode>;
|
|
5
5
|
timer: Remote<TimerService>;
|
|
6
6
|
localchain: Remote<LocalChain>;
|
|
7
|
+
vowTools: VowTools;
|
|
7
8
|
}): (localChainInfo: Readonly<{
|
|
8
9
|
chainId: string;
|
|
9
10
|
connections?: Record<string, IBCConnectionInfo>;
|
|
@@ -12,7 +13,7 @@ export function prepareLocalChainFacade(zone: Zone, { makeLocalOrchestrationAcco
|
|
|
12
13
|
denom: string;
|
|
13
14
|
}>>;
|
|
14
15
|
}>) => import("@endo/exo").Guarded<{
|
|
15
|
-
getChainInfo():
|
|
16
|
+
getChainInfo(): Vow<Readonly<{
|
|
16
17
|
chainId: string;
|
|
17
18
|
connections?: Record<string, IBCConnectionInfo>;
|
|
18
19
|
icqEnabled?: boolean;
|
|
@@ -20,8 +21,8 @@ export function prepareLocalChainFacade(zone: Zone, { makeLocalOrchestrationAcco
|
|
|
20
21
|
denom: string;
|
|
21
22
|
}>>;
|
|
22
23
|
}>>;
|
|
23
|
-
/** @returns {
|
|
24
|
-
makeAccount():
|
|
24
|
+
/** @returns {Vow<OrchestrationAccount<ChainInfo>>} */
|
|
25
|
+
makeAccount(): Vow<OrchestrationAccount<ChainInfo>>;
|
|
25
26
|
}>;
|
|
26
27
|
export type MakeLocalChainFacade = ReturnType<typeof prepareLocalChainFacade>;
|
|
27
28
|
import type { Zone } from '@agoric/base-zone';
|
|
@@ -30,7 +31,9 @@ import type { OrchestrationService } from '../service.js';
|
|
|
30
31
|
import type { Remote } from '@agoric/internal';
|
|
31
32
|
import type { TimerService } from '@agoric/time';
|
|
32
33
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
34
|
+
import type { VowTools } from '@agoric/vow';
|
|
33
35
|
import type { IBCConnectionInfo } from '../types.js';
|
|
36
|
+
import type { Vow } from '@agoric/vow';
|
|
34
37
|
import type { ChainInfo } from '../types.js';
|
|
35
38
|
import type { OrchestrationAccount } from '../types.js';
|
|
36
39
|
//# sourceMappingURL=local-chain-facade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AA2BO,8CAVI,IAAI,yFACJ;IACV,gCAAoC,EAAE,gCAAgC,CAAC;IACvE,aAAiB,EAAE,OAAO,oBAAoB,CAAC,CAAC;IAChD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,QAAY,EAAE,QAAQ,CAAC;CACpB;;;;;;;;;;;;;;;;IA2BE,sDAAsD;mBAAxC,IAAI,qBAAqB,SAAS,CAAC,CAAC;GAsBrD;mCAEW,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BAtEjC,mBAAmB;sDAMS,kCAAkC;0CAD9C,eAAe;4BAH7B,kBAAkB;kCADZ,cAAc;gCAEhB,gCAAgC;8BAC7B,aAAa;uCAGyC,aAAa;yBAHnE,aAAa;+BAGyC,aAAa;0CAAb,aAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @file ChainAccount exo */
|
|
2
|
-
import { V } from '@agoric/vow/vat.js';
|
|
2
|
+
import { V, watch } from '@agoric/vow/vat.js';
|
|
3
3
|
|
|
4
4
|
import { ChainFacadeI } from '../typeGuards.js';
|
|
5
5
|
|
|
@@ -8,6 +8,7 @@ import { ChainFacadeI } from '../typeGuards.js';
|
|
|
8
8
|
* @import {TimerService} from '@agoric/time';
|
|
9
9
|
* @import {Remote} from '@agoric/internal';
|
|
10
10
|
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
11
|
+
* @import {Vow, VowTools} from '@agoric/vow';
|
|
11
12
|
* @import {OrchestrationService} from '../service.js';
|
|
12
13
|
* @import {MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
|
|
13
14
|
* @import {ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
|
|
@@ -21,11 +22,17 @@ import { ChainFacadeI } from '../typeGuards.js';
|
|
|
21
22
|
* storageNode: Remote<StorageNode>;
|
|
22
23
|
* timer: Remote<TimerService>;
|
|
23
24
|
* localchain: Remote<LocalChain>;
|
|
25
|
+
* vowTools: VowTools;
|
|
24
26
|
* }} powers
|
|
25
27
|
*/
|
|
26
28
|
export const prepareLocalChainFacade = (
|
|
27
29
|
zone,
|
|
28
|
-
{
|
|
30
|
+
{
|
|
31
|
+
makeLocalOrchestrationAccountKit,
|
|
32
|
+
localchain,
|
|
33
|
+
storageNode,
|
|
34
|
+
vowTools: { allVows },
|
|
35
|
+
},
|
|
29
36
|
) =>
|
|
30
37
|
zone.exoClass(
|
|
31
38
|
'LocalChainFacade',
|
|
@@ -37,29 +44,32 @@ export const prepareLocalChainFacade = (
|
|
|
37
44
|
return { localChainInfo };
|
|
38
45
|
},
|
|
39
46
|
{
|
|
40
|
-
|
|
41
|
-
return this.state.localChainInfo;
|
|
47
|
+
getChainInfo() {
|
|
48
|
+
return watch(this.state.localChainInfo);
|
|
42
49
|
},
|
|
43
50
|
|
|
44
51
|
// FIXME parameterize on the remoteChainInfo to make()
|
|
45
52
|
// That used to work but got lost in the migration to Exo
|
|
46
|
-
/** @returns {
|
|
47
|
-
|
|
53
|
+
/** @returns {Vow<OrchestrationAccount<ChainInfo>>} */
|
|
54
|
+
makeAccount() {
|
|
48
55
|
const { localChainInfo } = this.state;
|
|
49
56
|
const lcaP = V(localchain).makeAccount();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
// FIXME use watch() from vowTools
|
|
58
|
+
return watch(allVows([lcaP, V(lcaP).getAddress()]), {
|
|
59
|
+
onFulfilled: ([lca, address]) => {
|
|
60
|
+
const { holder: account } = makeLocalOrchestrationAccountKit({
|
|
61
|
+
account: lca,
|
|
62
|
+
address: harden({
|
|
63
|
+
address,
|
|
64
|
+
addressEncoding: 'bech32',
|
|
65
|
+
chainId: localChainInfo.chainId,
|
|
66
|
+
}),
|
|
67
|
+
// FIXME storage path https://github.com/Agoric/agoric-sdk/issues/9066
|
|
68
|
+
storageNode,
|
|
69
|
+
});
|
|
70
|
+
return account;
|
|
71
|
+
},
|
|
60
72
|
});
|
|
61
|
-
|
|
62
|
-
return account;
|
|
63
73
|
},
|
|
64
74
|
},
|
|
65
75
|
);
|
|
@@ -22,7 +22,7 @@ export function prepareOrchestratorKit(zone: Zone, { chainHub, localchain, makeL
|
|
|
22
22
|
makeLocalChainFacadeWatcher: {
|
|
23
23
|
/** @param {ChainInfo} agoricChainInfo */
|
|
24
24
|
onFulfilled(agoricChainInfo: ChainInfo): import("@endo/exo").Guarded<{
|
|
25
|
-
getChainInfo():
|
|
25
|
+
getChainInfo(): Vow<Readonly<{
|
|
26
26
|
chainId: string;
|
|
27
27
|
connections?: Record<string, IBCConnectionInfo>;
|
|
28
28
|
icqEnabled?: boolean;
|
|
@@ -30,7 +30,7 @@ export function prepareOrchestratorKit(zone: Zone, { chainHub, localchain, makeL
|
|
|
30
30
|
denom: string;
|
|
31
31
|
}>>;
|
|
32
32
|
}>>;
|
|
33
|
-
makeAccount():
|
|
33
|
+
makeAccount(): Vow<OrchestrationAccount<ChainInfo>>;
|
|
34
34
|
}>;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
@@ -45,7 +45,7 @@ export function prepareOrchestratorKit(zone: Zone, { chainHub, localchain, makeL
|
|
|
45
45
|
* @param {[ChainInfo, ChainInfo, IBCConnectionInfo]} chainsAndConnection
|
|
46
46
|
*/
|
|
47
47
|
onFulfilled([_agoricChainInfo, remoteChainInfo, connectionInfo]: [ChainInfo, ChainInfo, IBCConnectionInfo]): import("@endo/exo").Guarded<{
|
|
48
|
-
getChainInfo():
|
|
48
|
+
getChainInfo(): Vow<Readonly<{
|
|
49
49
|
chainId: string;
|
|
50
50
|
connections?: Record<string, IBCConnectionInfo>;
|
|
51
51
|
icqEnabled?: boolean;
|
|
@@ -53,7 +53,7 @@ export function prepareOrchestratorKit(zone: Zone, { chainHub, localchain, makeL
|
|
|
53
53
|
denom: string;
|
|
54
54
|
}>>;
|
|
55
55
|
}>>;
|
|
56
|
-
makeAccount():
|
|
56
|
+
makeAccount(): Vow<OrchestrationAccount<ChainInfo>>;
|
|
57
57
|
}>;
|
|
58
58
|
};
|
|
59
59
|
orchestrator: {
|
|
@@ -84,6 +84,7 @@ import type { TimerService } from '@agoric/time';
|
|
|
84
84
|
import type { VowTools } from '@agoric/vow';
|
|
85
85
|
import type { ChainInfo } from '../types.js';
|
|
86
86
|
import type { IBCConnectionInfo } from '../types.js';
|
|
87
|
+
import type { Vow } from '@agoric/vow';
|
|
87
88
|
import type { OrchestrationAccount } from '../types.js';
|
|
88
89
|
import type { Chain } from '../types.js';
|
|
89
90
|
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"AAiCA,0BAA0B;AAC1B;;;;;GAKG;AAkBI,6CAfI,IAAI,qGACJ;IACV,cAAkB,EAAE,cAAc,CAAC;IACnC,QAAY,EAAE,QAAQ,CAAC;IACvB,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,eAAmB,EAAE,eAAe,CAAC;IACrC,oBAAwB,EAAE,oBAAoB,CAAC;IAC/C,qBAAyB,EAAE,qBAAqB,CAAC;IACjD,oBAAwB,EAAE,OAAO,oBAAoB,CAAC,CAAC;IACvD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,QAAY,EAAE,QAAQ,CAAC;IACvB,GAAO,EAAE,GAAG,CAAC;CACV;IAmCE,2DAA2D;;QAEzD,yCAAyC;;;;;;;;;;;;;IAK3C;;;OAGG;;QAED;;;;;WAKG;;;;;;;;;;;;;;QAMH,uCAAuC;;;;;;;;;;;;;GA0B5C;0BA7HoB,mBAAmB;oCAET,oBAAoB;8BAD1B,gBAAgB;gCAId,gCAAgC;4BAEpC,kBAAkB;qCADI,6CAA6C;0CAKrD,yBAAyB;2CACxB,0BAA0B;0CAH3B,eAAe;kCALvB,cAAc;8BADb,aAAa;+BAU8D,aAAa;uCAAb,aAAa;
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"AAiCA,0BAA0B;AAC1B;;;;;GAKG;AAkBI,6CAfI,IAAI,qGACJ;IACV,cAAkB,EAAE,cAAc,CAAC;IACnC,QAAY,EAAE,QAAQ,CAAC;IACvB,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,eAAmB,EAAE,eAAe,CAAC;IACrC,oBAAwB,EAAE,oBAAoB,CAAC;IAC/C,qBAAyB,EAAE,qBAAqB,CAAC;IACjD,oBAAwB,EAAE,OAAO,oBAAoB,CAAC,CAAC;IACvD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,QAAY,EAAE,QAAQ,CAAC;IACvB,GAAO,EAAE,GAAG,CAAC;CACV;IAmCE,2DAA2D;;QAEzD,yCAAyC;;;;;;;;;;;;;IAK3C;;;OAGG;;QAED;;;;;WAKG;;;;;;;;;;;;;;QAMH,uCAAuC;;;;;;;;;;;;;GA0B5C;0BA7HoB,mBAAmB;oCAET,oBAAoB;8BAD1B,gBAAgB;gCAId,gCAAgC;4BAEpC,kBAAkB;qCADI,6CAA6C;0CAKrD,yBAAyB;2CACxB,0BAA0B;0CAH3B,eAAe;kCALvB,cAAc;8BADb,aAAa;+BAU8D,aAAa;uCAAb,aAAa;yBAVxF,aAAa;0CAU8D,aAAa;2BAAb,aAAa"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export function prepareRemoteChainFacade(zone: Zone, { makeCosmosOrchestrationAccount, orchestration, storageNode, timer }: {
|
|
1
|
+
export function prepareRemoteChainFacade(zone: Zone, { makeCosmosOrchestrationAccount, orchestration, storageNode, timer, vowTools: { allVows }, }: {
|
|
2
2
|
makeCosmosOrchestrationAccount: ReturnType<typeof prepareCosmosOrchestrationAccount>;
|
|
3
3
|
orchestration: Remote<OrchestrationService>;
|
|
4
4
|
storageNode: Remote<StorageNode>;
|
|
5
5
|
timer: Remote<TimerService>;
|
|
6
|
+
vowTools: VowTools;
|
|
6
7
|
}): (remoteChainInfo: Readonly<{
|
|
7
8
|
chainId: string;
|
|
8
9
|
connections?: Record<string, IBCConnectionInfo>;
|
|
@@ -11,7 +12,7 @@ export function prepareRemoteChainFacade(zone: Zone, { makeCosmosOrchestrationAc
|
|
|
11
12
|
denom: string;
|
|
12
13
|
}>>;
|
|
13
14
|
}>, connectionInfo: IBCConnectionInfo) => import("@endo/exo").Guarded<{
|
|
14
|
-
getChainInfo():
|
|
15
|
+
getChainInfo(): Vow<Readonly<{
|
|
15
16
|
chainId: string;
|
|
16
17
|
connections?: Record<string, IBCConnectionInfo>;
|
|
17
18
|
icqEnabled?: boolean;
|
|
@@ -19,8 +20,8 @@ export function prepareRemoteChainFacade(zone: Zone, { makeCosmosOrchestrationAc
|
|
|
19
20
|
denom: string;
|
|
20
21
|
}>>;
|
|
21
22
|
}>>;
|
|
22
|
-
/** @returns {
|
|
23
|
-
makeAccount():
|
|
23
|
+
/** @returns {Vow<OrchestrationAccount<ChainInfo>>} */
|
|
24
|
+
makeAccount(): Vow<OrchestrationAccount<ChainInfo>>;
|
|
24
25
|
}>;
|
|
25
26
|
export type MakeRemoteChainFacade = ReturnType<typeof prepareRemoteChainFacade>;
|
|
26
27
|
import type { Zone } from '@agoric/base-zone';
|
|
@@ -28,7 +29,9 @@ import type { prepareCosmosOrchestrationAccount } from './cosmos-orchestration-a
|
|
|
28
29
|
import type { OrchestrationService } from '../service.js';
|
|
29
30
|
import type { Remote } from '@agoric/internal';
|
|
30
31
|
import type { TimerService } from '@agoric/time';
|
|
32
|
+
import type { VowTools } from '@agoric/vow';
|
|
31
33
|
import type { IBCConnectionInfo } from '../types.js';
|
|
34
|
+
import type { Vow } from '@agoric/vow';
|
|
32
35
|
import type { ChainInfo } from '../types.js';
|
|
33
36
|
import type { OrchestrationAccount } from '../types.js';
|
|
34
37
|
//# sourceMappingURL=remote-chain-facade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-chain-facade.d.ts","sourceRoot":"","sources":["remote-chain-facade.js"],"names":[],"mappings":"AAkCO,+CAXI,IAAI,iGACJ;IACV,8BAAkC,EAAE,UAAU,CAC9C,wCAA8C,CACzC,CAAC;IACN,aAAiB,EAAE,OAAO,oBAAoB,CAAC,CAAC;IAChD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,KAAS,EAAE,OAAO,YAAY,CAAC,CAAC;IAChC,QAAY,EAAE,QAAQ,CAAC;CACpB;;;;;;;;;;;;;;;;IA8BE,sDAAsD;mBAAxC,IAAI,qBAAqB,SAAS,CAAC,CAAC;GA6BrD;oCAEW,UAAU,CAAC,OAAO,wBAAwB,CAAC;0BAtFlC,mBAAmB;uDAKU,mCAAmC;0CADhD,eAAe;4BAF7B,kBAAkB;kCADZ,cAAc;8BAEb,aAAa;uCAGyC,aAAa;yBAHnE,aAAa;+BAGyC,aAAa;0CAAb,aAAa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @file ChainAccount exo */
|
|
2
2
|
import { makeTracer } from '@agoric/internal';
|
|
3
|
-
import { V } from '@agoric/vow/vat.js';
|
|
3
|
+
import { V, watch } from '@agoric/vow/vat.js';
|
|
4
4
|
|
|
5
5
|
import { ChainFacadeI } from '../typeGuards.js';
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ import { ChainFacadeI } from '../typeGuards.js';
|
|
|
8
8
|
* @import {Zone} from '@agoric/base-zone';
|
|
9
9
|
* @import {TimerService} from '@agoric/time';
|
|
10
10
|
* @import {Remote} from '@agoric/internal';
|
|
11
|
+
* @import {Vow, VowTools} from '@agoric/vow';
|
|
11
12
|
* @import {OrchestrationService} from '../service.js';
|
|
12
13
|
* @import {prepareCosmosOrchestrationAccount} from './cosmos-orchestration-account.js';
|
|
13
14
|
* @import {ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
|
|
@@ -28,11 +29,18 @@ const anyVal = null;
|
|
|
28
29
|
* orchestration: Remote<OrchestrationService>;
|
|
29
30
|
* storageNode: Remote<StorageNode>;
|
|
30
31
|
* timer: Remote<TimerService>;
|
|
32
|
+
* vowTools: VowTools;
|
|
31
33
|
* }} powers
|
|
32
34
|
*/
|
|
33
35
|
export const prepareRemoteChainFacade = (
|
|
34
36
|
zone,
|
|
35
|
-
{
|
|
37
|
+
{
|
|
38
|
+
makeCosmosOrchestrationAccount,
|
|
39
|
+
orchestration,
|
|
40
|
+
storageNode,
|
|
41
|
+
timer,
|
|
42
|
+
vowTools: { allVows },
|
|
43
|
+
},
|
|
36
44
|
) =>
|
|
37
45
|
zone.exoClass(
|
|
38
46
|
'RemoteChainFacade',
|
|
@@ -46,33 +54,38 @@ export const prepareRemoteChainFacade = (
|
|
|
46
54
|
return { remoteChainInfo, connectionInfo };
|
|
47
55
|
},
|
|
48
56
|
{
|
|
49
|
-
|
|
50
|
-
return this.state.remoteChainInfo;
|
|
57
|
+
getChainInfo() {
|
|
58
|
+
return watch(this.state.remoteChainInfo);
|
|
51
59
|
},
|
|
52
60
|
|
|
53
61
|
// FIXME parameterize on the remoteChainInfo to make()
|
|
54
62
|
// That used to work but got lost in the migration to Exo
|
|
55
|
-
/** @returns {
|
|
56
|
-
|
|
63
|
+
/** @returns {Vow<OrchestrationAccount<ChainInfo>>} */
|
|
64
|
+
makeAccount() {
|
|
57
65
|
const { remoteChainInfo, connectionInfo } = this.state;
|
|
66
|
+
const stakingDenom = remoteChainInfo.stakingTokens?.[0]?.denom;
|
|
67
|
+
if (!stakingDenom) {
|
|
68
|
+
// FIXME methods that return vows must not throw synchronously
|
|
69
|
+
throw Fail`chain info lacks staking denom`;
|
|
70
|
+
}
|
|
58
71
|
|
|
59
|
-
const
|
|
72
|
+
const icaP = V(orchestration).makeAccount(
|
|
60
73
|
remoteChainInfo.chainId,
|
|
61
74
|
connectionInfo.id,
|
|
62
75
|
connectionInfo.counterparty.connection_id,
|
|
63
76
|
);
|
|
64
77
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
// FIXME use watch() from vowTools
|
|
79
|
+
return watch(allVows([icaP, V(icaP).getAddress()]), {
|
|
80
|
+
onFulfilled: ([account, address]) => {
|
|
81
|
+
return makeCosmosOrchestrationAccount(address, stakingDenom, {
|
|
82
|
+
account,
|
|
83
|
+
storageNode,
|
|
84
|
+
// FIXME provide real ICQ connection
|
|
85
|
+
icqConnection: anyVal,
|
|
86
|
+
timer,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
76
89
|
});
|
|
77
90
|
},
|
|
78
91
|
},
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;AAiBH,8DAAkE;;;;;AAOlE,uEAUE;AAEF,iEAA4C;AAC5C,mEAQG;AACH,oEAA+C;AAC/C,sEAYG;AAEH,oEAUE;AAGF,8DAAsC;AACtC,sEAAuE;AACvE,0DAAqC;AAErC,8DAAsC;;;;;;AAItC,mBAAmB;AACnB;;;GAGG"}
|
package/src/typeGuards.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AmountShape } from '@agoric/ertp';
|
|
2
|
+
import { VowShape } from '@agoric/vow';
|
|
2
3
|
import { M } from '@endo/patterns';
|
|
3
4
|
|
|
4
5
|
export const ConnectionHandlerI = M.interface('ConnectionHandler', {
|
|
@@ -89,6 +90,6 @@ export const DenomAmountShape = { denom: DenomShape, value: M.bigint() };
|
|
|
89
90
|
|
|
90
91
|
/** @see {Chain} */
|
|
91
92
|
export const ChainFacadeI = M.interface('ChainFacade', {
|
|
92
|
-
getChainInfo: M.
|
|
93
|
-
makeAccount: M.
|
|
93
|
+
getChainInfo: M.call().returns(VowShape),
|
|
94
|
+
makeAccount: M.call().returns(VowShape),
|
|
94
95
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AAwCO,0CALI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AAwCO,0CALI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;;;;;;;;;;;;;iKA4DT,GAAa,kCAED,GACxB;EAKC;kCApFY;IACZ,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,oBAAwB,EAAE,OAAO,oBAAoB,CAAC,CAAC;IACvD,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;6BAbsB,kBAAkB;gCAFf,gCAAgC;4BAIpC,aAAa;0CACC,eAAe;kCAJX,cAAc;6BAE/B,cAAc"}
|
|
@@ -77,6 +77,7 @@ export const provideOrchestration = (
|
|
|
77
77
|
orchestration: remotePowers.orchestrationService,
|
|
78
78
|
storageNode: remotePowers.storageNode,
|
|
79
79
|
timer: remotePowers.timerService,
|
|
80
|
+
vowTools,
|
|
80
81
|
});
|
|
81
82
|
|
|
82
83
|
const makeLocalChainFacade = prepareLocalChainFacade(zone, {
|
|
@@ -86,6 +87,7 @@ export const provideOrchestration = (
|
|
|
86
87
|
storageNode: remotePowers.storageNode,
|
|
87
88
|
orchestration: remotePowers.orchestrationService,
|
|
88
89
|
timer: remotePowers.timerService,
|
|
90
|
+
vowTools,
|
|
89
91
|
});
|
|
90
92
|
|
|
91
93
|
const facade = makeOrchestrationFacade({
|