@agoric/orchestration 0.1.1-dev-217005a.0 → 0.1.1-dev-b196804.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 (54) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -1
  3. package/package.json +16 -15
  4. package/src/examples/sendAnywhere.contract.d.ts +12 -7
  5. package/src/examples/sendAnywhere.contract.d.ts.map +1 -1
  6. package/src/examples/sendAnywhere.contract.js +22 -17
  7. package/src/examples/stakeBld.contract.js +1 -1
  8. package/src/examples/stakeIca.contract.d.ts +4 -4
  9. package/src/examples/stakeIca.contract.d.ts.map +1 -1
  10. package/src/examples/stakeIca.contract.js +9 -4
  11. package/src/examples/swapExample.contract.d.ts +6 -12
  12. package/src/examples/swapExample.contract.d.ts.map +1 -1
  13. package/src/examples/swapExample.contract.js +25 -43
  14. package/src/examples/unbondExample.contract.d.ts +6 -8
  15. package/src/examples/unbondExample.contract.d.ts.map +1 -1
  16. package/src/examples/unbondExample.contract.js +26 -43
  17. package/src/exos/chain-hub.d.ts +3 -3
  18. package/src/exos/chain-hub.d.ts.map +1 -1
  19. package/src/exos/chain-hub.js +93 -44
  20. package/src/exos/cosmos-interchain-service.d.ts +43 -0
  21. package/src/exos/cosmos-interchain-service.d.ts.map +1 -0
  22. package/src/{service.js → exos/cosmos-interchain-service.js} +21 -18
  23. package/src/exos/local-chain-facade.d.ts +2 -2
  24. package/src/exos/local-chain-facade.d.ts.map +1 -1
  25. package/src/exos/local-chain-facade.js +2 -2
  26. package/src/exos/orchestrator.d.ts +2 -2
  27. package/src/exos/orchestrator.d.ts.map +1 -1
  28. package/src/exos/orchestrator.js +2 -2
  29. package/src/exos/remote-chain-facade.d.ts +2 -2
  30. package/src/exos/remote-chain-facade.d.ts.map +1 -1
  31. package/src/exos/remote-chain-facade.js +2 -2
  32. package/src/facade.d.ts +2 -2
  33. package/src/facade.d.ts.map +1 -1
  34. package/src/facade.js +2 -2
  35. package/src/proposals/orchestration-proposal.d.ts +2 -11
  36. package/src/proposals/orchestration-proposal.d.ts.map +1 -1
  37. package/src/proposals/orchestration-proposal.js +8 -31
  38. package/src/proposals/start-stakeAtom.d.ts +3 -3
  39. package/src/proposals/start-stakeAtom.d.ts.map +1 -1
  40. package/src/proposals/start-stakeAtom.js +9 -6
  41. package/src/proposals/start-stakeOsmo.d.ts +3 -3
  42. package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
  43. package/src/proposals/start-stakeOsmo.js +9 -6
  44. package/src/types.d.ts +1 -1
  45. package/src/types.d.ts.map +1 -1
  46. package/src/types.ts +1 -1
  47. package/src/utils/start-helper.d.ts +9 -3
  48. package/src/utils/start-helper.d.ts.map +1 -1
  49. package/src/utils/start-helper.js +56 -13
  50. package/src/vat-orchestration.d.ts +7 -49
  51. package/src/vat-orchestration.d.ts.map +1 -1
  52. package/src/vat-orchestration.js +7 -7
  53. package/src/service.d.ts +0 -97
  54. package/src/service.d.ts.map +0 -1
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from "./src/types.js";
2
- export * from "./src/service.js";
2
+ export * from "./src/exos/cosmos-interchain-service.js";
3
3
  export * from "./src/typeGuards.js";
4
4
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -3,5 +3,5 @@
3
3
  /// <reference types="@agoric/zoe/exported" />
4
4
 
5
5
  export * from './src/types.js';
6
- export * from './src/service.js';
6
+ export * from './src/exos/cosmos-interchain-service.js';
7
7
  export * from './src/typeGuards.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/orchestration",
