@agoric/orchestration 0.1.1-dev-4390d8c.0 → 0.1.1-dev-23e1921.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-4390d8c.0+4390d8c",
3
+ "version": "0.1.1-dev-23e1921.0+23e1921",
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-4390d8c.0+4390d8c",
37
- "@agoric/async-flow": "0.1.1-dev-4390d8c.0+4390d8c",
38
- "@agoric/cosmic-proto": "0.4.1-dev-4390d8c.0+4390d8c",
39
- "@agoric/ertp": "0.16.3-dev-4390d8c.0+4390d8c",
40
- "@agoric/internal": "0.3.3-dev-4390d8c.0+4390d8c",
41
- "@agoric/network": "0.1.1-dev-4390d8c.0+4390d8c",
42
- "@agoric/notifier": "0.6.3-dev-4390d8c.0+4390d8c",
43
- "@agoric/store": "0.9.3-dev-4390d8c.0+4390d8c",
44
- "@agoric/time": "0.3.3-dev-4390d8c.0+4390d8c",
45
- "@agoric/vat-data": "0.5.3-dev-4390d8c.0+4390d8c",
46
- "@agoric/vats": "0.15.2-dev-4390d8c.0+4390d8c",
47
- "@agoric/vow": "0.1.1-dev-4390d8c.0+4390d8c",
48
- "@agoric/zoe": "0.26.3-dev-4390d8c.0+4390d8c",
49
- "@agoric/zone": "0.2.3-dev-4390d8c.0+4390d8c",
36
+ "@agoric/assert": "0.6.1-dev-23e1921.0+23e1921",
37
+ "@agoric/async-flow": "0.1.1-dev-23e1921.0+23e1921",
38
+ "@agoric/cosmic-proto": "0.4.1-dev-23e1921.0+23e1921",
39
+ "@agoric/ertp": "0.16.3-dev-23e1921.0+23e1921",
40
+ "@agoric/internal": "0.3.3-dev-23e1921.0+23e1921",
41
+ "@agoric/network": "0.1.1-dev-23e1921.0+23e1921",
42
+ "@agoric/notifier": "0.6.3-dev-23e1921.0+23e1921",
43
+ "@agoric/store": "0.9.3-dev-23e1921.0+23e1921",
44
+ "@agoric/time": "0.3.3-dev-23e1921.0+23e1921",
45
+ "@agoric/vat-data": "0.5.3-dev-23e1921.0+23e1921",
46
+ "@agoric/vats": "0.15.2-dev-23e1921.0+23e1921",
47
+ "@agoric/vow": "0.1.1-dev-23e1921.0+23e1921",
48
+ "@agoric/zoe": "0.26.3-dev-23e1921.0+23e1921",
49
+ "@agoric/zone": "0.2.3-dev-23e1921.0+23e1921",
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": "4390d8c21fd8ac80a9c83f55d38c52e3f98faa1e"
93
+ "gitHead": "23e1921342fd4d3601b036d69d8791e7437707d2"
94
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAoFA,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;;;QAoDZ;;;WAGG;4BAFQ,eAAe,kBACf,iBAAiB;;GAmBjC;kCAhJY;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;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB,WACO,OAAO;;;;;QAsDZ;;;WAGG;4BAFQ,eAAe,kBACf,iBAAiB;;GAmBjC;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"}
@@ -108,14 +108,16 @@ export const start = async (zcf, privateArgs, baggage) => {
108
108
  vowTools,
109
109
  });
110
110
 
111
- /** @type {{ account: OrchestrationAccount<any> | undefined }} */
112
- const contractState = makeStateRecord({ account: undefined });
111
+ const contractState = makeStateRecord(
112
+ /** @type {{ account: OrchestrationAccount<any> | undefined }} */ {
113
+ account: undefined,
114
+ },
115
+ );
113
116
 
114
117
  /** @type {OfferHandler} */
115
118
  const sendIt = orchestrate(
116
119
  'sendIt',
117
120
  { zcf, agoricNamesTools, contractState },
118
- // eslint-disable-next-line no-shadow -- this `zcf` is enclosed in a membrane
119
121
  sendItFn,
120
122
  );
121
123
 
