@agoric/orchestration 0.1.1-dev-097ef82.0 → 0.1.1-dev-70bc20f.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/orchestration",
3
- "version": "0.1.1-dev-097ef82.0+097ef82",
3
+ "version": "0.1.1-dev-70bc20f.0+70bc20f",
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-097ef82.0+097ef82",
37
- "@agoric/cosmic-proto": "0.4.1-dev-097ef82.0+097ef82",
38
- "@agoric/ertp": "0.16.3-dev-097ef82.0+097ef82",
39
- "@agoric/internal": "0.3.3-dev-097ef82.0+097ef82",
40
- "@agoric/network": "0.1.1-dev-097ef82.0+097ef82",
41
- "@agoric/notifier": "0.6.3-dev-097ef82.0+097ef82",
42
- "@agoric/store": "0.9.3-dev-097ef82.0+097ef82",
43
- "@agoric/time": "0.3.3-dev-097ef82.0+097ef82",
44
- "@agoric/vat-data": "0.5.3-dev-097ef82.0+097ef82",
45
- "@agoric/vats": "0.15.2-dev-097ef82.0+097ef82",
46
- "@agoric/vow": "0.1.1-dev-097ef82.0+097ef82",
47
- "@agoric/zoe": "0.26.3-dev-097ef82.0+097ef82",
48
- "@agoric/zone": "0.2.3-dev-097ef82.0+097ef82",
36
+ "@agoric/async-flow": "0.1.1-dev-70bc20f.0+70bc20f",
37
+ "@agoric/cosmic-proto": "0.4.1-dev-70bc20f.0+70bc20f",
38
+ "@agoric/ertp": "0.16.3-dev-70bc20f.0+70bc20f",
39
+ "@agoric/internal": "0.3.3-dev-70bc20f.0+70bc20f",
40
+ "@agoric/network": "0.1.1-dev-70bc20f.0+70bc20f",
41
+ "@agoric/notifier": "0.6.3-dev-70bc20f.0+70bc20f",
42
+ "@agoric/store": "0.9.3-dev-70bc20f.0+70bc20f",
43
+ "@agoric/time": "0.3.3-dev-70bc20f.0+70bc20f",
44
+ "@agoric/vat-data": "0.5.3-dev-70bc20f.0+70bc20f",
45
+ "@agoric/vats": "0.15.2-dev-70bc20f.0+70bc20f",
46
+ "@agoric/vow": "0.1.1-dev-70bc20f.0+70bc20f",
47
+ "@agoric/zoe": "0.26.3-dev-70bc20f.0+70bc20f",
48
+ "@agoric/zone": "0.2.3-dev-70bc20f.0+70bc20f",
49
49
  "@endo/base64": "^1.0.7",
50
50
  "@endo/errors": "^1.2.5",
51
51
  "@endo/far": "^1.1.5",
@@ -54,7 +54,7 @@
54
54
  "@noble/hashes": "^1.5.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@agoric/swingset-liveslots": "0.10.3-dev-097ef82.0+097ef82",
57
+ "@agoric/swingset-liveslots": "0.10.3-dev-70bc20f.0+70bc20f",
58
58
  "@chain-registry/client": "^1.47.4",
59
59
  "@cosmjs/amino": "^0.32.3",
60
60
  "@cosmjs/proto-signing": "^0.32.3",
@@ -94,5 +94,5 @@
94
94
  "typeCoverage": {
95
95
  "atLeast": 97.3
96
96
  },
97
- "gitHead": "097ef82273611476a5171bd669ab75274e7adf3a"
97
+ "gitHead": "70bc20f3be992ae1f677f0770aa03a3425967f61"
98
98
  }
@@ -1,5 +1,6 @@
1
1
  export function prepareCombineInvitationMakers(zone: Zone, ...interfaceGuards: import("@endo/patterns").InterfaceGuard[]): <IM extends InvitationMakers[]>(...invitationMakers: IM) => IM[number];
2
2
  export type MakeCombineInvitationMakers = ReturnType<typeof prepareCombineInvitationMakers>;
3
+ export type CombinedInvitationMakers = ReturnType<MakeCombineInvitationMakers>;
3
4
  import type { Zone } from '@agoric/zone';
4
5
  import type { InvitationMakers } from '@agoric/smart-wallet/src/types.js';
5
6
  //# sourceMappingURL=combine-invitation-makers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combine-invitation-makers.d.ts","sourceRoot":"","sources":["combine-invitation-makers.js"],"names":[],"mappings":"AAmBO,qDAHI,IAAI,sBACJ,OAAO,gBAAgB,EAAE,cAAc,EAAE,IAchB,EAAE,SAAtB,gBAAgB,EAAG,uBACtB,EAAE,KACA,EAAE,CAAC,MAAM,CAAC,CAiBxB;0CAEa,UAAU,CAAC,OAAO,8BAA8B,CAAC;0BA3CxC,cAAc;sCADF,mCAAmC"}
