@agoric/smart-wallet 0.5.4-upgrade-16-dev-0df76a7.0 → 0.5.4-upgrade-17-dev-e67cd91.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 +24 -23
- package/src/invitations.d.ts.map +1 -1
- package/src/invitations.js +3 -4
- package/src/marshal-contexts.js +3 -3
- package/src/offerWatcher.d.ts +8 -4
- package/src/offerWatcher.d.ts.map +1 -1
- package/src/offerWatcher.js +43 -23
- package/src/proposals/upgrade-walletFactory-proposal.d.ts.map +1 -1
- package/src/proposals/upgrade-walletFactory-proposal.js +1 -2
- package/src/smartWallet.d.ts.map +1 -1
- package/src/smartWallet.js +9 -5
- package/src/types.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/smart-wallet",
|
|
3
|
-
"version": "0.5.4-upgrade-
|
|
3
|
+
"version": "0.5.4-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
4
4
|
"description": "Wallet contract",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -16,30 +16,31 @@
|
|
|
16
16
|
"lint:eslint": "eslint ."
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@agoric/cosmic-proto": "0.4.1-upgrade-
|
|
20
|
-
"@agoric/swingset-vat": "0.
|
|
21
|
-
"@
|
|
22
|
-
"@endo/
|
|
23
|
-
"@endo/
|
|
24
|
-
"@endo/init": "^1.1.2",
|
|
19
|
+
"@agoric/cosmic-proto": "0.4.1-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
20
|
+
"@agoric/swingset-vat": "0.32.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
21
|
+
"@endo/bundle-source": "^3.4.0",
|
|
22
|
+
"@endo/captp": "^4.3.0",
|
|
23
|
+
"@endo/init": "^1.1.4",
|
|
25
24
|
"ava": "^5.3.0",
|
|
26
25
|
"import-meta-resolve": "^2.2.1"
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
|
-
"@agoric/
|
|
30
|
-
"@agoric/
|
|
31
|
-
"@agoric/
|
|
32
|
-
"@agoric/
|
|
33
|
-
"@agoric/
|
|
34
|
-
"@agoric/
|
|
35
|
-
"@agoric/
|
|
36
|
-
"@agoric/
|
|
37
|
-
"@agoric/zoe": "0.26.3-upgrade-
|
|
38
|
-
"@
|
|
39
|
-
"@endo/
|
|
40
|
-
"@endo/
|
|
41
|
-
"@endo/
|
|
42
|
-
"@endo/
|
|
28
|
+
"@agoric/casting": "0.4.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
29
|
+
"@agoric/ertp": "0.16.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
30
|
+
"@agoric/internal": "0.3.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
31
|
+
"@agoric/notifier": "0.6.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
32
|
+
"@agoric/store": "0.9.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
33
|
+
"@agoric/vat-data": "0.5.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
34
|
+
"@agoric/vats": "0.15.2-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
35
|
+
"@agoric/vow": "0.1.1-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
36
|
+
"@agoric/zoe": "0.26.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
37
|
+
"@agoric/zone": "0.2.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
38
|
+
"@endo/errors": "^1.2.5",
|
|
39
|
+
"@endo/eventual-send": "^1.2.5",
|
|
40
|
+
"@endo/far": "^1.1.5",
|
|
41
|
+
"@endo/marshal": "^1.5.3",
|
|
42
|
+
"@endo/nat": "^5.0.10",
|
|
43
|
+
"@endo/promise-kit": "^1.1.5"
|
|
43
44
|
},
|
|
44
45
|
"files": [
|
|
45
46
|
"src/"
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
"access": "public"
|
|
69
70
|
},
|
|
70
71
|
"typeCoverage": {
|
|
71
|
-
"atLeast": 94.
|
|
72
|
+
"atLeast": 94.51
|
|
72
73
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "e67cd918f33dafb1708bd4341f2a737b79fa574f"
|
|
74
75
|
}
|
package/src/invitations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AAuEO,2CANI,IAAI,CAAC,UAAU,CAAC,eAChB,IAAI,CAAC,OAAO,cAAc,EAAE,OAAO,CAAC,mBACpC,KAAK,CAAC,KAAK,CAAC,oBACZ,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,6BAC/B,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,YAAY,EAAE,gBAAgB,UAoFrD,cAAc,KAAK,IAAI,CAAC,UAAU,CAAC,CAgBtD;;;;6BA9JY,4BAA4B,GAClC,sBAAsB,GACtB,mBAAmB,GACnB,wBAAwB;;;;;;;;2CAKlB;IACZ,MAAU,EAAE,gBAAgB,CAAC;IAC7B,YAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAY,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;CACtD;;;;qCAQS;IACZ,MAAU,EAAE,UAAU,CAAC;IACvB,QAAY,EAAE,QAAQ,CAAC;IACvB,qBAAyB,EAAE,MAAM,CAAC;IAClC,cAAkB,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;;;;;;;kCAGS;IACZ,MAAU,EAAE,OAAO,CAAC;IACpB,QAAY,EAAE,QAAQ,CAAC;IACvB,WAAe,EAAE,MAAM,CAAC;CACrB;;;;;uCAOS;IACZ,MAAU,EAAE,YAAY,CAAC;IACzB,aAAiB,EAAE,OAAO,aAAa,EAAE,OAAO,CAAC;IACjD,mBAAuB,EAAE,MAAM,CAAC;IAChC,cAAkB,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;oCAMS,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,UAAU,CAAC"}
|
package/src/invitations.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { AmountMath } from '@agoric/ertp';
|
|
2
2
|
import { mustMatch } from '@agoric/store';
|
|
3
|
-
import {
|
|
3
|
+
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
4
|
+
import { Fail } from '@endo/errors';
|
|
4
5
|
import { E } from '@endo/far';
|
|
5
6
|
import { shape } from './typeGuards.js';
|
|
6
7
|
|
|
7
|
-
const { Fail } = assert;
|
|
8
|
-
|
|
9
8
|
// A safety limit
|
|
10
9
|
const MAX_PIPE_LENGTH = 2;
|
|
11
10
|
|
|
@@ -93,7 +92,7 @@ export const makeInvitationsHelper = (
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
const invitation = await eref;
|
|
96
|
-
mustMatch(invitation,
|
|
95
|
+
mustMatch(invitation, InvitationShape);
|
|
97
96
|
return invitation;
|
|
98
97
|
},
|
|
99
98
|
/** @type {(spec: ContractInvitationSpec) => Promise<Invitation>} */
|
package/src/marshal-contexts.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import { Fail, q } from '@endo/errors';
|
|
3
|
+
import { HandledPromise } from '@endo/eventual-send'; // TODO: convince tsc this isn't needed
|
|
4
|
+
|
|
2
5
|
import { makeScalarMapStore } from '@agoric/store';
|
|
3
6
|
import { Far, makeMarshal, Remotable } from '@endo/marshal';
|
|
4
|
-
import { HandledPromise } from '@endo/eventual-send'; // TODO: convince tsc this isn't needed
|
|
5
7
|
import { DEFAULT_PREFIX } from '@agoric/vats/src/lib-board.js';
|
|
6
8
|
|
|
7
|
-
const { Fail, quote: q } = assert;
|
|
8
|
-
|
|
9
9
|
/**
|
|
10
10
|
* @import {PassableCap, RemotableObject} from '@endo/marshal';
|
|
11
11
|
* @import {Key} from '@endo/patterns';
|
package/src/offerWatcher.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function prepareOfferWatcher(baggage:
|
|
1
|
+
export function makeWatchOfferOutcomes(vowTools: VowTools): (watchers: OutcomeWatchers, seat: UserSeat) => Promise<any>;
|
|
2
|
+
export function prepareOfferWatcher(baggage: Baggage, vowTools: VowTools): (walletHelper: any, deposit: {
|
|
3
|
+
receive: (payment: Payment) => Promise<Amount>;
|
|
4
|
+
}, offerSpec: OfferSpec, address: string, invitationAmount: import("@agoric/ertp/src/types.js").SetAmount<import("@endo/patterns").Key>, seatRef: UserSeat<unknown>) => import("@endo/exo").GuardedKit<{
|
|
3
5
|
helper: {
|
|
4
6
|
/**
|
|
5
7
|
* @param {Record<string, unknown>} offerStatusUpdates
|
|
@@ -41,8 +43,10 @@ export type OutcomeWatchers = {
|
|
|
41
43
|
};
|
|
42
44
|
export type MakeOfferWatcher = ReturnType<typeof prepareOfferWatcher>;
|
|
43
45
|
export type OfferWatcher = ReturnType<MakeOfferWatcher>;
|
|
44
|
-
import type {
|
|
46
|
+
import type { VowTools } from '@agoric/vow';
|
|
47
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
48
|
+
import type { OfferSpec } from './offers.js';
|
|
45
49
|
import type { Passable } from '@endo/pass-style';
|
|
46
|
-
import type { ContinuingOfferResult } from
|
|
50
|
+
import type { ContinuingOfferResult } from './types.js';
|
|
47
51
|
import type { PromiseWatcher } from '@agoric/swingset-liveslots';
|
|
48
52
|
//# sourceMappingURL=offerWatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offerWatcher.d.ts","sourceRoot":"","sources":["offerWatcher.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"offerWatcher.d.ts","sourceRoot":"","sources":["offerWatcher.js"],"names":[],"mappings":"AAwEO,iDADK,QAAQ,cAKP,eAAe,QACf,QAAQ,kBAYpB;AAmCM,6CAHI,OAAO,YACP,QAAQ;aAWO,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC;+KA4FrD,WAAM;;QA5ER;;WAEG;yCADQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QAQlC;;;;;WAKG;sCAJQ,MAAM,oBACN,MAAM,CAAC,KAAK,CAAC,oBACb,OAAO,YAAY,EAAE,gBAAgB,qBACrC,OAAO,YAAY,EAAE,iBAAiB;QAkBjD,uDAAuD;8BAA3C,QAAQ,GAAG,qBAAqB;QAoC5C;;;;;;WAMG;yBADQ,KAAK;;IAclB,gDAAgD;oBAArC,eAAe,CAAC,gBAAgB,CAAC;IA+B5C,+CAA+C;mBAApC,eAAe,CAAC,eAAe,CAAC;IA0B3C,iDAAiD;qBAAtC,eAAe,CAAC,iBAAiB,CAAC;GA2BlD;;;;gCAvSkB,CAAC,oBACP,eAAe,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;8BAI7B;IACZ,aAAiB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,eAAmB,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACjD,cAAkB,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;CAC5D;+BAiSU,UAAU,CAAC,OAAO,mBAAmB,CAAC;2BACtC,UAAU,CAAC,gBAAgB,CAAC;8BA/SV,aAAa;6BADnB,kBAAkB;+BAJhB,aAAa;8BAEd,kBAAkB;2CADL,YAAY;oCAEnB,4BAA4B"}
|
package/src/offerWatcher.js
CHANGED
|
@@ -13,10 +13,12 @@ import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
|
|
|
13
13
|
import { UNPUBLISHED_RESULT } from './offers.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @import {OfferSpec} from
|
|
17
|
-
* @import {ContinuingOfferResult} from
|
|
16
|
+
* @import {OfferSpec} from './offers.js';
|
|
17
|
+
* @import {ContinuingOfferResult} from './types.js';
|
|
18
18
|
* @import {Passable} from '@endo/pass-style';
|
|
19
19
|
* @import {PromiseWatcher} from '@agoric/swingset-liveslots';
|
|
20
|
+
* @import {Baggage} from '@agoric/vat-data';
|
|
21
|
+
* @import {Vow, VowTools} from '@agoric/vow';
|
|
20
22
|
*/
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -32,14 +34,19 @@ import { UNPUBLISHED_RESULT } from './offers.js';
|
|
|
32
34
|
* }} OutcomeWatchers
|
|
33
35
|
*/
|
|
34
36
|
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
/** @param {VowTools} vowTools */
|
|
38
|
+
const makeWatchForOfferResult = ({ watch }) => {
|
|
39
|
+
/**
|
|
40
|
+
* @param {OutcomeWatchers} watchers
|
|
41
|
+
* @param {UserSeat} seat
|
|
42
|
+
* @returns {Vow<void>} Vow that resolves when offer result has been processed
|
|
43
|
+
* by the resultWatcher
|
|
44
|
+
*/
|
|
45
|
+
const watchForOfferResult = ({ resultWatcher }, seat) => {
|
|
46
|
+
// Offer result may be anything, including a Vow, so watch it durably.
|
|
47
|
+
return watch(E(seat).getOfferResult(), resultWatcher, seat);
|
|
48
|
+
};
|
|
49
|
+
return watchForOfferResult;
|
|
43
50
|
};
|
|
44
51
|
|
|
45
52
|
/**
|
|
@@ -62,16 +69,24 @@ const watchForPayout = ({ paymentWatcher }, seat) => {
|
|
|
62
69
|
return p;
|
|
63
70
|
};
|
|
64
71
|
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
/** @param {VowTools} vowTools */
|
|
73
|
+
export const makeWatchOfferOutcomes = vowTools => {
|
|
74
|
+
const watchForOfferResult = makeWatchForOfferResult(vowTools);
|
|
75
|
+
const { asPromise, allVows } = vowTools;
|
|
76
|
+
/**
|
|
77
|
+
* @param {OutcomeWatchers} watchers
|
|
78
|
+
* @param {UserSeat} seat
|
|
79
|
+
*/
|
|
80
|
+
const watchOfferOutcomes = (watchers, seat) => {
|
|
81
|
+
return asPromise(
|
|
82
|
+
allVows([
|
|
83
|
+
watchForOfferResult(watchers, seat),
|
|
84
|
+
watchForNumWants(watchers, seat),
|
|
85
|
+
watchForPayout(watchers, seat),
|
|
86
|
+
]),
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
return watchOfferOutcomes;
|
|
75
90
|
};
|
|
76
91
|
|
|
77
92
|
const offerWatcherGuard = harden({
|
|
@@ -104,16 +119,19 @@ const offerWatcherGuard = harden({
|
|
|
104
119
|
});
|
|
105
120
|
|
|
106
121
|
/**
|
|
107
|
-
* @param {
|
|
122
|
+
* @param {Baggage} baggage
|
|
123
|
+
* @param {VowTools} vowTools
|
|
108
124
|
*/
|
|
109
|
-
export const prepareOfferWatcher = baggage => {
|
|
125
|
+
export const prepareOfferWatcher = (baggage, vowTools) => {
|
|
126
|
+
const watchForOfferResult = makeWatchForOfferResult(vowTools);
|
|
110
127
|
return prepareExoClassKit(
|
|
111
128
|
baggage,
|
|
112
129
|
'OfferWatcher',
|
|
113
130
|
offerWatcherGuard,
|
|
131
|
+
// XXX walletHelper is `any` because the helper facet is too nested to export its type
|
|
114
132
|
/**
|
|
115
133
|
* @param {any} walletHelper
|
|
116
|
-
* @param {
|
|
134
|
+
* @param {{ receive: (payment: Payment) => Promise<Amount> }} deposit
|
|
117
135
|
* @param {OfferSpec} offerSpec
|
|
118
136
|
* @param {string} address
|
|
119
137
|
* @param {Amount<'set'>} invitationAmount
|
|
@@ -267,6 +285,8 @@ export const prepareOfferWatcher = baggage => {
|
|
|
267
285
|
} else {
|
|
268
286
|
facets.helper.handleError(reason);
|
|
269
287
|
}
|
|
288
|
+
// throw so the vow watcher propagates the rejection
|
|
289
|
+
throw reason;
|
|
270
290
|
},
|
|
271
291
|
},
|
|
272
292
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-walletFactory-proposal.d.ts","sourceRoot":"","sources":["upgrade-walletFactory-proposal.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade-walletFactory-proposal.d.ts","sourceRoot":"","sources":["upgrade-walletFactory-proposal.js"],"names":[],"mappings":"AAmBO,yOAJI,eAAe,UAEvB;IAA0E,OAAO,EAAzE;QAAE,gBAAgB,EAAE,YAAY,GAAG;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE;CACnE,iBAiDA;AAMM,mGAFI,eAAe,iBAwBzB;AAyBM;;;;;;;EAKN"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import { Fail } from '@endo/errors';
|
|
2
3
|
import { E } from '@endo/far';
|
|
3
4
|
import { makeMarshal } from '@endo/marshal';
|
|
4
5
|
import { allValues } from '@agoric/internal';
|
|
5
6
|
|
|
6
7
|
console.warn('upgrade-walletFactory-proposal.js module evaluating');
|
|
7
8
|
|
|
8
|
-
const { Fail } = assert;
|
|
9
|
-
|
|
10
9
|
// vstorage paths under published.*
|
|
11
10
|
const WALLET_STORAGE_PATH_SEGMENT = 'wallet';
|
|
12
11
|
const BOARD_AUX = 'boardAux';
|
package/src/smartWallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"AA6PA,kDAAmD;AAiB5C,4CAHI,OAAO,kBAAkB,EAAE,OAAO,UAClC,YAAY,6BA48BV,IA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AC,OAAO,kBAAkB,CAAC,CAAC,CAAC;6BAlsChC,aAAa;iCAAb,aAAa"}
|
package/src/smartWallet.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fail, q } from '@endo/errors';
|
|
1
2
|
import { E } from '@endo/far';
|
|
2
3
|
import {
|
|
3
4
|
AmountShape,
|
|
@@ -36,16 +37,16 @@ import {
|
|
|
36
37
|
AmountKeywordRecordShape,
|
|
37
38
|
PaymentPKeywordRecordShape,
|
|
38
39
|
} from '@agoric/zoe/src/typeGuards.js';
|
|
40
|
+
import { prepareVowTools } from '@agoric/vow';
|
|
41
|
+
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
39
42
|
|
|
40
43
|
import { makeInvitationsHelper } from './invitations.js';
|
|
41
44
|
import { shape } from './typeGuards.js';
|
|
42
45
|
import { objectMapStoragePath } from './utils.js';
|
|
43
|
-
import { prepareOfferWatcher,
|
|
46
|
+
import { prepareOfferWatcher, makeWatchOfferOutcomes } from './offerWatcher.js';
|
|
44
47
|
|
|
45
48
|
/** @import {OfferId, OfferStatus} from './offers.js'; */
|
|
46
49
|
|
|
47
|
-
const { Fail, quote: q } = assert;
|
|
48
|
-
|
|
49
50
|
const trace = makeTracer('SmrtWlt');
|
|
50
51
|
|
|
51
52
|
/**
|
|
@@ -286,7 +287,7 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
286
287
|
secretWalletFactoryKey: M.any(),
|
|
287
288
|
}),
|
|
288
289
|
);
|
|
289
|
-
|
|
290
|
+
const zone = makeDurableZone(baggage);
|
|
290
291
|
const makeRecorderKit = prepareRecorderKit(baggage, shared.publicMarshaller);
|
|
291
292
|
|
|
292
293
|
const walletPurses = provide(baggage, BRAND_TO_PURSES_KEY, () => {
|
|
@@ -298,7 +299,10 @@ export const prepareSmartWallet = (baggage, shared) => {
|
|
|
298
299
|
return store;
|
|
299
300
|
});
|
|
300
301
|
|
|
301
|
-
const
|
|
302
|
+
const vowTools = prepareVowTools(zone.subZone('vow'));
|
|
303
|
+
|
|
304
|
+
const makeOfferWatcher = prepareOfferWatcher(baggage, vowTools);
|
|
305
|
+
const watchOfferOutcomes = makeWatchOfferOutcomes(vowTools);
|
|
302
306
|
|
|
303
307
|
const updateShape = {
|
|
304
308
|
value: AmountShape,
|
package/src/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { CapData } from '@endo/marshal';
|
|
|
10
10
|
import type { agoric } from '@agoric/cosmic-proto';
|
|
11
11
|
import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
|
|
12
12
|
import type { StoredFacet } from '@agoric/internal/src/lib-chainStorage.js';
|
|
13
|
+
import type { PublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
|
|
13
14
|
import type { OfferSpec } from './offers.js';
|
|
14
15
|
|
|
15
16
|
declare const CapDataShape: unique symbol;
|
|
@@ -27,7 +28,7 @@ export type InvitationMakers = Record<
|
|
|
27
28
|
(...args: any[]) => Promise<Invitation>
|
|
28
29
|
>;
|
|
29
30
|
|
|
30
|
-
export type PublicSubscribers = Record<string,
|
|
31
|
+
export type PublicSubscribers = Record<string, PublicTopic>;
|
|
31
32
|
|
|
32
33
|
export interface ContinuingOfferResult {
|
|
33
34
|
invitationMakers: InvitationMakers;
|