@agoric/orchestration 0.1.1-dev-46061c3.0 → 0.1.1-dev-1af1596.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/examples/auto-stake-it.contract.d.ts.map +1 -1
- package/src/examples/auto-stake-it.contract.js +1 -1
- package/src/examples/basic-flows.contract.d.ts.map +1 -1
- package/src/examples/basic-flows.contract.js +1 -1
- package/src/examples/send-anywhere.contract.d.ts +11 -8
- package/src/examples/send-anywhere.contract.d.ts.map +1 -1
- package/src/examples/send-anywhere.contract.js +5 -4
- package/src/examples/staking-combinations.contract.d.ts.map +1 -1
- package/src/examples/staking-combinations.contract.js +1 -1
- package/src/examples/swap.contract.d.ts.map +1 -1
- package/src/examples/swap.contract.js +1 -1
- package/src/examples/unbond.contract.d.ts.map +1 -1
- package/src/examples/unbond.contract.js +1 -1
- package/src/exos/cosmos-orchestration-account.d.ts +14 -10
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -1
- package/src/exos/cosmos-orchestration-account.js +18 -13
- package/src/exos/local-chain-facade.d.ts +1 -1
- package/src/exos/local-chain-facade.d.ts.map +1 -1
- package/src/exos/local-chain-facade.js +9 -7
- package/src/exos/local-orchestration-account.d.ts +2 -2
- package/src/exos/local-orchestration-account.d.ts.map +1 -1
- package/src/exos/local-orchestration-account.js +11 -5
- package/src/exos/remote-chain-facade.d.ts +1 -1
- package/src/exos/remote-chain-facade.d.ts.map +1 -1
- package/src/exos/remote-chain-facade.js +12 -8
- package/src/facade.d.ts +1 -4
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +2 -9
- package/src/fixtures/query-flows.contract.d.ts.map +1 -1
- package/src/fixtures/query-flows.contract.js +1 -1
- package/src/utils/start-helper.d.ts +10 -2
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +15 -6
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-1af1596.0+1af1596",
|
|
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-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/network": "0.1.1-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/vats": "0.15.2-dev-
|
|
46
|
-
"@agoric/vow": "0.1.1-dev-
|
|
47
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
48
|
-
"@agoric/zone": "0.2.3-dev-
|
|
36
|
+
"@agoric/async-flow": "0.1.1-dev-1af1596.0+1af1596",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-1af1596.0+1af1596",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-1af1596.0+1af1596",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-1af1596.0+1af1596",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-1af1596.0+1af1596",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-1af1596.0+1af1596",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-1af1596.0+1af1596",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-1af1596.0+1af1596",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-1af1596.0+1af1596",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-1af1596.0+1af1596",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-1af1596.0+1af1596",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-1af1596.0+1af1596",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-1af1596.0+1af1596",
|
|
49
49
|
"@endo/base64": "^1.0.9",
|
|
50
50
|
"@endo/errors": "^1.2.9",
|
|
51
51
|
"@endo/far": "^1.1.10",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "^1.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-1af1596.0+1af1596",
|
|
58
58
|
"@chain-registry/client": "^1.47.4",
|
|
59
59
|
"@cosmjs/amino": "^0.32.3",
|
|
60
60
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"typeCoverage": {
|
|
97
97
|
"atLeast": 97.77
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "1af1596ffa4d14c089c231825fbe5729be4b3ce3"
|
|
100
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-stake-it.contract.d.ts","sourceRoot":"","sources":["auto-stake-it.contract.js"],"names":[],"mappings":"AAmFA;gBAzDiB,UAAU;;;;;;;;;;;;gBAEV,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"auto-stake-it.contract.d.ts","sourceRoot":"","sources":["auto-stake-it.contract.js"],"names":[],"mappings":"AAmFA;gBAzDiB,UAAU;;;;;;;;;;;;gBAEV,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDgB;4BAGjE,OAAO,KAAK;yCAxEgC,0BAA0B;2BAC9B,aAAa;iCAAb,aAAa"}
|
|
@@ -81,7 +81,7 @@ const contract = async (
|
|
|
81
81
|
return { publicFacet, creatorFacet };
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
export const start = withOrchestration(contract);
|
|
84
|
+
export const start = withOrchestration(contract, { publishAccountInfo: true });
|
|
85
85
|
harden(start);
|
|
86
86
|
|
|
87
87
|
/** @typedef {typeof start} AutoStakeItSF */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-flows.contract.d.ts","sourceRoot":"","sources":["basic-flows.contract.js"],"names":[],"mappings":"AAwEA;gBApDiB,UAAU;;;;;;;;;;;;gBAEV,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"basic-flows.contract.d.ts","sourceRoot":"","sources":["basic-flows.contract.js"],"names":[],"mappings":"AAwEA;gBApDiB,UAAU;;;;;;;;;;;;gBAEV,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;;;;;;GAkDgB;2BAGjE,OAAO,KAAK;yCA7DgC,0BAA0B;2BAD9B,uBAAuB;iCAAvB,uBAAuB"}
|
|
@@ -70,7 +70,7 @@ const contract = async (
|
|
|
70
70
|
return { publicFacet };
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
export const start = withOrchestration(contract);
|
|
73
|
+
export const start = withOrchestration(contract, { publishAccountInfo: true });
|
|
74
74
|
harden(start);
|
|
75
75
|
|
|
76
76
|
/** @typedef {typeof start} BasicFlowsSF */
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import {Vow} from '@agoric/vow';
|
|
2
|
+
* @import {Remote, Vow} from '@agoric/vow';
|
|
3
3
|
* @import {Zone} from '@agoric/zone';
|
|
4
4
|
* @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js';
|
|
5
5
|
* @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
|
|
6
6
|
*/
|
|
7
7
|
export const SingleNatAmountRecord: import("@endo/patterns").Matcher;
|
|
8
8
|
export function contract(zcf: ZCF, privateArgs: OrchestrationPowers & {
|
|
9
|
-
marshaller: Marshaller;
|
|
10
|
-
chainInfo?: Record<string, CosmosChainInfo>;
|
|
11
9
|
assetInfo?: [Denom, DenomDetail & {
|
|
12
10
|
brandKey?: string;
|
|
13
11
|
}][];
|
|
12
|
+
chainInfo?: Record<string, CosmosChainInfo>;
|
|
13
|
+
marshaller: Marshaller;
|
|
14
|
+
storageNode: Remote<StorageNode>;
|
|
14
15
|
}, zone: Zone, { chainHub, orchestrateAll, vowTools, zoeTools }: OrchestrationTools): Promise<{
|
|
15
16
|
publicFacet: import("@endo/exo").Guarded<{
|
|
16
17
|
makeSendInvitation(): Promise<Invitation<Vow<void>, {
|
|
@@ -24,7 +25,9 @@ export function contract(zcf: ZCF, privateArgs: OrchestrationPowers & {
|
|
|
24
25
|
}>;
|
|
25
26
|
}>;
|
|
26
27
|
export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: OrchestrationPowers & {
|
|
27
|
-
|
|
28
|
+
assetInfo?: [Denom, DenomDetail & {
|
|
29
|
+
brandKey?: string;
|
|
30
|
+
}][];
|
|
28
31
|
chainInfo?: Record<string, Readonly<{
|
|
29
32
|
bech32Prefix?: string;
|
|
30
33
|
chainId: string;
|
|
@@ -36,9 +39,8 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
36
39
|
}>>;
|
|
37
40
|
icaEnabled?: boolean;
|
|
38
41
|
}>>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}][];
|
|
42
|
+
marshaller: Marshaller;
|
|
43
|
+
storageNode: Remote<StorageNode>;
|
|
42
44
|
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
43
45
|
publicFacet: import("@endo/exo").Guarded<{
|
|
44
46
|
makeSendInvitation(): Promise<Invitation<Vow<void>, {
|
|
@@ -62,9 +64,10 @@ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: Orchestrati
|
|
|
62
64
|
}>;
|
|
63
65
|
}>;
|
|
64
66
|
import type { OrchestrationPowers } from '../utils/start-helper.js';
|
|
65
|
-
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
66
67
|
import type { Denom } from '@agoric/orchestration';
|
|
67
68
|
import type { DenomDetail } from '@agoric/orchestration';
|
|
69
|
+
import type { CosmosChainInfo } from '@agoric/orchestration';
|
|
70
|
+
import type { Remote } from '@agoric/vow';
|
|
68
71
|
import type { Zone } from '@agoric/zone';
|
|
69
72
|
import type { OrchestrationTools } from '../utils/start-helper.js';
|
|
70
73
|
import type { Vow } from '@agoric/vow';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-anywhere.contract.d.ts","sourceRoot":"","sources":["send-anywhere.contract.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH,qEAKE;
|
|
1
|
+
{"version":3,"file":"send-anywhere.contract.d.ts","sourceRoot":"","sources":["send-anywhere.contract.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH,qEAKE;AAgBK,8BAVI,GAAG,eACH,mBAAmB,GAAG;IAC5B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;CAClC,QACO,IAAI,oDACJ,kBAAkB;;;;;;;;;;;GA6D5B;AAGD;gBAtEiB,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;;;;;gBAE9C,UAAU;iBACT,OAAO,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;GAmE0C;yCAvFrB,0BAA0B;2BAC9B,uBAAuB;iCAAvB,uBAAuB;qCAAvB,uBAAuB;4BAH/C,aAAa;0BACpB,cAAc;wCACqB,0BAA0B;yBAFtD,aAAa"}
|
|
@@ -9,7 +9,7 @@ import * as flows from './send-anywhere.flows.js';
|
|
|
9
9
|
import * as sharedFlows from './shared.flows.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* @import {Vow} from '@agoric/vow';
|
|
12
|
+
* @import {Remote, Vow} from '@agoric/vow';
|
|
13
13
|
* @import {Zone} from '@agoric/zone';
|
|
14
14
|
* @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js';
|
|
15
15
|
* @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
|
|
@@ -28,9 +28,10 @@ harden(SingleNatAmountRecord);
|
|
|
28
28
|
*
|
|
29
29
|
* @param {ZCF} zcf
|
|
30
30
|
* @param {OrchestrationPowers & {
|
|
31
|
-
* marshaller: Marshaller;
|
|
32
|
-
* chainInfo?: Record<string, CosmosChainInfo>;
|
|
33
31
|
* assetInfo?: [Denom, DenomDetail & { brandKey?: string }][];
|
|
32
|
+
* chainInfo?: Record<string, CosmosChainInfo>;
|
|
33
|
+
* marshaller: Marshaller;
|
|
34
|
+
* storageNode: Remote<StorageNode>;
|
|
34
35
|
* }} privateArgs
|
|
35
36
|
* @param {Zone} zone
|
|
36
37
|
* @param {OrchestrationTools} tools
|
|
@@ -97,5 +98,5 @@ export const contract = async (
|
|
|
97
98
|
};
|
|
98
99
|
harden(contract);
|
|
99
100
|
|
|
100
|
-
export const start = withOrchestration(contract);
|
|
101
|
+
export const start = withOrchestration(contract, { publishAccountInfo: true });
|
|
101
102
|
harden(start);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"AAiKA;gBA5HiB,UAAU;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"staking-combinations.contract.d.ts","sourceRoot":"","sources":["staking-combinations.contract.js"],"names":[],"mappings":"AAiKA;gBA5HiB,UAAU;;;;;;;;;;;;;;;;;;;;;GA4HoD;yCA7IrB,0BAA0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.contract.d.ts","sourceRoot":"","sources":["swap.contract.js"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAanC;AASK,0CAHI,KAAK,QACL,QAAQ;;;EAGmC;AAkDtD;iBA1CkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;kBAClB,OAAO,YAAY,CAAC;gBACtB,UAAU;;;;;;;;;;;;eAEX,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;
|
|
1
|
+
{"version":3,"file":"swap.contract.d.ts","sourceRoot":"","sources":["swap.contract.js"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAanC;AASK,0CAHI,KAAK,QACL,QAAQ;;;EAGmC;AAkDtD;iBA1CkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;kBAClB,OAAO,YAAY,CAAC;gBACtB,UAAU;;;;;;;;;;;;eAEX,CAAC,KAAK,EAAE,WAAW,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE;;;;;;;;GAmCiB;6BA/ErD,cAAc;4BAFf,kBAAkB;gCADd,gCAAgC;6CAEnB,2BAA2B;kCAHtC,cAAc;2BAOS,uBAAuB;iCAAvB,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbond.contract.d.ts","sourceRoot":"","sources":["unbond.contract.js"],"names":[],"mappings":"AAwDA;iBArCkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;gBACpB,UAAU;kBACR,OAAO,YAAY,CAAC;;;;;
|
|
1
|
+
{"version":3,"file":"unbond.contract.d.ts","sourceRoot":"","sources":["unbond.contract.js"],"names":[],"mappings":"AAwDA;iBArCkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;gBACpB,UAAU;kBACR,OAAO,YAAY,CAAC;;;;;GAgCwC;6BAjDrD,cAAc;4BACf,kBAAkB;gCAFd,gCAAgC;6CAInB,2BAA2B;kCALtC,cAAc"}
|
|
@@ -49,14 +49,18 @@ export function prepareCosmosOrchestrationAccountKit(zone: Zone, { chainHub, mak
|
|
|
49
49
|
remoteAddress: RemoteIbcAddress;
|
|
50
50
|
}, io: {
|
|
51
51
|
account: IcaAccount;
|
|
52
|
-
storageNode
|
|
53
|
-
icqConnection
|
|
52
|
+
storageNode?: Remote<globalThis.StorageNode> | undefined;
|
|
53
|
+
icqConnection?: import("@endo/exo").Guarded<{
|
|
54
|
+
getLocalAddress(): `/ibc-port/${string}`;
|
|
55
|
+
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
56
|
+
query(msgs: JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Vow<JsonSafe<ResponseQuery>[]>;
|
|
57
|
+
}> | undefined;
|
|
54
58
|
timer: Remote<TimerService>;
|
|
55
59
|
}) => import("@endo/exo").GuardedKit<{
|
|
56
60
|
helper: {
|
|
57
61
|
/** @throws if this holder no longer owns the account */
|
|
58
62
|
owned(): IcaAccount;
|
|
59
|
-
getUpdater(): import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<
|
|
63
|
+
getUpdater(): import("@agoric/zoe/src/contractSupport/recorder.js").Recorder<CosmosOrchestrationAccountNotification>;
|
|
60
64
|
/**
|
|
61
65
|
* @param {AmountArg} amount
|
|
62
66
|
* @returns {Coin}
|
|
@@ -306,20 +310,20 @@ export function prepareCosmosOrchestrationAccount(zone: Zone, { chainHub, makeRe
|
|
|
306
310
|
vowTools: VowTools;
|
|
307
311
|
zcf: ZCF;
|
|
308
312
|
}): (...args: Parameters<ReturnType<typeof prepareCosmosOrchestrationAccountKit>>) => CosmosOrchestrationAccountKit["holder"];
|
|
309
|
-
export type
|
|
313
|
+
export type CosmosOrchestrationAccountNotification = {
|
|
310
314
|
chainAddress: ChainAddress;
|
|
311
315
|
};
|
|
312
316
|
/**
|
|
313
317
|
* Internal to the IcaAccountHolder exo
|
|
314
318
|
*/
|
|
315
319
|
export type State = {
|
|
316
|
-
topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
|
|
317
320
|
account: IcaAccount;
|
|
318
321
|
chainAddress: ChainAddress;
|
|
322
|
+
icqConnection: ICQConnection | undefined;
|
|
319
323
|
localAddress: LocalIbcAddress;
|
|
320
324
|
remoteAddress: RemoteIbcAddress;
|
|
321
|
-
icqConnection: ICQConnection | undefined;
|
|
322
325
|
timer: Remote<TimerService>;
|
|
326
|
+
topicKit: RecorderKit<CosmosOrchestrationAccountNotification> | undefined;
|
|
323
327
|
};
|
|
324
328
|
export type CosmosOrchestrationAccountStorageState = {
|
|
325
329
|
localAddress: LocalIbcAddress;
|
|
@@ -337,16 +341,16 @@ import type { ChainAddress } from '../types.js';
|
|
|
337
341
|
import type { LocalIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
338
342
|
import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
339
343
|
import type { IcaAccount } from '../types.js';
|
|
340
|
-
import type {
|
|
344
|
+
import type { JsonSafe } from '@agoric/cosmic-proto';
|
|
345
|
+
import type { ResponseQuery } from '@agoric/cosmic-proto/tendermint/abci/types.js';
|
|
346
|
+
import type { Vow } from '@agoric/vow';
|
|
341
347
|
import type { AmountArg } from '../types.js';
|
|
342
348
|
import type { Coin } from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js';
|
|
343
|
-
import type { ResponseQuery } from '@agoric/cosmic-proto/tendermint/abci/types.js';
|
|
344
|
-
import type { JsonSafe } from '@agoric/cosmic-proto';
|
|
345
349
|
import type { CosmosDelegationResponse } from '../types.js';
|
|
346
350
|
import type { CosmosRewardsResponse } from '../types.js';
|
|
347
|
-
import type { Vow } from '@agoric/vow';
|
|
348
351
|
import type { IBCConnectionInfo } from '../types.js';
|
|
349
352
|
import type { IBCMsgTransferOptions } from '../types.js';
|
|
350
353
|
import type { CosmosValidatorAddress } from '../types.js';
|
|
354
|
+
import type { ICQConnection } from '../types.js';
|
|
351
355
|
import type { RecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
352
356
|
//# sourceMappingURL=cosmos-orchestration-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AA4IA,wCAAwC;AACxC;;;;;;;;;;;;;;;;;;;;;;;;;GASG;AAOH;;;;;;;;;;;GAkBE;AAYK,2DARI,IAAI,gGAEZ;IAAyB,QAAQ,EAAzB,QAAQ;IACgB,eAAe,EAAvC,eAAe;IACc,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,Q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gB,CAAC;IAChC,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,QAAQ,EAAE,YAAY,sCAAsC,CAAC,GAAG,SAAS,CAAC;CAC3E;qDAKS;IACR,YAAY,EAAE,eAAe,CAAC;IAC9B,aAAa,EAAE,gBAAgB,CAAC;CACjC;4CAk/BS,UAAU,CAClB,UAAU,CAAC,OAAO,oCAAoC,CAAC,CACxD;yCA8BU,6BAA6B,CAAC,QAAQ,CAAC;0BApjC9B,cAAc;8BARuO,aAAa;qCAC1O,6CAA6C;kCAK7D,cAAc;4BAHpB,kBAAkB;8BAIX,aAAa;kCAP+N,aAAa;qCAYrO,iCAAiC;sCAAjC,iCAAiC;gCAZuL,aAAa;8BAU9P,sBAAsB;mCADjB,+CAA+C;yBAF/C,aAAa;+BAP+N,aAAa;0BAElQ,kDAAkD;8CAFmM,aAAa;2CAAb,aAAa;uCAAb,aAAa;2CAAb,aAAa;4CAAb,aAAa;mCAAb,aAAa;iCAC1O,6CAA6C"}
|
|
@@ -87,20 +87,20 @@ const trace = makeTracer('CosmosOrchAccount');
|
|
|
87
87
|
const { Vow$ } = NetworkShape; // TODO #9611
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* @typedef {object}
|
|
90
|
+
* @typedef {object} CosmosOrchestrationAccountNotification
|
|
91
91
|
* @property {ChainAddress} chainAddress
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* @private
|
|
96
96
|
* @typedef {{
|
|
97
|
-
* topicKit: RecorderKit<ComosOrchestrationAccountNotification>;
|
|
98
97
|
* account: IcaAccount;
|
|
99
98
|
* chainAddress: ChainAddress;
|
|
99
|
+
* icqConnection: ICQConnection | undefined;
|
|
100
100
|
* localAddress: LocalIbcAddress;
|
|
101
101
|
* remoteAddress: RemoteIbcAddress;
|
|
102
|
-
* icqConnection: ICQConnection | undefined;
|
|
103
102
|
* timer: Remote<TimerService>;
|
|
103
|
+
* topicKit: RecorderKit<CosmosOrchestrationAccountNotification> | undefined;
|
|
104
104
|
* }} State
|
|
105
105
|
* Internal to the IcaAccountHolder exo
|
|
106
106
|
*/
|
|
@@ -291,26 +291,29 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
291
291
|
* @param {RemoteIbcAddress} info.remoteAddress
|
|
292
292
|
* @param {object} io
|
|
293
293
|
* @param {IcaAccount} io.account
|
|
294
|
-
* @param {Remote<StorageNode>} io.storageNode
|
|
295
|
-
* @param {ICQConnection
|
|
294
|
+
* @param {Remote<StorageNode>} [io.storageNode]
|
|
295
|
+
* @param {ICQConnection} [io.icqConnection]
|
|
296
296
|
* @param {Remote<TimerService>} io.timer
|
|
297
297
|
* @returns {State}
|
|
298
298
|
*/
|
|
299
299
|
({ chainAddress, localAddress, remoteAddress }, io) => {
|
|
300
300
|
const { storageNode } = io;
|
|
301
301
|
// must be the fully synchronous maker because the kit is held in durable state
|
|
302
|
-
const topicKit =
|
|
302
|
+
const topicKit = storageNode
|
|
303
|
+
? makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1])
|
|
304
|
+
: undefined;
|
|
303
305
|
// TODO determine what goes in vstorage https://github.com/Agoric/agoric-sdk/issues/9066
|
|
304
306
|
// XXX consider parsing local/remoteAddr to portId, channelId, counterpartyPortId, counterpartyChannelId, connectionId, counterpartyConnectionId
|
|
305
307
|
// FIXME these values will not update if IcaAccount gets new values after reopening.
|
|
306
308
|
// consider having IcaAccount responsible for the owning the writer. It might choose to share it with COA.
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
309
|
+
if (topicKit) {
|
|
310
|
+
void E(topicKit.recorder).write(
|
|
311
|
+
/** @type {CosmosOrchestrationAccountStorageState} */ ({
|
|
312
|
+
localAddress,
|
|
313
|
+
remoteAddress,
|
|
314
|
+
}),
|
|
315
|
+
);
|
|
316
|
+
}
|
|
314
317
|
const { account, icqConnection, timer } = io;
|
|
315
318
|
return {
|
|
316
319
|
account,
|
|
@@ -333,6 +336,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
333
336
|
return account;
|
|
334
337
|
},
|
|
335
338
|
getUpdater() {
|
|
339
|
+
if (!this.state.topicKit) throw Fail`no topicKit`;
|
|
336
340
|
return this.state.topicKit.recorder;
|
|
337
341
|
},
|
|
338
342
|
/**
|
|
@@ -731,6 +735,7 @@ export const prepareCosmosOrchestrationAccountKit = (
|
|
|
731
735
|
return asVow(async () => {
|
|
732
736
|
await null;
|
|
733
737
|
const { topicKit } = this.state;
|
|
738
|
+
if (!topicKit) throw Fail`No topicKit; storageNode not provided`;
|
|
734
739
|
return harden({
|
|
735
740
|
account: {
|
|
736
741
|
description: PUBLIC_TOPICS.account[0],
|
|
@@ -47,7 +47,7 @@ export type AgoricChainMethods = {
|
|
|
47
47
|
export type LocalChainFacadePowers = {
|
|
48
48
|
makeLocalOrchestrationAccountKit: MakeLocalOrchestrationAccountKit;
|
|
49
49
|
orchestration: Remote<CosmosInterchainService>;
|
|
50
|
-
storageNode: Remote<StorageNode
|
|
50
|
+
storageNode: Remote<StorageNode> | undefined;
|
|
51
51
|
agoricNames: Remote<NameHub>;
|
|
52
52
|
timer: Remote<TimerService>;
|
|
53
53
|
localchain: Remote<LocalChain>;
|
|
@@ -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":"AA8LO,8CAJI,IAAI,UACJ,sBAAsB;;;;;;;;;;;;;;;;;;;;;;IAtFzB,6DAA6D;mBAA/C,IAAI,4BAA4B,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;;GA4FhE;;;;;;;;;;;uBArKa,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;;qCAO3B;IACR,gCAAgC,EAAE,gCAAgC,CAAC;IACnE,aAAa,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC/C,WAAW,EAAE,OAAO,WAAW,CAAC,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;CACpB;mCAyJU,UAAU,CAAC,OAAO,uBAAuB,CAAC;+BAC1C,UAAU,CAAC,oBAAoB,CAAC;0BAzLvB,mBAAmB;uCASiE,aAAa;yBAHxF,aAAa;kDAEoC,kCAAkC;+BAJvF,8BAA8B;sDAIuB,kCAAkC;6CADzE,qBAAqB;4BALtC,kBAAkB;6BAGjB,cAAc;kCAJT,cAAc;gCAEgB,gCAAgC;8BAG7D,aAAa"}
|
|
@@ -36,7 +36,7 @@ import { chainFacadeMethods, TypedJsonShape } from '../typeGuards.js';
|
|
|
36
36
|
* @typedef {{
|
|
37
37
|
* makeLocalOrchestrationAccountKit: MakeLocalOrchestrationAccountKit;
|
|
38
38
|
* orchestration: Remote<CosmosInterchainService>;
|
|
39
|
-
* storageNode: Remote<StorageNode
|
|
39
|
+
* storageNode: Remote<StorageNode> | undefined;
|
|
40
40
|
* agoricNames: Remote<NameHub>;
|
|
41
41
|
* timer: Remote<TimerService>;
|
|
42
42
|
* localchain: Remote<LocalChain>;
|
|
@@ -79,7 +79,7 @@ const prepareLocalChainFacadeKit = (
|
|
|
79
79
|
.returns(VowShape),
|
|
80
80
|
}),
|
|
81
81
|
makeChildNodeWatcher: M.interface('makeChildNodeWatcher', {
|
|
82
|
-
onFulfilled: M.call(M.remotable())
|
|
82
|
+
onFulfilled: M.call(M.or(M.remotable(), M.undefined()))
|
|
83
83
|
.optional({ account: M.remotable(), address: M.string() }) // empty context
|
|
84
84
|
.returns(M.remotable()),
|
|
85
85
|
}),
|
|
@@ -145,11 +145,13 @@ const prepareLocalChainFacadeKit = (
|
|
|
145
145
|
* @param {[LocalChainAccount, ChainAddress['value']]} results
|
|
146
146
|
*/
|
|
147
147
|
onFulfilled([account, address]) {
|
|
148
|
-
|
|
149
|
-
E(storageNode).makeChildNode(address)
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
const optionalStorageNode = storageNode
|
|
149
|
+
? E(storageNode).makeChildNode(address)
|
|
150
|
+
: undefined;
|
|
151
|
+
return watch(optionalStorageNode, this.facets.makeChildNodeWatcher, {
|
|
152
|
+
account,
|
|
153
|
+
address,
|
|
154
|
+
});
|
|
153
155
|
},
|
|
154
156
|
},
|
|
155
157
|
makeChildNodeWatcher: {
|
|
@@ -9,7 +9,7 @@ export function prepareLocalOrchestrationAccountKit(zone: Zone, { makeRecorderKi
|
|
|
9
9
|
}): (args_0: {
|
|
10
10
|
account: LocalChainAccount;
|
|
11
11
|
address: ChainAddress;
|
|
12
|
-
storageNode
|
|
12
|
+
storageNode?: Remote<globalThis.StorageNode> | undefined;
|
|
13
13
|
}) => import("@endo/exo").GuardedKit<{
|
|
14
14
|
helper: {
|
|
15
15
|
/**
|
|
@@ -188,7 +188,7 @@ export type LocalChainAccountNotification = {
|
|
|
188
188
|
* Internal to the LocalOrchestrationAccount exo
|
|
189
189
|
*/
|
|
190
190
|
export type State = {
|
|
191
|
-
topicKit: RecorderKit<LocalChainAccountNotification
|
|
191
|
+
topicKit: RecorderKit<LocalChainAccountNotification> | undefined;
|
|
192
192
|
packetTools: PacketTools;
|
|
193
193
|
account: LocalChainAccount;
|
|
194
194
|
address: ChainAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-orchestration-account.d.ts","sourceRoot":"","sources":["local-orchestration-account.js"],"names":[],"mappings":"AAiGO,0DAVI,IAAI,qFAEZ;IAAgC,eAAe,EAAvC,eAAe;IACH,GAAG,EAAf,GAAG;IAC0B,YAAY,EAAzC,OAAO,YAAY,CAAC;IACH,QAAQ,EAAzB,QAAQ;IACS,QAAQ,EAAzB,QA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it: RecorderKit<LocalChainAccountNotification
|
|
60
|
+
* topicKit: RecorderKit<LocalChainAccountNotification> | undefined;
|
|
61
61
|
* packetTools: PacketTools;
|
|
62
62
|
* account: LocalChainAccount;
|
|
63
63
|
* address: ChainAddress;
|
|
@@ -181,17 +181,22 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
181
181
|
* @param {object} initState
|
|
182
182
|
* @param {LocalChainAccount} initState.account
|
|
183
183
|
* @param {ChainAddress} initState.address
|
|
184
|
-
* @param {Remote<StorageNode>} initState.storageNode
|
|
184
|
+
* @param {Remote<StorageNode>} [initState.storageNode]
|
|
185
185
|
* @returns {State}
|
|
186
186
|
*/
|
|
187
187
|
({ account, address, storageNode }) => {
|
|
188
188
|
// must be the fully synchronous maker because the kit is held in durable state
|
|
189
|
-
const topicKit =
|
|
189
|
+
const topicKit = storageNode
|
|
190
|
+
? makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1])
|
|
191
|
+
: undefined;
|
|
190
192
|
// TODO determine what goes in vstorage https://github.com/Agoric/agoric-sdk/issues/9066
|
|
191
|
-
|
|
193
|
+
if (topicKit) {
|
|
194
|
+
void E(topicKit.recorder).write('');
|
|
195
|
+
}
|
|
196
|
+
|
|
192
197
|
const packetTools = makePacketTools(account);
|
|
193
198
|
|
|
194
|
-
return { account, address,
|
|
199
|
+
return { account, address, packetTools, topicKit };
|
|
195
200
|
},
|
|
196
201
|
{
|
|
197
202
|
helper: {
|
|
@@ -548,6 +553,7 @@ export const prepareLocalOrchestrationAccountKit = (
|
|
|
548
553
|
return asVow(async () => {
|
|
549
554
|
await null;
|
|
550
555
|
const { topicKit } = this.state;
|
|
556
|
+
if (!topicKit) throw Fail`No topicKit; storageNode not provided`;
|
|
551
557
|
return harden({
|
|
552
558
|
account: {
|
|
553
559
|
description: PUBLIC_TOPICS.account[0],
|
|
@@ -37,7 +37,7 @@ export function prepareRemoteChainFacade(zone: Zone, powers: RemoteChainFacadePo
|
|
|
37
37
|
export type RemoteChainFacadePowers = {
|
|
38
38
|
makeCosmosOrchestrationAccount: ReturnType<typeof prepareCosmosOrchestrationAccount>;
|
|
39
39
|
orchestration: Remote<CosmosInterchainService>;
|
|
40
|
-
storageNode: Remote<StorageNode
|
|
40
|
+
storageNode: Remote<StorageNode> | undefined;
|
|
41
41
|
timer: Remote<TimerService>;
|
|
42
42
|
vowTools: VowTools;
|
|
43
43
|
};
|
|
@@ -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":"AAuQO,+CAHI,IAAI,UACJ,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKjC;sCA5OY;IACR,8BAA8B,EAAE,UAAU,CAC9C,wCAA8C,CACzC,CAAC;IACF,aAAa,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC/C,WAAW,EAAE,OAAO,WAAW,CAAC,GAAG,SAAS,CAAC;IAC7C,KAAK,EAAE,OAAO,YAAY,CAAC,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACpB;qCAIS;IACR,eAAe,EAAE,eAAe,CAAC;IACjC,cAAc,EAAE,iBAAiB,CAAC;IAClC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;CAC1C;oCA+NU,UAAU,CAAC,OAAO,wBAAwB,CAAC;gCAC3C,UAAU,CAAC,qBAAqB,CAAC;0BA/PxB,mBAAmB;uCAS2D,aAAa;yBAJlF,aAAa;uDAGO,mCAAmC;6CAD7C,qBAAqB;4BAHtC,kBAAkB;kCADZ,cAAc;8BAEb,aAAa;qCAIwD,aAAa;mCAAb,aAAa"}
|
|
@@ -33,7 +33,7 @@ const trace = makeTracer('RemoteChainFacade');
|
|
|
33
33
|
* typeof prepareCosmosOrchestrationAccount
|
|
34
34
|
* >;
|
|
35
35
|
* orchestration: Remote<CosmosInterchainService>;
|
|
36
|
-
* storageNode: Remote<StorageNode
|
|
36
|
+
* storageNode: Remote<StorageNode> | undefined;
|
|
37
37
|
* timer: Remote<TimerService>;
|
|
38
38
|
* vowTools: VowTools;
|
|
39
39
|
* }} RemoteChainFacadePowers
|
|
@@ -94,7 +94,7 @@ const prepareRemoteChainFacadeKit = (
|
|
|
94
94
|
).returns(VowShape),
|
|
95
95
|
}),
|
|
96
96
|
makeChildNodeWatcher: M.interface('makeChildNodeWatcher', {
|
|
97
|
-
onFulfilled: M.call(M.remotable(), {
|
|
97
|
+
onFulfilled: M.call(M.or(M.remotable(), M.undefined()), {
|
|
98
98
|
account: M.remotable(),
|
|
99
99
|
chainAddress: ChainAddressShape,
|
|
100
100
|
localAddress: M.string(),
|
|
@@ -210,16 +210,20 @@ const prepareRemoteChainFacadeKit = (
|
|
|
210
210
|
* @param {IcaAccount} account
|
|
211
211
|
*/
|
|
212
212
|
onFulfilled([chainAddress, localAddress, remoteAddress], account) {
|
|
213
|
-
|
|
214
|
-
E(storageNode).makeChildNode(chainAddress.value)
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
213
|
+
const optionalStorageNode = storageNode
|
|
214
|
+
? E(storageNode).makeChildNode(chainAddress.value)
|
|
215
|
+
: undefined;
|
|
216
|
+
return watch(optionalStorageNode, this.facets.makeChildNodeWatcher, {
|
|
217
|
+
account,
|
|
218
|
+
chainAddress,
|
|
219
|
+
localAddress,
|
|
220
|
+
remoteAddress,
|
|
221
|
+
});
|
|
218
222
|
},
|
|
219
223
|
},
|
|
220
224
|
makeChildNodeWatcher: {
|
|
221
225
|
/**
|
|
222
|
-
* @param {Remote<StorageNode>} childNode
|
|
226
|
+
* @param {Remote<StorageNode> | undefined} childNode
|
|
223
227
|
* @param {{
|
|
224
228
|
* account: IcaAccount;
|
|
225
229
|
* chainAddress: ChainAddress;
|
package/src/facade.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
export function makeOrchestrationFacade({ zone, timerService, zcf,
|
|
1
|
+
export function makeOrchestrationFacade({ zone, timerService, zcf, orchestrationService, makeOrchestrator, vowTools, asyncFlowTools, }: {
|
|
2
2
|
zone: Zone;
|
|
3
3
|
timerService: Remote<TimerService>;
|
|
4
4
|
zcf: ZCF;
|
|
5
|
-
storageNode: Remote<StorageNode>;
|
|
6
5
|
orchestrationService: Remote<CosmosInterchainService>;
|
|
7
|
-
makeRecorderKit: MakeRecorderKit;
|
|
8
6
|
makeOrchestrator: () => HostOrchestrator;
|
|
9
7
|
vowTools: VowTools;
|
|
10
8
|
asyncFlowTools: AsyncFlowTools;
|
|
@@ -23,7 +21,6 @@ import type { Zone } from '@agoric/zone';
|
|
|
23
21
|
import type { TimerService } from '@agoric/time';
|
|
24
22
|
import type { Remote } from '@agoric/internal';
|
|
25
23
|
import type { CosmosInterchainService } from './exos/exo-interfaces.js';
|
|
26
|
-
import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
27
24
|
import type { HostOrchestrator } from './exos/orchestrator.js';
|
|
28
25
|
import type { VowTools } from '@agoric/vow';
|
|
29
26
|
import type { AsyncFlowTools } from '@agoric/async-flow';
|
package/src/facade.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["facade.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["facade.js"],"names":[],"mappings":"AAsCO,wIAVI;IACN,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,OAAO,YAAY,CAAC,CAAC;IACnC,GAAG,EAAE,GAAG,CAAC;IACT,oBAAoB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACtD,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;IACzC,QAAQ,EAAE,QAAQ,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;CAChC;kBAwBW,EAAE,EACsC,EAAE,SAA1C,kBAAmB,eAAe,EAAE,CAAC,CAAE,eACzC,MAAM,WAEN,EAAE,WACF,EAAE,KACA,YAAY,CAAC,EAAE,CAAC;qBAmCM,EAAE,SAAvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAE,EAG5B,GAAG,SAFI;QACZ,CAAK,WAAW,EAAE,MAAM,GAAG,kBAAkB,eAAe,EAAE,CAAC,CAAC,CAAC;KAC7D,YAEM,GAAG,WACH,EAAE,KACA,GAAG,CAAC,IAAI,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAE;EA+BxD;;;;yBA1HgC,EAAE,SAAtB,iBAAmB,IACnB,EAAE,SAAS,CACnB,GAAG,EAAE,YAAY,EACjB,GAAG,EAAE,GAAG,EACZ,GAAO,IAAI,EAAE,MAAM,EAAE,KACd,OAAO,CAAC,MAAM,EAAE,CAAC,GAClB,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,GAClC,KAAK;kCAqHE,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BAxIjC,cAAc;kCAEN,cAAc;4BAEpB,kBAAkB;6CACD,0BAA0B;sCAFjC,wBAAwB;8BAF3B,aAAa;oCAFc,oBAAoB;oCAApB,oBAAoB;uCAO7B,YAAY;kCAAZ,YAAY;8BAPH,oBAAoB;yBAE/C,aAAa"}
|
package/src/facade.js
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
import { assertAllDefined, deepMapObject } from '@agoric/internal';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @import {AsyncFlowTools, GuestInterface, HostArgs
|
|
5
|
+
* @import {AsyncFlowTools, GuestInterface, HostArgs} from '@agoric/async-flow';
|
|
6
6
|
* @import {Zone} from '@agoric/zone';
|
|
7
7
|
* @import {Vow, VowTools} from '@agoric/vow';
|
|
8
8
|
* @import {TimerService} from '@agoric/time';
|
|
9
|
-
* @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'.
|
|
10
9
|
* @import {HostOrchestrator} from './exos/orchestrator.js';
|
|
11
10
|
* @import {Remote} from '@agoric/internal';
|
|
12
11
|
* @import {CosmosInterchainService} from './exos/exo-interfaces.js';
|
|
13
|
-
* @import {
|
|
12
|
+
* @import {OrchestrationFlow, Orchestrator} from './types.js';
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -31,9 +30,7 @@ import { assertAllDefined, deepMapObject } from '@agoric/internal';
|
|
|
31
30
|
* zone: Zone;
|
|
32
31
|
* timerService: Remote<TimerService>;
|
|
33
32
|
* zcf: ZCF;
|
|
34
|
-
* storageNode: Remote<StorageNode>;
|
|
35
33
|
* orchestrationService: Remote<CosmosInterchainService>;
|
|
36
|
-
* makeRecorderKit: MakeRecorderKit;
|
|
37
34
|
* makeOrchestrator: () => HostOrchestrator;
|
|
38
35
|
* vowTools: VowTools;
|
|
39
36
|
* asyncFlowTools: AsyncFlowTools;
|
|
@@ -43,9 +40,7 @@ export const makeOrchestrationFacade = ({
|
|
|
43
40
|
zone,
|
|
44
41
|
timerService,
|
|
45
42
|
zcf,
|
|
46
|
-
storageNode,
|
|
47
43
|
orchestrationService,
|
|
48
|
-
makeRecorderKit,
|
|
49
44
|
makeOrchestrator,
|
|
50
45
|
vowTools,
|
|
51
46
|
asyncFlowTools,
|
|
@@ -54,9 +49,7 @@ export const makeOrchestrationFacade = ({
|
|
|
54
49
|
zone,
|
|
55
50
|
timerService,
|
|
56
51
|
zcf,
|
|
57
|
-
storageNode,
|
|
58
52
|
orchestrationService,
|
|
59
|
-
makeRecorderKit,
|
|
60
53
|
makeOrchestrator,
|
|
61
54
|
vowTools,
|
|
62
55
|
asyncFlowTools,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-flows.contract.d.ts","sourceRoot":"","sources":["query-flows.contract.js"],"names":[],"mappings":"AAkEA;gBAjDiB,UAAU;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"query-flows.contract.d.ts","sourceRoot":"","sources":["query-flows.contract.js"],"names":[],"mappings":"AAkEA;gBAjDiB,UAAU;;;;;;;;;;;;;;;;;;GAiDoD;2BAGjE,OAAO,KAAK;yCA3DY,2BAA2B"}
|
|
@@ -64,7 +64,7 @@ const contract = async (zcf, _privateArgs, zone, { orchestrateAll }) => {
|
|
|
64
64
|
return { publicFacet };
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
export const start = withOrchestration(contract);
|
|
67
|
+
export const start = withOrchestration(contract, { publishAccountInfo: true });
|
|
68
68
|
harden(start);
|
|
69
69
|
|
|
70
70
|
/** @typedef {typeof start} QueryFlowsSF */
|
|
@@ -69,14 +69,22 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
|
|
|
69
69
|
};
|
|
70
70
|
export function withOrchestration<CT extends Record<string, unknown>, PA extends OrchestrationPowers & {
|
|
71
71
|
marshaller: Marshaller;
|
|
72
|
-
}, R>(contractFn: (zcf: ZCF<CT>, privateArgs: PA, zone: Zone, tools: OrchestrationTools) => Promise<R
|
|
72
|
+
}, R>(contractFn: (zcf: ZCF<CT>, privateArgs: PA, zone: Zone, tools: OrchestrationTools) => Promise<R>, opts?: WithOrchestrationOpts): (zcf: ZCF<CT>, privateArgs: PA, baggage: Baggage) => Promise<R>;
|
|
73
73
|
export type OrchestrationPowers = {
|
|
74
74
|
localchain: Remote<LocalChain>;
|
|
75
75
|
orchestrationService: Remote<CosmosInterchainService>;
|
|
76
|
-
storageNode
|
|
76
|
+
storageNode?: Remote<StorageNode>;
|
|
77
77
|
timerService: Remote<TimerService>;
|
|
78
78
|
agoricNames: Remote<NameHub>;
|
|
79
79
|
};
|
|
80
|
+
export type WithOrchestrationOpts = {
|
|
81
|
+
/**
|
|
82
|
+
* - Controls whether account
|
|
83
|
+
* information (address, channel identifiers for ICAs) should be automatically
|
|
84
|
+
* published to vstorage
|
|
85
|
+
*/
|
|
86
|
+
publishAccountInfo?: boolean | undefined;
|
|
87
|
+
};
|
|
80
88
|
export type OrchestrationTools = Omit<ReturnType<typeof provideOrchestration>, "zone">;
|
|
81
89
|
import type { Baggage } from '@agoric/vat-data';
|
|
82
90
|
import type { Zone } from '@agoric/zone';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AAqDO,0CANI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BAiGR,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;sBA1CD,CAAC;;;;;;;;;;;;;;;;;;;;;sBAuHykY,CAAC;;;;;;;;;;;;;;;;;;;;EA5C1lY;AA+BM,kCAfgC,EAAE,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,EAGhC,EAAE,SAFM,mBAAmB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;CACvB,EACQ,CAAC,cACH,CACN,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EACZ,WAAW,EAAE,EAAE,EACf,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,kBAAkB,KACtB,OAAO,CAAC,CAAC,CAAC,SACP,qBAAqB,GACnB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAczE;kCArMU;IACR,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,oBAAoB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,OAAO,WAAW,CAAC,CAAC;IAClC,YAAY,EAAE,OAAO,YAAY,CAAC,CAAC;IACnC,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;;;;;;;;;iCAwJU,IAAI,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,MAAM,CAAC;6BAtKzC,kBAAkB;0BAGrB,cAAc;gCALR,gCAAgC;4BAIpC,aAAa;6CAEI,2BAA2B;kCALtC,cAAc;6BAEnB,cAAc"}
|
|
@@ -14,7 +14,7 @@ import { makeZcfTools } from './zcf-tools.js';
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
17
|
-
* @import {TimerService
|
|
17
|
+
* @import {TimerService} from '@agoric/time';
|
|
18
18
|
* @import {Baggage} from '@agoric/vat-data';
|
|
19
19
|
* @import {NameHub} from '@agoric/vats';
|
|
20
20
|
* @import {Remote} from '@agoric/vow';
|
|
@@ -26,12 +26,19 @@ import { makeZcfTools } from './zcf-tools.js';
|
|
|
26
26
|
* @typedef {{
|
|
27
27
|
* localchain: Remote<LocalChain>;
|
|
28
28
|
* orchestrationService: Remote<CosmosInterchainService>;
|
|
29
|
-
* storageNode
|
|
29
|
+
* storageNode?: Remote<StorageNode>;
|
|
30
30
|
* timerService: Remote<TimerService>;
|
|
31
31
|
* agoricNames: Remote<NameHub>;
|
|
32
32
|
* }} OrchestrationPowers
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {object} WithOrchestrationOpts
|
|
37
|
+
* @property {boolean} [publishAccountInfo] - Controls whether account
|
|
38
|
+
* information (address, channel identifiers for ICAs) should be automatically
|
|
39
|
+
* published to vstorage
|
|
40
|
+
*/
|
|
41
|
+
|
|
35
42
|
/**
|
|
36
43
|
* Helper that a contract start function can use to set up the objects needed
|
|
37
44
|
* for orchestration.
|
|
@@ -144,7 +151,6 @@ export const provideOrchestration = (
|
|
|
144
151
|
makeOrchestrationFacade({
|
|
145
152
|
zone,
|
|
146
153
|
zcf,
|
|
147
|
-
makeRecorderKit,
|
|
148
154
|
makeOrchestrator,
|
|
149
155
|
asyncFlowTools,
|
|
150
156
|
vowTools,
|
|
@@ -199,16 +205,19 @@ harden(provideOrchestration);
|
|
|
199
205
|
* zone: Zone,
|
|
200
206
|
* tools: OrchestrationTools,
|
|
201
207
|
* ) => Promise<R>} contractFn
|
|
208
|
+
* @param {WithOrchestrationOpts} [opts]
|
|
202
209
|
* @returns {(zcf: ZCF<CT>, privateArgs: PA, baggage: Baggage) => Promise<R>} a
|
|
203
210
|
* Zoe start function
|
|
204
211
|
*/
|
|
205
212
|
export const withOrchestration =
|
|
206
|
-
contractFn => async (zcf, privateArgs, baggage) => {
|
|
213
|
+
(contractFn, opts) => async (zcf, privateArgs, baggage) => {
|
|
214
|
+
const { marshaller, ...allOrchPowers } = privateArgs;
|
|
215
|
+
const { storageNode: _, ...requiredOrchPowers } = allOrchPowers;
|
|
207
216
|
const { zone, ...tools } = provideOrchestration(
|
|
208
217
|
zcf,
|
|
209
218
|
baggage,
|
|
210
|
-
|
|
211
|
-
|
|
219
|
+
opts?.publishAccountInfo ? allOrchPowers : requiredOrchPowers,
|
|
220
|
+
marshaller,
|
|
212
221
|
);
|
|
213
222
|
return contractFn(zcf, privateArgs, zone, tools);
|
|
214
223
|
};
|