1
+ {"version":3,"file":"combine-invitation-makers.d.ts","sourceRoot":"","sources":["combine-invitation-makers.js"],"names":[],"mappings":"AAwBO,qDAHI,IAAI,sBACJ,OAAO,gBAAgB,EAAE,cAAc,EAAE,IAchB,EAAE,SAAtB,gBAAgB,EAAG,uBACtB,EAAE,KACA,EAAE,CAAC,MAAM,CAAC,CAiBxB;0CAEa,UAAU,CAAC,OAAO,8BAA8B,CAAC;uCACjD,UAAU,CAAC,2BAA2B,CAAC;0BAjD9B,cAAc;sCADF,mCAAmC"}
@@ -13,6 +13,11 @@ import { getMethodNames } from '@agoric/internal';
13
13
  // TODO use a helper from Endo https://github.com/endojs/endo/issues/2448
14
14
  /**
15
15
  * Takes two or more InvitationMaker exos and combines them into a new one.
16
+ * Combine with `publicTopics` to form a {@link ContinuingOfferResult} that can
17
+ * be returned to a smart-wallet client.
18
+ *
19
+ * Useful for writing your own invitationMakers while preserving
20
+ * platform-provided ones like `Delegate`, `Transfer`, `Send`.
16
21
  *
17
22
  * @param {Zone} zone
18
23
  * @param {import('@endo/patterns').InterfaceGuard[]} interfaceGuards
@@ -51,3 +56,4 @@ export const prepareCombineInvitationMakers = (zone, ...interfaceGuards) => {
51
56
  };
52
57
 
53
58
  /** @typedef {ReturnType<typeof prepareCombineInvitationMakers>} MakeCombineInvitationMakers */