@@ -10,7 +10,7 @@ export const ChainAccountI: import("@endo/patterns").InterfaceGuard<{
10
10
  close: import("@endo/patterns").MethodGuard;
11
11
  getPurse: import("@endo/patterns").MethodGuard;
12
12
  }>;
13
- export function prepareChainAccountKit(zone: Zone, { watch, when }: VowTools): (chainId: string, port: Port, requestedRemoteAddress: string) => import("@endo/exo").GuardedKit<{
13
+ export function prepareChainAccountKit(zone: Zone, { watch, asVow }: VowTools): (chainId: string, port: Port, requestedRemoteAddress: string) => import("@endo/exo").GuardedKit<{
14
14
  parseTxPacketWatcher: {
15
15
  /** @param {string} ack */
16
16
  onFulfilled(ack: string): string;
@@ -18,31 +18,36 @@ export function prepareChainAccountKit(zone: Zone, { watch, when }: VowTools): (
18
18
  account: {
19
19
  /** @returns {ChainAddress} */
20
20
  getAddress(): ChainAddress;
21
- getBalance(_denom: any): never;
22
- getBalances(): never;
21
+ getBalance(_denom: any): Vow<never>;
22
+ getBalances(): Vow<never>;
23
23
  getLocalAddress(): `/ibc-port/${string}`;
24
24
  getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
25
25
  getPort(): Port;
26
- executeTx(): never;
26
+ executeTx(): Vow<never>;
27
27
  /**
28
28
  * Submit a transaction on behalf of the remote account for execution on
29
29
  * the remote chain.
30
30
  *
31
31
  * @param {AnyJson[]} msgs
32
32
  * @param {Omit<TxBody, 'messages'>} [opts]
33
- * @returns {Promise<string>} - base64 encoded bytes string. Can be
34
- * decoded using the corresponding `Msg*Response` object.
33
+ * @returns {Vow<string>} - base64 encoded bytes string. Can be decoded
34
+ * using the corresponding `Msg*Response` object.
35
35
  * @throws {Error} if packet fails to send or an error is returned
36
36
  */
37
- executeEncodedTx(msgs: AnyJson[], opts?: Omit<TxBody, "messages"> | undefined): Promise<string>;
38
- /** Close the remote account */
39
- close(): Promise<void>;
37
+ executeEncodedTx(msgs: AnyJson[], opts?: Omit<TxBody, "messages"> | undefined): Vow<string>;
38
+ /**
39
+ * Close the remote account
40
+ *
41
+ * @returns {Vow<void>}
42
+ * @throws {Error} if connection is not available or already closed
43
+ */
44
+ close(): Vow<void>;
40
45
  /**
41
46
  * get Purse for a brand to .withdraw() a Payment from the account
42
47
  *
43
48
  * @param {Brand} brand
44
49
  */
45
- getPurse(brand: Brand): Promise<never>;
50
+ getPurse(brand: Brand): Vow<never>;
46
51
  };
47
52
  connectionHandler: {
48
53
  /**
@@ -51,8 +56,11 @@ export function prepareChainAccountKit(zone: Zone, { watch, when }: VowTools): (
51
56
  * @param {RemoteIbcAddress} remoteAddr
52
57
  */
53
58
  onOpen(connection: Remote<Connection>, localAddr: LocalIbcAddress, remoteAddr: RemoteIbcAddress): Promise<void>;
54
- onClose(_connection: any, reason: any): Promise<void>;
55
- onReceive(connection: any, bytes: any): Promise<string>;
59
+ /**
60
+ * @param {Remote<Connection>} _connection
61
+ * @param {unknown} reason
62
+ */
63
+ onClose(_connection: Remote<Connection>, reason: unknown): Promise<void>;
56
64
  };
57
65
  }>;
58
66
  export type UnparsableChainAddress = "UNPARSABLE_CHAIN_ADDRESS";
@@ -70,6 +78,7 @@ import type { Zone } from '@agoric/base-zone';
70
78
  import type { VowTools } from '@agoric/vow';
71
79
  import type { Port } from '@agoric/network';
72
80
  import type { ChainAddress } from '../types.js';
81
+ import type { Vow } from '@agoric/vow';
73
82
  import type { AnyJson } from '@agoric/cosmic-proto';
74
83
  import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
75
84
  import type { Connection } from '@agoric/network';
@@ -1 +1 @@
1
- {"version":3,"file":"chain-account-kit.d.ts","sourceRoot":"","sources":["chain-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;GAaG;AAkBI,6CAHI,IAAI,mBACJ,QAAQ;;QA+BX,0BAA0B;yBAAd,MAAM;;;QAMlB,8BAA8B;sBAAhB,YAAY;;;;;;;QAiC1B;;;;;;;;;WASG;+BALQ,OAAO,EAAE,gDAEP,OAAO,CAAC,MAAM,CAAC;QAgB5B,+BAA+B;;QAW/B;;;;WAIG;wBADQ,KAAK;;;QAQhB;;;;WAIG;2BAHQ,OAAO,UAAU,CAAC,aAClB,eAAe,cACf,gBAAgB;;;;GA0BhC;qCA/KW,0BAA0B;oBAmB3B;I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SAAS,CAAC;IAChD,YAAgB,EAAE,YAAY,GAAG,SAAS,CAAC;CACxC;8BAyJU,UAAU,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;0BAhM5C,mBAAmB;8BAEF,aAAa;0BADlB,iBAAiB;kCAKrB,aAAa;yBAJJ,aAAa;6BAC3B,sBAAsB;4BACvB,8CAA8C;gCAHpC,iBAAiB;4BACZ,aAAa;qCAGD,iCAAiC;sCAAjC,iCAAiC"}
@@ -1,12 +1,12 @@
1
1
  /** @file ChainAccount exo */
2
2
  import { NonNullish } from '@agoric/assert';
3
- import { PurseShape } from '@agoric/ertp';
4
3
  import { makeTracer } from '@agoric/internal';
4
+ import { VowShape } from '@agoric/vow';
5
5
  import { E } from '@endo/far';
6
6
  import { M } from '@endo/patterns';
7
7
  import {
8
8
  ChainAddressShape,
9
- ConnectionHandlerI,
9
+ OutboundConnectionHandlerI,
10
10
  Proto3Shape,
11
11
  } from '../typeGuards.js';
12
12
  import { findAddressField } from '../utils/address.js';
@@ -15,7 +15,7 @@ import { makeTxPacket, parseTxPacket } from '../utils/packet.js';
15
15
  /**
16
16
  * @import {Zone} from '@agoric/base-zone';
17
17
  * @import {Connection, Port} from '@agoric/network';
18
- * @import {Remote, VowTools} from '@agoric/vow';
18
+ * @import {Remote, Vow, VowTools} from '@agoric/vow';
19
19
  * @import {AnyJson} from '@agoric/cosmic-proto';
20
20
  * @import {TxBody} from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
21
21
  * @import {LocalIbcAddress, RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
@@ -30,17 +30,17 @@ const UNPARSABLE_CHAIN_ADDRESS = 'UNPARSABLE_CHAIN_ADDRESS';
30
30
 
31
31
  export const ChainAccountI = M.interface('ChainAccount', {
32
32
  getAddress: M.call().returns(ChainAddressShape),
33
- getBalance: M.callWhen(M.string()).returns(M.any()),
34
- getBalances: M.callWhen().returns(M.any()),
33
+ getBalance: M.call(M.string()).returns(VowShape),
34
+ getBalances: M.call().returns(VowShape),
35
35
  getLocalAddress: M.call().returns(M.string()),
36
36
  getRemoteAddress: M.call().returns(M.string()),
37
37
  getPort: M.call().returns(M.remotable('Port')),
38
- executeTx: M.call(M.arrayOf(M.record())).returns(M.promise()),
38
+ executeTx: M.call(M.arrayOf(M.record())).returns(VowShape),
39
39
  executeEncodedTx: M.call(M.arrayOf(Proto3Shape))
40
40
  .optional(M.record())
41
- .returns(M.promise()),
42
- close: M.callWhen().returns(M.undefined()),
43
- getPurse: M.callWhen().returns(PurseShape),
41
+ .returns(VowShape),
42
+ close: M.call().returns(VowShape),
43
+ getPurse: M.call().returns(VowShape),
44
44
  });
45
45
 
46
46
  /**
@@ -59,12 +59,12 @@ export const ChainAccountI = M.interface('ChainAccount', {
59
59
  * @param {Zone} zone
60
60
  * @param {VowTools} vowTools
61
61
  */
62
- export const prepareChainAccountKit = (zone, { watch, when }) =>
62
+ export const prepareChainAccountKit = (zone, { watch, asVow }) =>
63
63
  zone.exoClassKit(
64
64
  'ChainAccountKit',
65
65
  {
66
66
  account: ChainAccountI,
67
- connectionHandler: ConnectionHandlerI,
67
+ connectionHandler: OutboundConnectionHandlerI,
68
68
  parseTxPacketWatcher: M.interface('ParseTxPacketWatcher', {
69
69
  onFulfilled: M.call(M.string())
70
70
  .optional(M.arrayOf(M.undefined())) // does not need watcherContext
@@ -103,11 +103,11 @@ export const prepareChainAccountKit = (zone, { watch, when }) =>
103
103
  },
104
104
  getBalance(_denom) {
105
105
  // UNTIL https://github.com/Agoric/agoric-sdk/issues/9326
106
- throw new Error('not yet implemented');
106
+ return asVow(() => Fail`'not yet implemented'`);
107
107
  },
108
108
  getBalances() {
109
109
  // UNTIL https://github.com/Agoric/agoric-sdk/issues/9326
110
- throw new Error('not yet implemented');
110
+ return asVow(() => Fail`'not yet implemented'`);
111
111
  },
112
112
  getLocalAddress() {
113
113
  return NonNullish(
@@ -125,7 +125,7 @@ export const prepareChainAccountKit = (zone, { watch, when }) =>
125
125
  return this.state.port;
126
126
  },
127
127
  executeTx() {
128
- throw new Error('not yet implemented');
128
+ return asVow(() => Fail`'not yet implemented'`);
129
129
  },
130
130
  /**
131
131
  * Submit a transaction on behalf of the remote account for execution on
@@ -133,41 +133,44 @@ export const prepareChainAccountKit = (zone, { watch, when }) =>
133
133
  *
134
134
  * @param {AnyJson[]} msgs
135
135
  * @param {Omit<TxBody, 'messages'>} [opts]
136
- * @returns {Promise<string>} - base64 encoded bytes string. Can be
137
- * decoded using the corresponding `Msg*Response` object.
136
+ * @returns {Vow<string>} - base64 encoded bytes string. Can be decoded
137
+ * using the corresponding `Msg*Response` object.
138
138
  * @throws {Error} if packet fails to send or an error is returned
139
139
  */
140
- async executeEncodedTx(msgs, opts) {
141
- const { connection } = this.state;
142
- // TODO #9281 do not throw synchronously when returning a promise; return a rejected Vow
143
- /// see https://github.com/Agoric/agoric-sdk/pull/9454#discussion_r1626898694
144
- if (!connection) throw Fail`connection not available`;
145
- return when(
146
- watch(
140
+ executeEncodedTx(msgs, opts) {
141
+ return asVow(() => {
142
+ const { connection } = this.state;
143
+ if (!connection) throw Fail`connection not available`;
144
+ return watch(
147
145
  E(connection).send(makeTxPacket(msgs, opts)),
148
146
  this.facets.parseTxPacketWatcher,
149
- ),
150
- );
147
+ );
148
+ });
151
149
  },
152
- /** Close the remote account */
153
- async close() {
154
- /// TODO #9192 what should the behavior be here? and `onClose`?
155
- // - retrieve assets?
156
- // - revoke the port?
157
- const { connection } = this.state;
158
- // TODO #9281 do not throw synchronously when returning a promise; return a rejected Vow
159
- /// see https://github.com/Agoric/agoric-sdk/pull/9454#discussion_r1626898694
160
- if (!connection) throw Fail`connection not available`;
161
- return when(watch(E(connection).close()));
150
+ /**
151
+ * Close the remote account
152
+ *
153
+ * @returns {Vow<void>}
154
+ * @throws {Error} if connection is not available or already closed
155
+ */
156
+ close() {
157
+ return asVow(() => {
158
+ /// TODO #9192 what should the behavior be here? and `onClose`?
159
+ // - retrieve assets?
160
+ // - revoke the port?
161
+ const { connection } = this.state;
162
+ if (!connection) throw Fail`connection not available`;
163
+ return E(connection).close();
164
+ });
162
165
  },
163
166
  /**
164
167
  * get Purse for a brand to .withdraw() a Payment from the account
165
168
  *
166
169
  * @param {Brand} brand
167
170
  */
168
- async getPurse(brand) {
171
+ getPurse(brand) {
169
172
  console.log('getPurse got', brand);
170
- throw new Error('not yet implemented');
173
+ return asVow(() => Fail`'not yet implemented'`);
171
174
  },
172
175
  },
173
176
  connectionHandler: {
@@ -189,15 +192,15 @@ export const prepareChainAccountKit = (zone, { watch, when }) =>
189
192
  addressEncoding: 'bech32',
190
193
  });
191
194
  },
195
+ /**
196
+ * @param {Remote<Connection>} _connection
197
+ * @param {unknown} reason
198
+ */
192
199
  async onClose(_connection, reason) {
193
200
  trace(`ICA Channel closed. Reason: ${reason}`);
194
201
  // FIXME handle connection closing https://github.com/Agoric/agoric-sdk/issues/9192
195
202
  // XXX is there a scenario where a connection will unexpectedly close? _I think yes_
196
203
  },
197
- async onReceive(connection, bytes) {
198
- trace(`ICA Channel onReceive`, connection, bytes);
199
- return '';
200
- },
201
204
  },
202
205
  },
203
206
  );
@@ -27,7 +27,6 @@ export function prepareICQConnectionKit(zone: Zone, { watch, when }: VowTools):
27
27
  */
28
28
  onOpen(connection: Remote<Connection>, localAddr: LocalIbcAddress, remoteAddr: RemoteIbcAddress): Promise<void>;
29
29
  onClose(_connection: any, reason: any): Promise<void>;
30
- onReceive(connection: any, bytes: any): Promise<string>;
31
30
  };
32
31
  }>;
33
32
  export type ICQConnectionKitState = {
@@ -1 +1 @@
1
- {"version":3,"file":"icq-connection-kit.d.ts","sourceRoot":"","sources":["icq-connection-kit.js"],"names":[],"mappings":"AAoBA,2DAGE;AAEF;;;;GAIG;AA2BI,8CAHI,IAAI,mBACJ,QAAQ;;;;QAoCX;;;;WAIG;oBAHQ,SAAS,YAAY,CAAC,EAAE,GACtB,OAAO,CAAC,SAAS,aAAa,CAAC,EAAE,CAAC;;;QAiB/C,wD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AGN,+CAA+C;8BADlE,sBAAsB;mCACH,+CAA+C;gCAH1D,iBAAiB;4BACjB,aAAa;qCAGI,iCAAiC;sCAAjC,iCAAiC"}
@@ -4,7 +4,7 @@ import { makeTracer } from '@agoric/internal';
4
4
  import { E } from '@endo/far';
5
5
  import { M } from '@endo/patterns';
6
6
  import { makeQueryPacket, parseQueryPacket } from '../utils/packet.js';
7
- import { ConnectionHandlerI } from '../typeGuards.js';
7
+ import { OutboundConnectionHandlerI } from '../typeGuards.js';
8
8
 
9
9
  /**
10
10
  * @import {Zone} from '@agoric/base-zone';
@@ -59,7 +59,7 @@ export const prepareICQConnectionKit = (zone, { watch, when }) =>
59
59
  'ICQConnectionKit',
60
60
  {
61
61
  connection: ICQConnectionI,
62
- connectionHandler: ConnectionHandlerI,
62
+ connectionHandler: OutboundConnectionHandlerI,
63
63
  parseQueryPacketWatcher: M.interface('ParseQueryPacketWatcher', {
64
64
  onFulfilled: M.call(M.string())
65
65
  .optional(M.arrayOf(M.undefined())) // does not need watcherContext
@@ -127,10 +127,6 @@ export const prepareICQConnectionKit = (zone, { watch, when }) =>
127
127
  async onClose(_connection, reason) {
128
128
  trace(`ICQ Channel closed. Reason: ${reason}`);
129
129
  },
130
- async onReceive(connection, bytes) {
131
- trace(`ICQ Channel onReceive`, connection, bytes);
132
- return '';
133
- },
134
130
  },
135
131
  },
136
132
  );
@@ -1,7 +1,11 @@
1
- export const ConnectionHandlerI: import("@endo/patterns").InterfaceGuard<{
1
+ /**
2
+ * Used for IBC Channel Connections that only send outgoing transactions. If
3
+ * your channel expects incoming transactions, please extend this interface to
4
+ * include the `onReceive` handler.
5
+ */
6
+ export const OutboundConnectionHandlerI: import("@endo/patterns").InterfaceGuard<{
2
7
  onOpen: import("@endo/patterns").MethodGuard;
3
8
  onClose: import("@endo/patterns").MethodGuard;
4
- onReceive: import("@endo/patterns").MethodGuard;
5
9
  }>;
6
10
  export namespace ChainAddressShape {
7
11
  let address: import("@endo/patterns").Matcher;
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;;;GAQE;;;;;;;;;;;;;;;;;;;;;AAiBF,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
@@ -2,11 +2,20 @@ import { AmountShape } from '@agoric/ertp';
2
2
  import { VowShape } from '@agoric/vow';
3
3
  import { M } from '@endo/patterns';
4
4
 
5
- export const ConnectionHandlerI = M.interface('ConnectionHandler', {
6
- onOpen: M.callWhen(M.any(), M.string(), M.string(), M.any()).returns(M.any()),
7
- onClose: M.callWhen(M.any(), M.any(), M.any()).returns(M.any()),
8
- onReceive: M.callWhen(M.any(), M.string()).returns(M.any()),
9
- });
5
+ /**
6
+ * Used for IBC Channel Connections that only send outgoing transactions. If
7
+ * your channel expects incoming transactions, please extend this interface to
8
+ * include the `onReceive` handler.
9
+ */
10
+ export const OutboundConnectionHandlerI = M.interface(
11
+ 'OutboundConnectionHandler',
12
+ {
13
+ onOpen: M.callWhen(M.any(), M.string(), M.string(), M.any()).returns(
14
+ M.any(),
15
+ ),
16
+ onClose: M.callWhen(M.any(), M.any(), M.any()).returns(M.any()),
17
+ },
18
+ );
10
19
 
11
20
  export const ChainAddressShape = {
12
21
  address: M.string(),
@@ -15,7 +15,7 @@ export function provideOrchestration(zcf: ZCF, baggage: Baggage, remotePowers: O
15
15
  watch: <T = any, TResult1 = T, TResult2 = never, C extends any[] = any[]>(specimenP: import("@agoric/vow").ERef<T | import("@agoric/vow").Vow<T>>, watcher?: import("@agoric/vow").Watcher<T, TResult1, TResult2, C> | undefined, ...watcherArgs: C) => import("@agoric/vow").Vow<Exclude<TResult1, void> | Exclude<TResult2, void> extends never ? TResult1 : Exclude<TResult1, void> | Exclude<TResult2, void>>;
16
16
  makeVowKit: <T>() => import("@agoric/vow").VowKit<T>;
17
17
  allVows: (vows: unknown[]) => import("@agoric/vow").Vow<any[]>;
18
- asVow: <T extends unknown>(fn: (...args: any[]) => import("@agoric/vow").Vow<Awaited<T>> | Awaited<T>) => import("@agoric/vow").Vow<Awaited<T>>;
18
+ asVow: <T extends unknown>(fn: (...args: any[]) => import("@agoric/vow").Vow<Awaited<T>> | Awaited<T> | import("@agoric/vow").PromiseVow<T>) => import("@agoric/vow").Vow<Awaited<T>>;
19
19
  };
20
20
  zone: import("@agoric/base-zone").Zone;
21
21
  orchestrate<GuestReturn, HostReturn, GuestContext, HostContext, GuestArgs extends any[], HostArgs extends any[]>(durableName: string, hostCtx: HostContext, guestFn: (guestOrc: import("../orchestration-api.js").Orchestrator, guestCtx: GuestContext, ...args: GuestArgs) => Promise<GuestReturn>): (...args: HostArgs) => Promise<HostReturn>;
@@ -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;;;;;;;;;;;;;;;;;wCAyCjB,GAAF;;;4PA6BqB,GACjB,4CAA4E,GAAG;;;;;;EAFpF;kCArFY;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"}
1
+ {"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AAwCO,0CALI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;;;;;;;;;;;;;;;;;wCAyCV,GAAG;;;4PA6BS,GACjB,4CAA4E,GAAG;;;;;;EAFpF;kCArFY;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"}