3
- "version": "0.1.1-dev-217005a.0+217005a",
3
+ "version": "0.1.1-dev-b196804.0+b196804",
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-217005a.0+217005a",
37
- "@agoric/cosmic-proto": "0.4.1-dev-217005a.0+217005a",
38
- "@agoric/ertp": "0.16.3-dev-217005a.0+217005a",
39
- "@agoric/internal": "0.3.3-dev-217005a.0+217005a",
40
- "@agoric/network": "0.1.1-dev-217005a.0+217005a",
41
- "@agoric/notifier": "0.6.3-dev-217005a.0+217005a",
42
- "@agoric/store": "0.9.3-dev-217005a.0+217005a",
43
- "@agoric/time": "0.3.3-dev-217005a.0+217005a",
44
- "@agoric/vat-data": "0.5.3-dev-217005a.0+217005a",
45
- "@agoric/vats": "0.15.2-dev-217005a.0+217005a",
46
- "@agoric/vow": "0.1.1-dev-217005a.0+217005a",
47
- "@agoric/zoe": "0.26.3-dev-217005a.0+217005a",
48
- "@agoric/zone": "0.2.3-dev-217005a.0+217005a",
36
+ "@agoric/async-flow": "0.1.1-dev-b196804.0+b196804",
37
+ "@agoric/cosmic-proto": "0.4.1-dev-b196804.0+b196804",
38
+ "@agoric/ertp": "0.16.3-dev-b196804.0+b196804",
39
+ "@agoric/internal": "0.3.3-dev-b196804.0+b196804",
40
+ "@agoric/network": "0.1.1-dev-b196804.0+b196804",
41
+ "@agoric/notifier": "0.6.3-dev-b196804.0+b196804",
42
+ "@agoric/store": "0.9.3-dev-b196804.0+b196804",
43
+ "@agoric/time": "0.3.3-dev-b196804.0+b196804",
44
+ "@agoric/vat-data": "0.5.3-dev-b196804.0+b196804",
45
+ "@agoric/vats": "0.15.2-dev-b196804.0+b196804",
46
+ "@agoric/vow": "0.1.1-dev-b196804.0+b196804",
47
+ "@agoric/zoe": "0.26.3-dev-b196804.0+b196804",
48
+ "@agoric/zone": "0.2.3-dev-b196804.0+b196804",
49
49
  "@endo/base64": "^1.0.5",
50
50
  "@endo/errors": "^1.2.2",
51
51
  "@endo/far": "^1.1.2",
@@ -53,6 +53,7 @@
53
53
  "@endo/patterns": "^1.4.0"
54
54
  },
55
55
  "devDependencies": {
56
+ "@agoric/swingset-liveslots": "0.10.3-dev-b196804.0+b196804",
56
57
  "@chain-registry/client": "^1.47.4",
57
58
  "@cosmjs/amino": "^0.32.3",
58
59
  "@cosmjs/proto-signing": "^0.32.3",
@@ -90,5 +91,5 @@
90
91
  "typeCoverage": {
91
92
  "atLeast": 97.1
92
93
  },
93
- "gitHead": "217005a921dcac6928c999e6bfe06330a5947ac5"
94
+ "gitHead": "b196804c28fe5ed5f742c0e23a4d223b7fc0a164"
94
95
  }
@@ -1,7 +1,7 @@
1
1
  export const SingleAmountRecord: import("@endo/patterns").Matcher;