59
+ /** @typedef {ReturnType<MakeCombineInvitationMakers>} CombinedInvitationMakers */
@@ -1 +1 @@
1
- {"version":3,"file":"portfolio-holder-kit.d.ts","sourceRoot":"","sources":["portfolio-holder-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AAC,KAC9D,UAAU,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAKzE;mCAhNY;IACR,QAAQ,EAAE,SAAS,MAAM,EAAE,cAAc,qBAAqB,GAAG,CAAC,CAAC,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,MAAM,EAAE,oBAAoB,OAAO,CAAC,CAAC,CAAC;CAC9D;kCA8MU,UAAU,CAAC,OAAO,sBAAsB,CAAC;8BACzC,UAAU,CAAC,mBAAmB,CAAC;0BAvNtB,cAAc;8BAFV,aAAa;AAqBxC;;;;;;GAMG;AACH,iDAHW,IAAI,mBACJ,QAAQ;;QAkDX;;;;;;WAMG;iBALsB,EAAE,SAAb,OAAO,EAAG,aACb,MAAM,UACN,MAAM,oCAEJ,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;;;;;;;;gBAL7C;;;;;;mBAMG;yBALsB,EAAE,SAAb,OAAO,EAAG,aACb,MAAM,UACN,MAAM,oCAEJ,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;;;;;;QA+B7C;;;;WAIG;8BAHQ,MAAM,WACN,cAAc,qBAAqB,GAAG,CAAC,CAAC,eACxC,oBAAoB,OAAO,CAAC;QAgBvC;;WAEG;8BADQ,MAAM;;GAQxB;0CAzI0F,uBAAuB;mCAL1E,oBAAoB;8BACjC,eAAe;yCAEJ,2CAA2C;2CAEU,uBAAuB"}
@@ -13,7 +13,7 @@ const { fromEntries } = Object;
13
13
  * @import {VowTools} from '@agoric/vow';
14
14
  * @import {ResolvedPublicTopic} from '@agoric/zoe/src/contractSupport/topics.js';
15
15
  * @import {Zone} from '@agoric/zone';
16
- * @import {OrchestrationAccount, OrchestrationAccountI} from '@agoric/orchestration';
16
+ * @import {OrchestrationAccount, OrchestrationAccountI, MakeCombineInvitationMakers} from '@agoric/orchestration';
17
17
  */
18
18
 
19
19
  /**
@@ -156,8 +156,65 @@ const preparePortfolioHolderKit = (zone, { asVow, when }) => {
156
156
  * A portfolio holder stores two or more OrchestrationAccounts and combines
157
157
  * ContinuingOfferResult's from each into a single result.
158
158
  *
159
- * XXX consider an interface for extending the exo maker with additional
160
- * invitation makers.
159
+ * The invitationMakers can be accessed via the `Proxy` invitationMaker, which
160
+ * calls out to other invitationMakers.
161
+ *
162
+ * See {@link MakeCombineInvitationMakers} for an exo that allows a developer to
163
+ * define extra invitationMakers to combine with platform-provided ones.
164
+ *
165
+ * @example
166
+ *
167
+ * ```js
168
+ * // in contract start/prepare
169
+ * const makePortfolioHolder = preparePortfolioHolder(
170
+ * rootZone.subZone('portfolio'),
171
+ * vowTools,
172
+ * );
173
+ *
174
+ * // in a flow
175
+ * const accounts = {
176
+ * cosmoshub: await cosmosChain.makeAccount(),
177
+ * agoric: await agoricChain.makeAccount(),
178
+ * };
179
+ * const accountEntries = harden(Object.entries(accounts));
180
+ * const publicTopicEntries = harden(
181
+ * await Promise.all(
182
+ * Object.entries(accounts).map(async ([chainName, holder]) => {
183
+ * const { account } = await E(holder).getPublicTopics();
184
+ * return [chainName, account];
185
+ * }),
186
+ * ),
187
+ * );
188
+ * const holder = makePortfolioHolder(accountEntries, publicTopicEntries);
189
+ *
190
+ * // return ContinuingOfferResult to client
191
+ * return E(holder).asContinuingOffer();
192
+ *
193
+ * const { invitationMakers } = await E(holder).asContinuingOffer();
194
+ *
195
+ * // with invitationArgs
196
+ * const delegateInv = await E(invitationMakers).Proxying(
197
+ * 'cosmoshub',
198
+ * 'Delegate',
199
+ * [
200
+ * {
201
+ * value: 'cosmos1valoper',
202
+ * chainId: 'cosmoshub-99',
203
+ * encoding: 'bech32',
204
+ * },
205
+ * {
206
+ * denom: 'uatom',
207
+ * value: 10n,
208
+ * },
209
+ * ],
210
+ * );
211
+ *
212
+ * // without invitationArgs
213
+ * const transferInv = await E(invitationMakers).Proxying(
214
+ * 'cosmoshub',
215
+ * 'Transfer',
216
+ * );
217
+ * ```
161
218
  *
162
219
  * @param {Zone} zone
163
220
  * @param {VowTools} vowTools
package/src/types.d.ts CHANGED
@@ -2,13 +2,15 @@
2
2
  export type * from './chain-info.js';
3
3
  export type * from './cosmos-api.js';
4
4
  export type * from './ethereum-api.js';
5
+ export type * from './exos/chain-hub.js';
6
+ export type * from './exos/combine-invitation-makers.js';
7
+ export type * from './exos/cosmos-interchain-service.js';
8
+ export type * from './exos/exo-interfaces.js';
5
9
  export type * from './exos/ica-account-kit.js';
6
- export type * from './exos/local-chain-facade.js';
7
10
  export type * from './exos/icq-connection-kit.js';
8
- export type * from './exos/exo-interfaces.js';
11
+ export type * from './exos/local-chain-facade.js';
12
+ export type * from './exos/portfolio-holder-kit.js';
9
13
  export type * from './orchestration-api.js';
10
- export type * from './exos/cosmos-interchain-service.js';
11
- export type * from './exos/chain-hub.js';
12
14
  export type * from './vat-orchestration.js';
13
15
  /**
14
16
  * ({@link ZCF})-like tools for use in {@link OrchestrationFlow}s.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,wBAAwB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,mBAAmB,EAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAChD,eAAe,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACxC,cAAc,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACvC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,qCAAqC,CAAC;AACzD,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,gCAAgC,CAAC;AACpD,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,wBAAwB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,mBAAmB,EAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAChD,eAAe,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACxC,cAAc,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACvC"}
package/src/types.ts CHANGED
@@ -3,13 +3,15 @@
3
3
  export type * from './chain-info.js';
4
4
  export type * from './cosmos-api.js';
5
5
  export type * from './ethereum-api.js';
6
+ export type * from './exos/chain-hub.js';
7
+ export type * from './exos/combine-invitation-makers.js';
8
+ export type * from './exos/cosmos-interchain-service.js';
9
+ export type * from './exos/exo-interfaces.js';
6
10
  export type * from './exos/ica-account-kit.js';
7
- export type * from './exos/local-chain-facade.js';
8
11
  export type * from './exos/icq-connection-kit.js';
9
- export type * from './exos/exo-interfaces.js';
12
+ export type * from './exos/local-chain-facade.js';
13
+ export type * from './exos/portfolio-holder-kit.js';
10
14
  export type * from './orchestration-api.js';
11
- export type * from './exos/cosmos-interchain-service.js';
12
- export type * from './exos/chain-hub.js';
13
15
  export type * from './vat-orchestration.js';
14
16
 
15
17
  /**