@agoric/orchestration 0.1.1-dev-f908f89.0 → 0.1.1-dev-a035bbe.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 -15
- package/src/examples/sendAnywhere.contract.d.ts.map +1 -1
- package/src/examples/sendAnywhere.contract.js +7 -27
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +13 -32
- package/src/examples/unbondExample.contract.d.ts.map +1 -1
- package/src/examples/unbondExample.contract.js +11 -24
- package/src/facade.d.ts +33 -1
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +15 -7
- package/src/utils/start-helper.d.ts +2365 -0
- package/src/utils/start-helper.d.ts.map +1 -0
- package/src/utils/start-helper.js +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AAqCO,0CALI,GAAG,kCAEH,mBAAmB,cACnB,UAAU;;;;;;;;;;kDAsCkmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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mN,kBAAkB;4BAEnB,aAAa;kCAHK,cAAc;6BAE/B,cAAc"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { prepareAsyncFlowTools } from '@agoric/async-flow';
|
|
2
|
+
import { prepareVowTools } from '@agoric/vow';
|
|
3
|
+
import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
4
|
+
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
5
|
+
import { prepareLocalChainAccountKit } from '../exos/local-chain-account-kit.js';
|
|
6
|
+
import { makeOrchestrationFacade } from '../facade.js';
|
|
7
|
+
import { makeChainHub } from './chainHub.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @import {PromiseKit} from '@endo/promise-kit'
|
|
11
|
+
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
12
|
+
* @import {TimerService, TimerBrand} from '@agoric/time';
|
|
13
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
14
|
+
* @import {NameHub} from '@agoric/vats';
|
|
15
|
+
* @import {Remote} from '@agoric/vow';
|
|
16
|
+
* @import {OrchestrationService} from '../service.js';
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {{
|
|
21
|
+
* localchain: Remote<LocalChain>;
|
|
22
|
+
* orchestrationService: Remote<OrchestrationService>;
|
|
23
|
+
* storageNode: Remote<StorageNode>;
|
|
24
|
+
* timerService: Remote<TimerService>;
|
|
25
|
+
* agoricNames: Remote<NameHub>;
|
|
26
|
+
* }} OrchestrationPowers
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Helper that a contract start function can use to set up the objects needed
|
|
31
|
+
* for orchestration.
|
|
32
|
+
*
|
|
33
|
+
* @param {ZCF} zcf
|
|
34
|
+
* @param {Baggage} baggage
|
|
35
|
+
* @param {OrchestrationPowers} remotePowers
|
|
36
|
+
* @param {Marshaller} marshaller
|
|
37
|
+
*/
|
|
38
|
+
export const provideOrchestration = (
|
|
39
|
+
zcf,
|
|
40
|
+
baggage,
|
|
41
|
+
remotePowers,
|
|
42
|
+
marshaller,
|
|
43
|
+
) => {
|
|
44
|
+
const zone = makeDurableZone(baggage);
|
|
45
|
+
|
|
46
|
+
const chainHub = makeChainHub(remotePowers.agoricNames);
|
|
47
|
+
|
|
48
|
+
const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller);
|
|
49
|
+
const makeLocalChainAccountKit = prepareLocalChainAccountKit(
|
|
50
|
+
zone,
|
|
51
|
+
makeRecorderKit,
|
|
52
|
+
zcf,
|
|
53
|
+
remotePowers.timerService,
|
|
54
|
+
chainHub,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const vowTools = prepareVowTools(zone.subZone('vows'));
|
|
58
|
+
const asyncFlowTools = prepareAsyncFlowTools(zone.subZone('asyncFlow'), {
|
|
59
|
+
vowTools,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const facade = makeOrchestrationFacade({
|
|
63
|
+
zcf,
|
|
64
|
+
zone,
|
|
65
|
+
chainHub,
|
|
66
|
+
makeLocalChainAccountKit,
|
|
67
|
+
makeRecorderKit,
|
|
68
|
+
asyncFlowTools,
|
|
69
|
+
...remotePowers,
|
|
70
|
+
});
|
|
71
|
+
return { ...facade, chainHub, zone };
|
|
72
|
+
};
|
|
73
|
+
harden(provideOrchestration);
|