2
- export function start(zcf: ZCF, privateArgs: OrchestrationPowers & {
2
+ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: OrchestrationPowers & {
3
3
  marshaller: Marshaller;
4
- }, baggage: Baggage): Promise<{
4
+ }, baggage: import("@agoric/vat-data").Baggage) => Promise<{
5
5
  publicFacet: import("@endo/exo").Guarded<{
6
6
  makeSendInvitation(): Promise<Invitation<unknown, never>>;
7
7
  }>;
@@ -10,22 +10,27 @@ export function start(zcf: ZCF, privateArgs: OrchestrationPowers & {
10
10
  * @param {CosmosChainInfo} chainInfo
11
11
  * @param {IBCConnectionInfo} connectionInfo
12
12
  */
13
- addChain(chainInfo: CosmosChainInfo, connectionInfo: IBCConnectionInfo): Promise<string>;
13
+ addChain(chainInfo: Readonly<{
14
+ chainId: string;
15
+ connections?: Record<string, IBCConnectionInfo>;
16
+ icqEnabled?: boolean;
17
+ stakingTokens?: Readonly<Array<{
18
+ denom: string;
19
+ }>>;
20
+ }>, connectionInfo: IBCConnectionInfo): Promise<string>;
14
21
  }>;
15
22
  }>;
16
23
  export type OrchestrationPowers = {
17
24
  localchain: Remote<LocalChain>;
18
- orchestrationService: Remote<OrchestrationService>;
25
+ orchestrationService: Remote<CosmosInterchainService>;
19
26
  storageNode: Remote<StorageNode>;
20
27
  timerService: Remote<TimerService>;
21
28
  agoricNames: Remote<NameHub>;
22
29
  };
23
- import type { Baggage } from '@agoric/vat-data';
24
- import type { CosmosChainInfo } from '../cosmos-api';
25
30
  import type { IBCConnectionInfo } from '../cosmos-api';
26
31
  import type { LocalChain } from '@agoric/vats/src/localchain.js';
27
32
  import type { Remote } from '@agoric/vow';
28
- import type { OrchestrationService } from '../service.js';
33
+ import type { CosmosInterchainService } from '../exos/cosmos-interchain-service.js';
29
34
  import type { TimerService } from '@agoric/time';
30
35
  import type { NameHub } from '@agoric/vats';
31
36
  //# sourceMappingURL=sendAnywhere.contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAmFA,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;;;QAsDZ;;;WAGG;4BAFQ,eAAe,kBACf,iBAAiB;;GAqBjC;kCAlJY;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;6BAlBsB,kBAAkB;qCAKS,eAAe;uCAAf,eAAe;gCAHvC,gCAAgC;4BAEpC,aAAa;0CAEC,eAAe;kCALvB,cAAc;6BAEnB,cAAc"}
1
+ {"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAoFA,kEAKE;AAwFF;gBAjFiB,UAAU;;;;;;QAwDrB;;;WAGG;;;;;;;;4BADQ,iBAAiB;;GAuBe;kCAtJpC;IACZ,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC;IACnC,oBAAwB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IAC1D,WAAe,EAAE,OAAO,WAAW,CAAC,CAAC;IACrC,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;IACvC,WAAe,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;uCAdiD,eAAe;gCAJvC,gCAAgC;4BAEpC,aAAa;6CAGI,sCAAsC;kCANjD,cAAc;6BAEnB,cAAc"}
@@ -1,32 +1,33 @@
1
+ import { makeStateRecord } from '@agoric/async-flow';
2
+ import { AmountShape } from '@agoric/ertp';
3
+ import { heapVowE } from '@agoric/vow/vat.js';
1
4
  import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js';
2
5
  import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
3
- import { M, mustMatch } from '@endo/patterns';
4
6
  import { E } from '@endo/far';
5
- import { heapVowE } from '@agoric/vow/vat.js';
6
- import { makeStateRecord } from '@agoric/async-flow';
7
- import { AmountShape } from '@agoric/ertp';
8
- import { CosmosChainInfoShape } from '../typeGuards.js';
9
- import { provideOrchestration } from '../utils/start-helper.js';
7
+ import { M, mustMatch } from '@endo/patterns';
10
8
  import { makeResumableAgoricNamesHack } from '../exos/agoric-names-tools.js';
9
+ import { CosmosChainInfoShape } from '../typeGuards.js';
10
+ import { withOrchestration } from '../utils/start-helper.js';
11
11
 
12
12
  const { entries } = Object;
13
13
 
14
14
  /**
15
- * @import {Baggage} from '@agoric/vat-data';
16
15
  * @import {TimerService} from '@agoric/time';
17
16
  * @import {LocalChain} from '@agoric/vats/src/localchain.js';
18
17
  * @import {NameHub} from '@agoric/vats';
19
18
  * @import {Remote} from '@agoric/vow';
19
+ * @import {Zone} from '@agoric/zone';
20
20
  * @import {CosmosChainInfo, IBCConnectionInfo} from '../cosmos-api';
21
- * @import {OrchestrationService} from '../service.js';
21
+ * @import {CosmosInterchainService} from '../exos/cosmos-interchain-service.js';
22
22
  * @import {Orchestrator} from '../types.js'
23
+ * @import {OrchestrationTools} from '../utils/start-helper.js';
23
24
  * @import {OrchestrationAccount} from '../orchestration-api.js'
24
25
  */
25
26
 
26
27
  /**
27
28
  * @typedef {{
28
29
  * localchain: Remote<LocalChain>;
29
- * orchestrationService: Remote<OrchestrationService>;
30
+ * orchestrationService: Remote<CosmosInterchainService>;
30
31
  * storageNode: Remote<StorageNode>;
31
32
  * timerService: Remote<TimerService>;
32
33
  * agoricNames: Remote<NameHub>;
@@ -89,19 +90,21 @@ export const SingleAmountRecord = M.and(
89
90
  );
90
91
 
91
92
  /**
93
+ * Orchestration contract to be wrapped by withOrchestration for Zoe
94
+ *
92
95
  * @param {ZCF} zcf
93
96
  * @param {OrchestrationPowers & {
94
97
  * marshaller: Marshaller;
95
98
  * }} privateArgs
96
- * @param {Baggage} baggage
99
+ * @param {Zone} zone
100
+ * @param {OrchestrationTools} tools
97
101
  */
98
- export const start = async (zcf, privateArgs, baggage) => {
99
- const { chainHub, orchestrate, vowTools, zone } = provideOrchestration(
100
- zcf,
101
- baggage,
102
- privateArgs,
103
- privateArgs.marshaller,
104
- );
102
+ const contract = async (
103
+ zcf,
104
+ privateArgs,
105
+ zone,
106
+ { chainHub, orchestrate, vowTools },
107
+ ) => {
105
108
  const agoricNamesTools = makeResumableAgoricNamesHack(zone, {
106
109
  agoricNames: privateArgs.agoricNames,
107
110
  vowTools,
@@ -171,3 +174,5 @@ export const start = async (zcf, privateArgs, baggage) => {
171
174
 
172
175
  return { publicFacet, creatorFacet };
173
176
  };
177
+
178
+ export const start = withOrchestration(contract);
@@ -47,7 +47,7 @@ export const start = async (zcf, privateArgs, baggage) => {
47
47
  zcf,
48
48
  privateArgs.timerService,
49
49
  vowTools,
50
- makeChainHub(privateArgs.agoricNames),
50
+ makeChainHub(privateArgs.agoricNames, vowTools),
51
51
  );
52
52
 
53
53
  // ----------------
@@ -2,18 +2,18 @@
2
2
  * @import {Baggage} from '@agoric/vat-data';
3
3
  * @import {IBCConnectionID} from '@agoric/vats';
4
4
  * @import {TimerService} from '@agoric/time';
5
- * @import {ICQConnection, OrchestrationService} from '../types.js';
5
+ * @import {ICQConnection, CosmosInterchainService} from '../types.js';
6
6
  */
7
7
  /** @type {ContractMeta<typeof start>} */
8
8
  export const meta: ContractMeta<typeof start>;
9
9
  export const privateArgsShape: {
10
- orchestration: globalThis.Pattern;
10
+ cosmosInterchainService: globalThis.Pattern;
11
11
  storageNode: globalThis.Pattern;
12
12
  marshaller: globalThis.Pattern;
13
13
  timer: globalThis.Pattern;
14
14
  } | undefined;
15
15
  export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
16
- orchestration: OrchestrationService;
16
+ cosmosInterchainService: CosmosInterchainService;
17
17
  storageNode: StorageNode;
18
18
  marshaller: Marshaller;
19
19
  timer: TimerService;
@@ -85,7 +85,7 @@ export type StakeIcaTerms = {
85
85
  icqEnabled: boolean;
86
86
  };
87
87
  export type StakeIcaSF = typeof start;
88
- import type { OrchestrationService } from '../types.js';
88
+ import type { CosmosInterchainService } from '../types.js';
89
89
  import type { TimerService } from '@agoric/time';
90
90
  import type { Baggage } from '@agoric/vat-data';
91
91
  import type { IBCConnectionID } from '@agoric/vats';
@@ -1 +1 @@
1
- {"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AACH;;;;;cAAsD;AAsB/C,2BATI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,aAAiB,EAAE,oBAAoB,CAAC;IACxC,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFjB;4BAnGY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,SAAa,EAAE,MAAM,CAAC;IACtB,UAAc,EAAE,OAAO,CAAC;CACrB;yBA+FU,OAAO,KAAK;0CA3H4B,aAAa;kCADpC,cAAc;6BAFnB,kBAAkB;qCACV,cAAc"}
1
+ {"version":3,"file":"stakeIca.contract.d.ts","sourceRoot":"","sources":["stakeIca.contract.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAelC;AACH;;;;;cAAsD;AAsB/C,2BATI,GAAG,CAAC,aAAa,CAAC,eAClB;IACV,uBAA2B,EAAE,uBAAuB,CAAC;IACrD,WAAe,EAAE,WAAW,CAAC;IAC7B,UAAc,EAAE,UAAU,CAAC;IAC3B,KAAS,EAAE,YAAY,CAAC;CACrB,WACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFjB;4BAxGY;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,gBAAoB,EAAE,eAAe,CAAC;IACtC,sBAA0B,EAAE,eAAe,CAAC;IAC5C,SAAa,EAAE,MAAM,CAAC;IACtB,UAAc,EAAE,OAAO,CAAC;CACrB;yBAoGU,OAAO,KAAK;6CAhI+B,aAAa;kCADvC,cAAc;6BAFnB,kBAAkB;qCACV,cAAc"}
@@ -17,7 +17,7 @@ const trace = makeTracer('StakeIca');
17
17
  * @import {Baggage} from '@agoric/vat-data';
18
18
  * @import {IBCConnectionID} from '@agoric/vats';
19
19
  * @import {TimerService} from '@agoric/time';
20
- * @import {ICQConnection, OrchestrationService} from '../types.js';
20
+ * @import {ICQConnection, CosmosInterchainService} from '../types.js';
21
21
  */
22
22
 
23
23
  /** @type {ContractMeta<typeof start>} */
@@ -30,7 +30,7 @@ export const meta = harden({
30
30
  icqEnabled: M.boolean(),
31
31
  },
32
32
  privateArgsShape: {
33
- orchestration: M.remotable('orchestration'),
33
+ cosmosInterchainService: M.remotable('cosmosInterchainService'),
34
34
  storageNode: StorageNodeShape,
35
35
  marshaller: M.remotable('marshaller'),
36
36
  timer: TimerServiceShape,
@@ -51,7 +51,7 @@ export const privateArgsShape = meta.privateArgsShape;
51
51
  /**
52
52
  * @param {ZCF<StakeIcaTerms>} zcf
53
53
  * @param {{
54
- * orchestration: OrchestrationService;
54
+ * cosmosInterchainService: CosmosInterchainService;
55
55
  * storageNode: StorageNode;
56
56
  * marshaller: Marshaller;
57
57
  * timer: TimerService;
@@ -66,7 +66,12 @@ export const start = async (zcf, privateArgs, baggage) => {
66
66
  bondDenom,
67
67
  icqEnabled,
68
68
  } = zcf.getTerms();
69
- const { orchestration, marshaller, storageNode, timer } = privateArgs;
69
+ const {
70
+ cosmosInterchainService: orchestration,
71
+ marshaller,
72
+ storageNode,
73
+ timer,
74
+ } = privateArgs;
70
75
 
71
76
  const zone = makeDurableZone(baggage);
72
77
 
@@ -4,21 +4,16 @@ export function makeNatAmountShape(brand: Brand, min?: bigint | undefined): {
4
4
  brand: globalThis.Brand;
5
5
  value: import("@endo/patterns").Matcher;
6
6
  };
7
- export function start(zcf: ZCF, privateArgs: {
7
+ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: {
8
8
  agoricNames: Remote<NameHub>;
9
9
  localchain: Remote<LocalChain>;
10
- orchestrationService: Remote<OrchestrationService>;
10
+ orchestrationService: Remote<CosmosInterchainService>;
11
11
  storageNode: Remote<StorageNode>;
12
12
  timerService: Remote<TimerService>;
13
13
  marshaller: Marshaller;
14
- }, baggage: Baggage): Promise<{
15
- publicFacet: {
16
- makeSwapAndStakeInvitation: () => Promise<Invitation<unknown, {
17
- staked: Amount<"nat">;
18
- validator: CosmosValidatorAddress;
19
- }>>;
20
- } & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
21
- makeSwapAndStakeInvitation: () => Promise<Invitation<unknown, {
14
+ }, baggage: import("@agoric/vat-data").Baggage) => Promise<{
15
+ publicFacet: import("@endo/exo").Guarded<{
16
+ makeSwapAndStakeInvitation(): Promise<Invitation<unknown, {
22
17
  staked: Amount<"nat">;
23
18
  validator: CosmosValidatorAddress;
24
19
  }>>;
@@ -27,8 +22,7 @@ export function start(zcf: ZCF, privateArgs: {
27
22
  import type { NameHub } from '@agoric/vats';
28
23
  import type { Remote } from '@agoric/internal';
29
24
  import type { LocalChain } from '@agoric/vats/src/localchain.js';
30
- import type { OrchestrationService } from '../service.js';
25
+ import type { CosmosInterchainService } from '../exos/cosmos-interchain-service.js';
31
26
  import type { TimerService } from '@agoric/time';
32
- import type { Baggage } from '@agoric/vat-data';
33
27
  import type { CosmosValidatorAddress } from '../types.js';
34
28
  //# sourceMappingURL=swapExample.contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AAoEA,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;;;GAsBhE;6BA1IyB,cAAc;4BAHf,kBAAkB;gCADd,gCAAgC;0CAEtB,eAAe;kCAHvB,cAAc;6BAInB,kBAAkB;4CALuB,aAAa"}
1
+ {"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AAoEA,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAWnC;AASK,0CAHI,KAAK;;;EAIsC;AA+CtD;iBAxCkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;kBAClB,OAAO,YAAY,CAAC;gBACtB,UAAU;;;;oBAYV,MAAM,CAAC,KAAK,CAAC;uBAAa,sBAAsB;;;GAuBhB;6BA1HvB,cAAc;4BAFf,kBAAkB;gCADd,gCAAgC;6CAEnB,sCAAsC;kCAHjD,cAAc;4CADsB,aAAa"}
@@ -1,20 +1,20 @@
1
1
  import { StorageNodeShape } from '@agoric/internal';
2
2
  import { TimerServiceShape } from '@agoric/time';
3
3
  import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js';
4
- import { Far } from '@endo/far';
5
4
  import { deeplyFulfilled } from '@endo/marshal';
6
5
  import { M, objectMap } from '@endo/patterns';
7
6
  import { orcUtils } from '../utils/orc.js';
8
- import { provideOrchestration } from '../utils/start-helper.js';
7
+ import { withOrchestration } from '../utils/start-helper.js';
9
8
 
10
9
  /**
11
10
  * @import {Orchestrator, IcaAccount, CosmosValidatorAddress} from '../types.js'
12
11
  * @import {TimerService} from '@agoric/time';
13
12
  * @import {LocalChain} from '@agoric/vats/src/localchain.js';
14
13
  * @import {Remote} from '@agoric/internal';
15
- * @import {OrchestrationService} from '../service.js';
16
- * @import {Baggage} from '@agoric/vat-data'
14
+ * @import {CosmosInterchainService} from '../exos/cosmos-interchain-service.js';
17
15
  * @import {NameHub} from '@agoric/vats';
16
+ * @import {Zone} from '@agoric/zone';
17
+ * @import {OrchestrationTools} from '../utils/start-helper.js';
18
18
  */
19
19
 
20
20
  /**
@@ -90,40 +90,21 @@ export const makeNatAmountShape = (brand, min) =>
90
90
  harden({ brand, value: min ? M.gte(min) : M.nat() });
91
91
 
92
92
  /**
93
+ * Orchestration contract to be wrapped by withOrchestration for Zoe
94
+ *
93
95
  * @param {ZCF} zcf
94
96
  * @param {{
95
97
  * agoricNames: Remote<NameHub>;
96
98
  * localchain: Remote<LocalChain>;
97
- * orchestrationService: Remote<OrchestrationService>;
99
+ * orchestrationService: Remote<CosmosInterchainService>;
98
100
  * storageNode: Remote<StorageNode>;
99
101
  * timerService: Remote<TimerService>;
100
102
  * marshaller: Marshaller;
101
103
  * }} privateArgs
102
- * @param {Baggage} baggage
104
+ * @param {Zone} zone
105
+ * @param {OrchestrationTools} tools
103
106
  */
104
- export const start = async (zcf, privateArgs, baggage) => {
105
- const {
106
- agoricNames,
107
- localchain,
108
- orchestrationService,
109
- storageNode,
110
- timerService,
111
- marshaller,
112
- } = privateArgs;
113
-
114
- const { orchestrate } = provideOrchestration(
115
- zcf,
116
- baggage,
117
- {
118
- agoricNames,
119
- localchain,
120
- orchestrationService,
121
- storageNode,
122
- timerService,
123
- },
124
- marshaller,
125
- );
126
-
107
+ const contract = async (zcf, privateArgs, zone, { orchestrate }) => {
127
108
  const { brands } = zcf.getTerms();
128
109
 
129
110
  /** deprecated historical example */
@@ -135,21 +116,22 @@ export const start = async (zcf, privateArgs, baggage) => {
135
116
  */
136
117
  const swapAndStakeHandler = orchestrate('LSTTia', { zcf }, stackAndSwapFn);
137
118
 
138
- const makeSwapAndStakeInvitation = () =>
139
- zcf.makeInvitation(
140
- swapAndStakeHandler,
141
- 'Swap for TIA and stake',
142
- undefined,
143
- harden({
144
- give: { Stable: makeNatAmountShape(brands.Stable, 1n) },
145
- want: {}, // XXX ChainAccount Ownable?
146
- exit: M.any(),
147
- }),
148
- );
149
-
150
- const publicFacet = Far('SwapAndStake Public Facet', {
151
- makeSwapAndStakeInvitation,
119
+ const publicFacet = zone.exo('publicFacet', undefined, {
120
+ makeSwapAndStakeInvitation() {
121
+ return zcf.makeInvitation(
122
+ swapAndStakeHandler,
123
+ 'Swap for TIA and stake',
124
+ undefined,
125
+ harden({
126
+ give: { Stable: makeNatAmountShape(brands.Stable, 1n) },
127
+ want: {}, // XXX ChainAccount Ownable?
128
+ exit: M.any(),
129
+ }),
130
+ );
131
+ },
152
132
  });
153
133
 
154
134
  return harden({ publicFacet });
155
135
  };
136
+
137
+ export const start = withOrchestration(contract);
@@ -1,21 +1,19 @@
1
- export function start(zcf: ZCF, privateArgs: {
1
+ export const start: (zcf: ZCF<Record<string, unknown>>, privateArgs: {
2
2
  agoricNames: Remote<NameHub>;
3
3
  localchain: Remote<LocalChain>;
4
- orchestrationService: Remote<OrchestrationService>;
4
+ orchestrationService: Remote<CosmosInterchainService>;
5
5
  storageNode: Remote<StorageNode>;
6
6
  marshaller: Marshaller;
7
7
  timerService: Remote<TimerService>;
8
- }, baggage: Baggage): Promise<{
9
- publicFacet: {
10
- makeUnbondAndLiquidStakeInvitation: () => Promise<Invitation<unknown, never>>;
11
- } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
12
- makeUnbondAndLiquidStakeInvitation: () => Promise<Invitation<unknown, never>>;
8
+ }, baggage: Baggage) => Promise<{
9
+ publicFacet: import("@endo/exo").Guarded<{
10
+ makeUnbondAndLiquidStakeInvitation(): Promise<Invitation<unknown, never>>;
13
11
  }>;
14
12
  }>;
15
13
  import type { NameHub } from '@agoric/vats';
16
14
  import type { Remote } from '@agoric/internal';
17
15
  import type { LocalChain } from '@agoric/vats/src/localchain.js';
18
- import type { OrchestrationService } from '../service.js';
16
+ import type { CosmosInterchainService } from '../exos/cosmos-interchain-service.js';
19
17
  import type { TimerService } from '@agoric/time';
20
18
  import type { Baggage } from '@agoric/vat-data';
21
19
  //# sourceMappingURL=unbondExample.contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AAwDO,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,UAAc,EAAE,UAAU,CAAC;IAC3B,YAAgB,EAAE,OAAO,YAAY,CAAC,CAAC;CACpC,WACO,OAAO;;;;;;GAkDjB;6BA/FyB,cAAc;4BACf,kBAAkB;gCAFd,gCAAgC;0CAGtB,eAAe;kCALvB,cAAc;6BACnB,kBAAkB"}
1
+ {"version":3,"file":"unbondExample.contract.d.ts","sourceRoot":"","sources":["unbondExample.contract.js"],"names":[],"mappings":"AAuFA;iBArCkB,OAAO,OAAO,CAAC;gBAChB,OAAO,UAAU,CAAC;0BACR,OAAO,uBAAuB,CAAC;iBACxC,OAAO,WAAW,CAAC;gBACpB,UAAU;kBACR,OAAO,YAAY,CAAC;;;;;GAgCU;6BA/EvB,cAAc;4BACf,kBAAkB;gCAFd,gCAAgC;6CAInB,sCAAsC;kCANjD,cAAc;6BACnB,kBAAkB"}
@@ -1,6 +1,5 @@
1
- import { Far } from '@endo/far';
2
1
  import { M } from '@endo/patterns';
3
- import { provideOrchestration } from '../utils/start-helper.js';
2
+ import { withOrchestration } from '../utils/start-helper.js';
4
3
 
5
4
  /**
6
5
  * @import {Orchestrator, IcaAccount, CosmosValidatorAddress} from '../types.js'
@@ -9,7 +8,9 @@ import { provideOrchestration } from '../utils/start-helper.js';
9
8
  * @import {LocalChain} from '@agoric/vats/src/localchain.js';
10
9
  * @import {NameHub} from '@agoric/vats';
11
10
  * @import {Remote} from '@agoric/internal';
12
- * @import {OrchestrationService} from '../service.js';
11
+ * @import {Zone} from '@agoric/zone';
12
+ * @import {CosmosInterchainService} from '../exos/cosmos-interchain-service.js';
13
+ * @import {OrchestrationTools} from '../utils/start-helper.js';
13
14
  */
14
15
 
15
16
  /**
@@ -43,40 +44,21 @@ const unbondAndLiquidStakeFn = async (orch, { zcf }, _seat, _offerArgs) => {
43
44
  };
44
45
 
45
46
  /**
47
+ * Orchestration contract to be wrapped by withOrchestration for Zoe
48
+ *
46
49
  * @param {ZCF} zcf
47
50
  * @param {{
48
51
  * agoricNames: Remote<NameHub>;
49
52
  * localchain: Remote<LocalChain>;
50
- * orchestrationService: Remote<OrchestrationService>;
53
+ * orchestrationService: Remote<CosmosInterchainService>;
51
54
  * storageNode: Remote<StorageNode>;
52
55
  * marshaller: Marshaller;
53
56
  * timerService: Remote<TimerService>;
54
57
  * }} privateArgs
55
- * @param {Baggage} baggage
58
+ * @param {Zone} zone
59
+ * @param {OrchestrationTools} tools
56
60
  */
57
- export const start = async (zcf, privateArgs, baggage) => {
58
- const {
59
- agoricNames,
60
- localchain,
61
- orchestrationService,
62
- storageNode,
63
- marshaller,
64
- timerService,
65
- } = privateArgs;
66
-
67
- const { orchestrate } = provideOrchestration(
68
- zcf,
69
- baggage,
70
- {
71
- agoricNames,
72
- localchain,
73
- orchestrationService,
74
- storageNode,
75
- timerService,
76
- },
77
- marshaller,
78
- );
79
-
61
+ const contract = async (zcf, privateArgs, zone, { orchestrate }) => {
80
62
  /** @type {OfferHandler} */
81
63
  const unbondAndLiquidStake = orchestrate(
82
64
  'LSTTia',
@@ -84,22 +66,23 @@ export const start = async (zcf, privateArgs, baggage) => {
84
66
  unbondAndLiquidStakeFn,
85
67
  );
86
68
 
87
- const makeUnbondAndLiquidStakeInvitation = () =>
88
- zcf.makeInvitation(
89
- unbondAndLiquidStake,
90
- 'Unbond and liquid stake',
91
- undefined,
92
- harden({
93
- // Nothing to give; the funds come from undelegating
94
- give: {},
95
- want: {}, // XXX ChainAccount Ownable?
96
- exit: M.any(),
97
- }),
98
- );
99
-
100
- const publicFacet = Far('SwapAndStake Public Facet', {
101
- makeUnbondAndLiquidStakeInvitation,
69
+ const publicFacet = zone.exo('publicFacet', undefined, {
70
+ makeUnbondAndLiquidStakeInvitation() {
71
+ return zcf.makeInvitation(
72
+ unbondAndLiquidStake,
73
+ 'Unbond and liquid stake',
74
+ undefined,
75
+ harden({
76
+ // Nothing to give; the funds come from undelegating
77
+ give: {},
78
+ want: {}, // XXX ChainAccount Ownable?
79
+ exit: M.any(),
80
+ }),
81
+ );
82
+ },
102
83
  });
103
84
 
104
85
  return harden({ publicFacet });
105
86
  };
87
+
88
+ export const start = withOrchestration(contract);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @import {NameHub} from '@agoric/vats';
3
- * @import {Vow} from '@agoric/vow';
3
+ * @import {Vow, VowTools} from '@agoric/vow';
4
4
  * @import {CosmosChainInfo, IBCConnectionInfo} from '../cosmos-api.js';
5
5
  * @import {ChainInfo, KnownChains} from '../chain-info.js';
6
6
  * @import {Remote} from '@agoric/internal';
@@ -17,7 +17,7 @@ export const CHAIN_KEY: "chain";
17
17
  /** namehub for connection info */
18
18
  export const CONNECTIONS_KEY: "chainConnection";
19
19
  export function connectionKey(chainId1: string, chainId2: string): string;
20
- export function makeChainHub(agoricNames: Remote<NameHub>, zone?: Zone | undefined): import("@endo/exo").Guarded<{
20
+ export function makeChainHub(agoricNames: Remote<NameHub>, vowTools: VowTools): import("@endo/exo").Guarded<{
21
21
  /**
22
22
  * Register a new chain. The name will override a name in well known chain
23
23
  * names.
@@ -68,7 +68,7 @@ export type ActualChainInfo<K extends string> = K extends keyof KnownChains ? Om
68
68
  export type ChainHub = ReturnType<typeof makeChainHub>;
69
69
  import type { NameHub } from '@agoric/vats';
70
70
  import type { Remote } from '@agoric/internal';
71
- import type { Zone } from '@agoric/zone';
71
+ import type { VowTools } from '@agoric/vow';
72
72
  import type { CosmosChainInfo } from '../cosmos-api.js';
73
73
  import type { Vow } from '@agoric/vow';
74
74
  import type { IBCConnectionInfo } from '../cosmos-api.js';
@@ -1 +1 @@
1
- {"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAcA;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH,wCAAwC;AACxC,gCAAiC;AACjC,kCAAkC;AAClC,gDAAiD;AAqB1C,wCAHI,MAAM,YACN,MAAM,UAUhB;AAoCM,0CAHI,OAAO,OAAO,CAAC;IAgBtB;;;;;;;;;;;OAWG;wBAFQ,MAAM,aACN,eAAe;IAK1B;;;;OAIG;iBAHmB,CAAC,SAAV,MAAQ,aACV,CAAC,GACC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;IAoBpC;;;;OAIG;iCAHQ,MAAM,YACN,MAAM,kBACN,iBAAiB;IAO5B;;;;OAIG;8BAHQ,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,UAC5B,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAC1B,IAAI,iBAAiB,CAAC;IAqBnC;;;;;;;;OAQG;2BAPmB,EAAE,SAAX,MAAQ,EACC,EAAE,SAAX,MAAQ,cACV,EAAE,cACF,EAAE,GACA,IACZ,CAAK,eAAe,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAC9D;GAsBP;4BA5LqB,CAAC,SAAV,MAAQ,IACR,CAAC,SAAS,MAAM,WAAW,GACjC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,GACnC,SAAS;uBA0LF,UAAU,CAAC,OAAO,YAAY,CAAC;6BAtMnB,cAAc;4BAIf,kBAAkB;0BACpB,cAAc;qCAHgB,kBAAkB;yBADjD,aAAa;uCACkB,kBAAkB;iCAC9B,kBAAkB;+BAAlB,kBAAkB"}
1
+ {"version":3,"file":"chain-hub.d.ts","sourceRoot":"","sources":["chain-hub.js"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH,wCAAwC;AACxC,gCAAiC;AACjC,kCAAkC;AAClC,gDAAiD;AAqB1C,wCAHI,MAAM,YACN,MAAM,UAUhB;AAoCM,0CAHI,OAAO,OAAO,CAAC,YACf,QAAQ;IAmGf;;;;;;;;;;;OAWG;wBAFQ,MAAM,aACN,eAAe;IAK1B;;;;OAIG;iBAHmB,CAAC,SAAV,MAAQ,aACV,CAAC,GACC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;IAYpC;;;;OAIG;iCAHQ,MAAM,YACN,MAAM,kBACN,iBAAiB;IAO5B;;;;OAIG;8BAHQ,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,UAC5B,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAC1B,IAAI,iBAAiB,CAAC;IAanC;;;;;;;;OAQG;2BAPmB,EAAE,SAAX,MAAQ,EACC,EAAE,SAAX,MAAQ,cACV,EAAE,cACF,EAAE,GACA,IACZ,CAAK,eAAe,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAC9D;GASP;4BAnPqB,CAAC,SAAV,MAAQ,IACR,CAAC,SAAS,MAAM,WAAW,GACjC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,GACnC,SAAS;uBAiPF,UAAU,CAAC,OAAO,YAAY,CAAC;6BA7PnB,cAAc;4BAIf,kBAAkB;8BAHX,aAAa;qCACQ,kBAAkB;yBADvC,aAAa;uCACQ,kBAAkB;iCAC9B,kBAAkB;+BAAlB,kBAAkB"}