@agoric/smart-wallet 0.6.0 → 0.6.1-upgrade-23-dev-bd79330.0.bd79330

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 (42) hide show
  1. package/package.json +22 -22
  2. package/source-spec-registry.d.ts +13 -0
  3. package/source-spec-registry.d.ts.map +1 -0
  4. package/source-spec-registry.js +17 -0
  5. package/src/index.js +0 -4
  6. package/src/invitations.d.ts +15 -5
  7. package/src/invitations.d.ts.map +1 -1
  8. package/src/invitations.js +18 -10
  9. package/src/marshal-contexts.d.ts +5 -3
  10. package/src/marshal-contexts.d.ts.map +1 -1
  11. package/src/marshal-contexts.js +5 -3
  12. package/src/offerWatcher.d.ts +11 -6
  13. package/src/offerWatcher.d.ts.map +1 -1
  14. package/src/offerWatcher.js +84 -13
  15. package/src/offers.d.ts +6 -3
  16. package/src/offers.d.ts.map +1 -1
  17. package/src/offers.js +3 -2
  18. package/src/proposals/upgrade-wallet-factory2-proposal.js +6 -1
  19. package/src/proposals/upgrade-walletFactory-proposal.js +10 -2
  20. package/src/smartWallet.d.ts +40 -20
  21. package/src/smartWallet.d.ts.map +1 -1
  22. package/src/smartWallet.js +164 -69
  23. package/src/typeGuards.js +1 -1
  24. package/src/types.d.ts +8 -0
  25. package/src/types.d.ts.map +1 -1
  26. package/src/types.js +107 -0
  27. package/src/utils.d.ts +25 -19
  28. package/src/utils.d.ts.map +1 -1
  29. package/src/utils.js +22 -29
  30. package/src/walletFactory.d.ts +34 -20
  31. package/src/walletFactory.d.ts.map +1 -1
  32. package/src/walletFactory.js +53 -31
  33. package/tools/fixtures/gameAssetContract.d.ts +12 -0
  34. package/tools/fixtures/gameAssetContract.d.ts.map +1 -0
  35. package/tools/fixtures/gameAssetContract.js +75 -0
  36. package/tools/fixtures/start-game1-proposal.d.ts +14 -0
  37. package/tools/fixtures/start-game1-proposal.d.ts.map +1 -0
  38. package/tools/fixtures/start-game1-proposal.js +122 -0
  39. package/tools/wf-tools.d.ts +81 -0
  40. package/tools/wf-tools.d.ts.map +1 -0
  41. package/tools/wf-tools.js +124 -0
  42. package/src/types.ts +0 -90
package/package.json CHANGED
@@ -1,42 +1,40 @@
1
1
  {
2
2
  "name": "@agoric/smart-wallet",
3
- "version": "0.6.0",
3
+ "version": "0.6.1-upgrade-23-dev-bd79330.0.bd79330",
4
4
  "description": "Wallet contract",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
8
- "build": "yarn build:bundles",
9
- "build:bundles": "node ./scripts/build-bundles.js",
10
- "prepack": "yarn run -T tsc --build tsconfig.build.json",
11
- "postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
8
+ "prepack": "yarn run -T prepack-package",
9
+ "postpack": "yarn run -T postpack-package",
12
10
  "test": "ava",
13
11
  "test:c8": "c8 --all $C8_OPTIONS ava",
14
12
  "test:xs": "exit 0",
15
13
  "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
16
14
  "lint-fix": "yarn lint:eslint --fix",
17
15
  "lint:types": "yarn run -T tsc",
18
- "lint:eslint": "yarn run -T eslint ."
16
+ "lint:eslint": "node ../../scripts/eslint-repo.mjs ."
19
17
  },
20
18
  "devDependencies": {
21
- "@agoric/casting": "0.5.0",
22
- "@agoric/cosmic-proto": "0.5.0",
23
- "@agoric/swingset-vat": "0.33.0",
19
+ "@agoric/casting": "0.5.1-upgrade-23-dev-bd79330.0.bd79330",
20
+ "@agoric/cosmic-proto": "0.5.1-upgrade-23-dev-bd79330.0.bd79330",
21
+ "@agoric/swingset-vat": "0.33.1-upgrade-23-dev-bd79330.0.bd79330",
24
22
  "@endo/bundle-source": "^4.1.2",
25
23
  "@endo/captp": "^4.4.8",
26
24
  "@endo/init": "^1.1.12",
27
- "ava": "^5.3.0",
25
+ "ava": "^6.4.1",
28
26
  "import-meta-resolve": "^4.1.0"
29
27
  },
30
28
  "dependencies": {
31
- "@agoric/ertp": "0.17.0",
32
- "@agoric/internal": "0.4.0",
33
- "@agoric/notifier": "0.7.0",
34
- "@agoric/store": "0.10.0",
35
- "@agoric/vat-data": "0.6.0",
36
- "@agoric/vats": "0.16.0",
37
- "@agoric/vow": "0.2.0",
38
- "@agoric/zoe": "0.27.0",
39
- "@agoric/zone": "0.3.0",
29
+ "@agoric/ertp": "0.17.1-upgrade-23-dev-bd79330.0.bd79330",
30
+ "@agoric/internal": "0.4.1-upgrade-23-dev-bd79330.0.bd79330",
31
+ "@agoric/notifier": "0.7.1-upgrade-23-dev-bd79330.0.bd79330",
32
+ "@agoric/store": "0.10.1-upgrade-23-dev-bd79330.0.bd79330",
33
+ "@agoric/vat-data": "0.6.1-upgrade-23-dev-bd79330.0.bd79330",
34
+ "@agoric/vats": "0.16.1-upgrade-23-dev-bd79330.0.bd79330",
35
+ "@agoric/vow": "0.2.1-upgrade-23-dev-bd79330.0.bd79330",
36
+ "@agoric/zoe": "0.27.1-upgrade-23-dev-bd79330.0.bd79330",
37
+ "@agoric/zone": "0.3.1-upgrade-23-dev-bd79330.0.bd79330",
40
38
  "@endo/errors": "^1.2.13",
41
39
  "@endo/eventual-send": "^1.3.4",
42
40
  "@endo/far": "^1.1.14",
@@ -46,7 +44,9 @@
46
44
  "@endo/promise-kit": "^1.1.13"
47
45
  },
48
46
  "files": [
49
- "src/"
47
+ "src/",
48
+ "tools/",
49
+ "source-spec-registry.*"
50
50
  ],
51
51
  "keywords": [],
52
52
  "repository": {
@@ -72,10 +72,10 @@
72
72
  "access": "public"
73
73
  },
74
74
  "typeCoverage": {
75
- "atLeast": 94.51
75
+ "atLeast": 93.84
76
76
  },
77
77
  "engines": {
78
78
  "node": "^20.9 || ^22.11"
79
79
  },
80
- "gitHead": "0922d0447ab8fae9d2d87415964403330b5ca313"
80
+ "gitHead": "bd79330f78dae2faf9cc3d8b10063567700da07b"
81
81
  }
@@ -0,0 +1,13 @@
1
+ export namespace smartWalletSourceSpecRegistry {
2
+ namespace walletFactory {
3
+ let bundleName: string;
4
+ let packagePath: string;
5
+ let sourceSpec: string;
6
+ }
7
+ }
8
+ export function getSmartWalletSourceSpec(name: keyof typeof smartWalletSourceSpecRegistry): {
9
+ bundleName: string;
10
+ packagePath: string;
11
+ sourceSpec: string;
12
+ };
13
+ //# sourceMappingURL=source-spec-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-spec-registry.d.ts","sourceRoot":"","sources":["source-spec-registry.js"],"names":[],"mappings":";;;;;;;AAeO,+CADK,MAAM,OAAO,6BAA6B;;;;EAEjB"}
@@ -0,0 +1,17 @@
1
+ import { fileURLToPath } from 'node:url';
2
+
3
+ /** @param {string} packagePath */
4
+ const resolveSourceSpec = packagePath =>
5
+ fileURLToPath(import.meta.resolve(packagePath));
6
+
7
+ export const smartWalletSourceSpecRegistry = {
8
+ walletFactory: {
9
+ bundleName: 'walletFactory',
10
+ packagePath: '@agoric/smart-wallet/src/walletFactory.js',
11
+ sourceSpec: resolveSourceSpec('@agoric/smart-wallet/src/walletFactory.js'),
12
+ },
13
+ };
14
+
15
+ /** @param {keyof typeof smartWalletSourceSpecRegistry} name */
16
+ export const getSmartWalletSourceSpec = name =>
17
+ smartWalletSourceSpecRegistry[name];
package/src/index.js CHANGED
@@ -1,6 +1,2 @@
1
- /// <reference types="@agoric/internal/exported" />
2
- /// <reference types="@agoric/ertp/exported" />
3
- /// <reference types="@agoric/zoe/exported" />
4
-
5
1
  // eslint-disable-next-line import/export
6
2
  export * from './types-index.js'; // no named exports
@@ -1,4 +1,4 @@
1
- export function makeInvitationsHelper(zoe: ERef<ZoeService>, agoricNames: ERef<import("@agoric/vats").NameHub>, invitationBrand: Brand<"set">, invitationsPurse: Purse<"set", import("@agoric/zoe").InvitationDetails>, getInvitationContinuation: (fromOfferId: string) => import("./types.js").InvitationMakers): (spec: InvitationSpec) => ERef<Invitation>;
1
+ export function makeInvitationsHelper(zoe: ERef<ZoeService>, agoricNames: ERef<NameHub>, invitationBrand: Brand<"set">, invitationsPurse: Purse<"set", InvitationDetails>, getInvitationContinuation: (fromOfferId: string) => InvitationMakers): (spec: InvitationSpec) => ERef<Invitation>;
2
2
  /**
3
3
  * Specify how to produce an invitation. See each type in the union for details.
4
4
  */
@@ -20,7 +20,7 @@ export type AgoricContractInvitationSpec = {
20
20
  */
21
21
  export type ContractInvitationSpec = {
22
22
  source: "contract";
23
- instance: Instance;
23
+ instance: Instance<any>;
24
24
  publicInvitationMaker: string;
25
25
  invitationArgs?: any[];
26
26
  };
@@ -32,7 +32,7 @@ export type ContractInvitationSpec = {
32
32
  */
33
33
  export type PurseInvitationSpec = {
34
34
  source: "purse";
35
- instance: Instance;
35
+ instance: Instance<any>;
36
36
  description: string;
37
37
  };
38
38
  /**
@@ -41,9 +41,19 @@ export type PurseInvitationSpec = {
41
41
  */
42
42
  export type ContinuingInvitationSpec = {
43
43
  source: "continuing";
44
- previousOffer: import("./offers.js").OfferId;
44
+ previousOffer: OfferId;
45
45
  invitationMakerName: string;
46
46
  invitationArgs?: any[];
47
47
  };
48
- export type InvitationsPurseQuery = Pick<import("@agoric/zoe").InvitationDetails, "description" | "instance">;
48
+ export type InvitationsPurseQuery = Pick<InvitationDetails, "description" | "instance">;
49
+ import type { ZoeService } from '@agoric/zoe';
50
+ import type { ERef } from '@agoric/vow';
51
+ import type { NameHub } from '@agoric/vats';
52
+ import type { Brand } from '@agoric/ertp';
53
+ import type { InvitationDetails } from '@agoric/zoe';
54
+ import type { Purse } from '@agoric/ertp';
55
+ import type { InvitationMakers } from './types.js';
56
+ import type { Invitation } from '@agoric/zoe';
57
+ import type { Instance } from '@agoric/zoe/src/zoeService/utils.js';
58
+ import type { OfferId } from './offers.js';
49
59
  //# sourceMappingURL=invitations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"AA0EO,2CANI,IAAI,CAAC,UAAU,CAAC,eAChB,IAAI,CAAC,OAAO,cAAc,EAAE,OAAO,CAAC,mBACpC,KAAK,CAAC,KA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AgBtD;;;;6BA9JY,4BAA4B,GAClC,sBAAsB,GACtB,mBAAmB,GACnB,wBAAwB;;;;;;;;2CAKlB;IACR,MAAM,EAAE,gBAAgB,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;CACtD;;;;qCAQS;IACR,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;;;;;;;kCAGS;IACR,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;;;;;uCAOS;IACR,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;oCAMS,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,UAAU,CAAC;gCA/DJ,aAAa;0BAIlD,aAAa;6BAHV,cAAc;2BAIhB,cAAc;uCALsB,aAAa;2BAMjD,cAAc;sCAJH,YAAY;gCAFa,aAAa;8BAG9C,qCAAqC;6BAJtC,aAAa"}
@@ -5,6 +5,17 @@ import { Fail } from '@endo/errors';
5
5
  import { E } from '@endo/far';
6
6
  import { shape } from './typeGuards.js';
7
7
 
8
+ /**
9
+ * @import {OfferId} from './offers.js';
10
+ * @import {Invitation, InvitationDetails, ZoeService} from '@agoric/zoe';
11
+ * @import {NameHub} from '@agoric/vats';
12
+ * @import {InvitationMakers} from './types.js';
13
+ * @import {Instance} from '@agoric/zoe/src/zoeService/utils.js';
14
+ * @import {ERef} from '@agoric/vow';
15
+ * @import {Brand} from '@agoric/ertp';
16
+ * @import {Purse} from '@agoric/ertp';
17
+ */
18
+
8
19
  // A safety limit
9
20
  const MAX_PIPE_LENGTH = 2;
10
21
 
@@ -31,7 +42,7 @@ const MAX_PIPE_LENGTH = 2;
31
42
  *
32
43
  * @typedef {{
33
44
  * source: 'contract';
34
- * instance: Instance;
45
+ * instance: Instance<any>;
35
46
  * publicInvitationMaker: string;
36
47
  * invitationArgs?: any[];
37
48
  * }} ContractInvitationSpec
@@ -39,7 +50,7 @@ const MAX_PIPE_LENGTH = 2;
39
50
  *
40
51
  * @typedef {{
41
52
  * source: 'purse';
42
- * instance: Instance;
53
+ * instance: Instance<any>;
43
54
  * description: string;
44
55
  * }} PurseInvitationSpec
45
56
  * the invitation is already in your Zoe "invitation" purse so we need to query
@@ -50,7 +61,7 @@ const MAX_PIPE_LENGTH = 2;
50
61
  *
51
62
  * @typedef {{
52
63
  * source: 'continuing';
53
- * previousOffer: import('./offers.js').OfferId;
64
+ * previousOffer: OfferId;
54
65
  * invitationMakerName: string;
55
66
  * invitationArgs?: any[];
56
67
  * }} ContinuingInvitationSpec
@@ -59,18 +70,15 @@ const MAX_PIPE_LENGTH = 2;
59
70
  */
60
71
 
61
72
  /**
62
- * @typedef {Pick<
63
- * import('@agoric/zoe').InvitationDetails,
64
- * 'description' | 'instance'
65
- * >} InvitationsPurseQuery
73
+ * @typedef {Pick<InvitationDetails, 'description' | 'instance'>} InvitationsPurseQuery
66
74
  */
67
75
 
68
76
  /**
69
77
  * @param {ERef<ZoeService>} zoe
70
- * @param {ERef<import('@agoric/vats').NameHub>} agoricNames
78
+ * @param {ERef<NameHub>} agoricNames
71
79
  * @param {Brand<'set'>} invitationBrand
72
- * @param {Purse<'set', import('@agoric/zoe').InvitationDetails>} invitationsPurse
73
- * @param {(fromOfferId: string) => import('./types.js').InvitationMakers} getInvitationContinuation
80
+ * @param {Purse<'set', InvitationDetails>} invitationsPurse
81
+ * @param {(fromOfferId: string) => InvitationMakers} getInvitationContinuation
74
82
  */
75
83
  export const makeInvitationsHelper = (
76
84
  zoe,
@@ -3,14 +3,14 @@ export function makeExportContext(): {
3
3
  fromCapData: import("@endo/marshal").FromCapData<string>;
4
4
  serialize: import("@endo/marshal").ToCapData<string>;
5
5
  unserialize: import("@endo/marshal").FromCapData<string>;
6
- savePurseActions: (val: globalThis.Purse) => void;
7
- savePaymentActions: (val: globalThis.Payment) => void;
6
+ savePurseActions: (val: Purse) => void;
7
+ savePaymentActions: (val: Payment) => void;
8
8
  /**
9
9
  * @param {number} id
10
10
  * @param {Purse} purse
11
11
  */
12
12
  initPurseId: (id: number, purse: Purse) => void;
13
- purseEntries: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[number, globalThis.Purse]>;
13
+ purseEntries: (keyPatt?: import("@endo/patterns").Pattern, valuePatt?: import("@endo/patterns").Pattern) => Iterable<[number, Purse]>;
14
14
  /**
15
15
  * @param {BoardId} id
16
16
  * @param {RemotableObject} val
@@ -84,6 +84,8 @@ export type IdTable<Slot extends Key, Val extends PassableCap> = {
84
84
  };
85
85
  export type ExportContext = ReturnType<typeof makeExportContext>;
86
86
  export type ImportContext = ReturnType<typeof makeImportContext>;
87
+ import type { Purse } from '@agoric/ertp';
88
+ import type { Payment } from '@agoric/ertp';
87
89
  import type { BoardId } from '@agoric/vats/src/lib-board.js';
88
90
  import type { RemotableObject } from '@endo/marshal';
89
91
  import type { PassableCap } from '@endo/marshal';
@@ -1 +1 @@
1
- {"version":3,"file":"marshal-contexts.d.ts","sourceRoot":"","sources":["marshal-contexts.js"],"names":[],"mappings":"AAwHO;;;;;;;IAoFH;;;OAGG;sBAFQ,MAAM,SACN,KAAK;;IAMhB;;;OAGG;sBAFQ,OAAO,OACP,eAAe;IAK1B;;;OAGG;wBAFQ,OAAO,OACP,eAAe;EAW7B;AAcM,iDAFI,CAAC,KAAK,EAAE,MAAM,KAAK,WAAW;IA8FrC;;;OAGG;sBAFQ,OAAO,OACP,WAAW;IAKtB;;;OAGG;wBAFQ,OAAO,OACP,W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AHI,MAAM,OACN,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,OAapC;;;;uBAlXgD,CAAC,SAApC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAE,IACnC,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE;;;;qBAGtB,CAAC,SAAV,MAAQ,IACR,GAAG,CAAC,IAAI,MAAM,EAAE;;;;;sBA0CoB,CAAC,SAApC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAE,IACnC,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO;;;;;qBAGvB,GAAG,GAAG,IAAI,GAAG,KAAK;;;;oBAKZ,IAAI,SAAV,GAAK,EACS,GAAG,SAAjB,WAAa,IACb;IACR,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,CAAC,CAAC;IAC5B,KAAK,EAAE,SAAS,GAAG,EAAE,IAAI,CAAC,CAAC;CAC5B;4BAgJU,UAAU,CAAC,OAAO,iBAAiB,CAAC;4BA+HpC,UAAU,CAAC,OAAO,iBAAiB,CAAC;2BA7V1B,cAAc;6BACZ,cAAc;6BAFd,+BAA+B;qCAHV,eAAe;iCAAf,eAAe;yBACxC,gBAAgB;8BACX,4BAA4B"}
@@ -11,6 +11,8 @@ import { DEFAULT_PREFIX } from '@agoric/vats/src/lib-board.js';
11
11
  * @import {Key} from '@endo/patterns';
12
12
  * @import {MapStore} from '@agoric/swingset-liveslots';
13
13
  * @import {BoardId} from '@agoric/vats/src/lib-board.js';
14
+ * @import {Purse} from '@agoric/ertp';
15
+ * @import {Payment} from '@agoric/ertp';
14
16
  */
15
17
 
16
18
  /**
@@ -186,10 +188,10 @@ export const makeExportContext = () => {
186
188
 
187
189
  /**
188
190
  * @template {PassableCap} V
189
- * @param {string & keyof typeof walletObjects} kind
191
+ * @param {string & keyof typeof walletObjects} _kind
190
192
  * @param {IdTable<number, V>} table
191
193
  */
192
- const makeSaver = (kind, table) => {
194
+ const makeSaver = (_kind, table) => {
193
195
  let nonce = 0;
194
196
  /** @param {V} val */
195
197
  const saver = val => {
@@ -374,7 +376,7 @@ export const makeImportContext = (makePresence = defaultMakePresence) => {
374
376
  const makePresence = (iface, handler) => {
375
377
  let obj;
376
378
 
377
- void new HandledPromise((resolve, reject, resolveWithPresence) => {
379
+ void new HandledPromise((_resolve, _reject, resolveWithPresence) => {
378
380
  obj = resolveWithPresence(handler);
379
381
  });
380
382
  assert(obj);
@@ -1,5 +1,5 @@
1
- export function makeWatchOfferOutcomes(vowTools: VowTools): (watchers: OutcomeWatchers, seat: UserSeat) => Promise<any[]>;
2
- export function prepareOfferWatcher(baggage: Baggage, vowTools: VowTools): (walletHelper: any, deposit: {
1
+ export function makeWatchOfferOutcomes(vowTools: VowTools): (watchers: OutcomeWatchers, seat: UserSeat) => Promise<(void | 0 | 1 | PaymentPKeywordRecord)[]>;
2
+ export function prepareOfferWatcher(baggage: Baggage, vowTools: VowTools, zone: Zone): (walletHelper: any, deposit: {
3
3
  receive: (payment: Payment) => Promise<Amount>;
4
4
  }, offerSpec: OfferSpec, address: string, invitationAmount: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>, seatRef: UserSeat) => import("@endo/exo").GuardedKit<{
5
5
  helper: {
@@ -10,10 +10,10 @@ export function prepareOfferWatcher(baggage: Baggage, vowTools: VowTools): (wall
10
10
  /**
11
11
  * @param {string} offerId
12
12
  * @param {Amount<'set'>} invitationAmount
13
- * @param {import('./types.js').InvitationMakers} invitationMakers
14
- * @param {import('./types.js').PublicSubscribers} publicSubscribers
13
+ * @param {InvitationMakers} invitationMakers
14
+ * @param {PublicSubscribers} publicSubscribers
15
15
  */
16
- onNewContinuingOffer(offerId: string, invitationAmount: Amount<"set">, invitationMakers: import("./types.js").InvitationMakers, publicSubscribers: import("./types.js").PublicSubscribers): void;
16
+ onNewContinuingOffer(offerId: string, invitationAmount: Amount<"set">, invitationMakers: InvitationMakers, publicSubscribers: PublicSubscribers): void;
17
17
  /** @param {Passable | ContinuingOfferResult} result */
18
18
  publishResult(result: Passable | ContinuingOfferResult): void;
19
19
  /**
@@ -45,10 +45,15 @@ export type MakeOfferWatcher = ReturnType<typeof prepareOfferWatcher>;
45
45
  export type OfferWatcher = ReturnType<MakeOfferWatcher>;
46
46
  import type { VowTools } from '@agoric/vow';
47
47
  import type { UserSeat } from '@agoric/zoe';
48
+ import type { PaymentPKeywordRecord } from '@agoric/zoe';
48
49
  import type { Baggage } from '@agoric/vat-data';
50
+ import type { Zone } from '@agoric/base-zone';
51
+ import type { Payment } from '@agoric/ertp';
52
+ import type { Amount } from '@agoric/ertp';
49
53
  import type { OfferSpec } from './offers.js';
54
+ import type { InvitationMakers } from './types.js';
55
+ import type { PublicSubscribers } from './types.js';
50
56
  import type { Passable } from '@endo/pass-style';
51
57
  import type { ContinuingOfferResult } from './types.js';
52
58
  import type { PromiseWatcher } from '@agoric/swingset-liveslots';
53
- import type { PaymentPKeywordRecord } from '@agoric/zoe';
54
59
  //# sourceMappingURL=offerWatcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"offerWatcher.d.ts","sourceRoot":"","sources":["offerWatcher.js"],"names":[],"mappings":"AAyEO,iDADK,QAAQ,cAKP,eAAe,QACf,QAAQ,oBAiBpB;AAmCM,6CAHI,OAAO,YACP,QAAQ;aAWO,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC;;;QAgBvD;;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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ACR,aAAa,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC7C,eAAe,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC7C,cAAc,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;CAC5D;+BAiXU,UAAU,CAAC,OAAO,mBAAmB,CAAC;2BACtC,UAAU,CAAC,gBAAgB,CAAC;8BAtYV,aAAa;8BAE2B,aAAa;2CAAb,aAAa;6BAH3D,kBAAkB;0BAErB,mBAAmB;6BAKhB,cAAc;4BACf,cAAc;+BAZX,aAAa;sCAQN,YAAY;uCACX,YAAY;8BAPrB,kBAAkB;2CADL,YAAY;oCAEnB,4BAA4B"}
@@ -1,6 +1,9 @@
1
1
  import { E, passStyleOf } from '@endo/far';
2
2
 
3
- import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
3
+ import {
4
+ isAbandonedError,
5
+ isUpgradeDisconnection,
6
+ } from '@agoric/internal/src/upgrade-api.js';
4
7
  import { prepareExoClassKit, watchPromise } from '@agoric/vat-data';
5
8
  import { M } from '@agoric/store';
6
9
  import {
@@ -19,7 +22,13 @@ import { UNPUBLISHED_RESULT } from './offers.js';
19
22
  * @import {PromiseWatcher} from '@agoric/swingset-liveslots';
20
23
  * @import {Baggage} from '@agoric/vat-data';
21
24
  * @import {Vow, VowTools} from '@agoric/vow';
25
+ * @import {Zone} from '@agoric/base-zone';
22
26
  * @import {PaymentPKeywordRecord, Proposal, UserSeat, ZoeService} from '@agoric/zoe';
27
+ * @import {InvitationMakers} from './types.js';
28
+ * @import {PublicSubscribers} from './types.js';
29
+ * @import {UpgradeDisconnection} from '@agoric/internal/src/upgrade-api.js';
30
+ * @import {Payment} from '@agoric/ertp';
31
+ * @import {Amount} from '@agoric/ertp';
23
32
  */
24
33
 
25
34
  /**
@@ -35,6 +44,28 @@ import { UNPUBLISHED_RESULT } from './offers.js';
35
44
  * }} OutcomeWatchers
36
45
  */
37
46
 
47
+ /**
48
+ * Adopted from `@agoric/vow/vat.js`
49
+ *
50
+ * @param {unknown} reason
51
+ * @param {unknown} priorRetryValue
52
+ */
53
+ const isRetryableReason = (reason, priorRetryValue) => {
54
+ if (
55
+ isUpgradeDisconnection(reason) &&
56
+ (!isUpgradeDisconnection(priorRetryValue) ||
57
+ reason.incarnationNumber > priorRetryValue.incarnationNumber)
58
+ ) {
59
+ return reason;
60
+ }
61
+ // For abandoned errors there is no way to differentiate errors from
62
+ // consecutive upgrades
63
+ if (isAbandonedError(reason) && !isAbandonedError(priorRetryValue)) {
64
+ return reason;
65
+ }
66
+ return undefined;
67
+ };
68
+
38
69
  /** @param {VowTools} vowTools */
39
70
  const makeWatchForOfferResult = ({ watch }) => {
40
71
  /**
@@ -127,9 +158,49 @@ const offerWatcherGuard = harden({
127
158
  /**
128
159
  * @param {Baggage} baggage
129
160
  * @param {VowTools} vowTools
161
+ * @param {Zone} zone
130
162
  */
131
- export const prepareOfferWatcher = (baggage, vowTools) => {
163
+ export const prepareOfferWatcher = (baggage, vowTools, zone) => {
132
164
  const watchForOfferResult = makeWatchForOfferResult(vowTools);
165
+
166
+ const extraProps = zone.weakMapStore('offerWatcherExtraProps');
167
+ /**
168
+ * Implement retry logic for offer watchers. This uses the stateful
169
+ * `isRetryableReason` to avoid infinite promise rejection loops upon remote
170
+ * vat upgrade.
171
+ *
172
+ * @param {{}} facet
173
+ * @param {unknown} reason
174
+ * @returns {reason is UpgradeDisconnection} roughly
175
+ */
176
+ const needsRetry = (facet, reason) => {
177
+ const exists = extraProps.has(facet);
178
+ const extra = exists ? extraProps.get(facet) : harden({});
179
+
180
+ const key = `priorRetry`;
181
+ const priorRetryable = extra[key];
182
+ const retryable = isRetryableReason(reason, priorRetryable);
183
+ if (retryable) {
184
+ // Insert / update the new state.
185
+ extraProps[exists ? 'set' : 'init'](
186
+ facet,
187
+ harden({
188
+ ...extra,
189
+ [key]: retryable,
190
+ }),
191
+ );
192
+ } else if (exists) {
193
+ // Delete/shrink existing state to clean up unnecessary state.
194
+ const { [key]: _omit, ...rest } = extra;
195
+ if (Object.keys(rest).length === 0) {
196
+ extraProps.delete(facet);
197
+ } else {
198
+ extraProps.set(facet, harden(rest));
199
+ }
200
+ }
201
+ return !!retryable;
202
+ };
203
+
133
204
  return prepareExoClassKit(
134
205
  baggage,
135
206
  'OfferWatcher',
@@ -165,8 +236,8 @@ export const prepareOfferWatcher = (baggage, vowTools) => {
165
236
  /**
166
237
  * @param {string} offerId
167
238
  * @param {Amount<'set'>} invitationAmount
168
- * @param {import('./types.js').InvitationMakers} invitationMakers
169
- * @param {import('./types.js').PublicSubscribers} publicSubscribers
239
+ * @param {InvitationMakers} invitationMakers
240
+ * @param {PublicSubscribers} publicSubscribers
170
241
  */
171
242
  onNewContinuingOffer(
172
243
  offerId,
@@ -256,13 +327,12 @@ export const prepareOfferWatcher = (baggage, vowTools) => {
256
327
  * If promise disconnected, watch again. Or if there's an Error, handle
257
328
  * it.
258
329
  *
259
- * @param {Error
260
- * | import('@agoric/internal/src/upgrade-api.js').UpgradeDisconnection} reason
330
+ * @param {Error | UpgradeDisconnection} reason
261
331
  * @param {UserSeat} seat
262
332
  */
263
333
  onRejected(reason, seat) {
264
334
  const { facets } = this;
265
- if (isUpgradeDisconnection(reason)) {
335
+ if (needsRetry(facets.paymentWatcher, reason)) {
266
336
  void watchForPayout(facets, seat);
267
337
  } else {
268
338
  facets.helper.handleError(reason);
@@ -293,13 +363,12 @@ export const prepareOfferWatcher = (baggage, vowTools) => {
293
363
  * If promise disconnected, watch again. Or if there's an Error, handle
294
364
  * it.
295
365
  *
296
- * @param {Error
297
- * | import('@agoric/internal/src/upgrade-api.js').UpgradeDisconnection} reason
366
+ * @param {Error | UpgradeDisconnection} reason
298
367
  * @param {UserSeat} seat
299
368
  */
300
369
  onRejected(reason, seat) {
301
370
  const { facets } = this;
302
- if (isUpgradeDisconnection(reason)) {
371
+ if (needsRetry(facets.resultWatcher, reason)) {
303
372
  void watchForOfferResult(facets, seat);
304
373
  } else {
305
374
  facets.helper.handleError(reason);
@@ -323,15 +392,17 @@ export const prepareOfferWatcher = (baggage, vowTools) => {
323
392
  * and getPayouts() settle the same (they await the same promise and
324
393
  * then synchronously return a local value).
325
394
  *
326
- * @param {Error
327
- * | import('@agoric/internal/src/upgrade-api.js').UpgradeDisconnection} reason
395
+ * @param {Error | UpgradeDisconnection} reason
328
396
  * @param {UserSeat} seat
329
397
  */
330
398
  onRejected(reason, seat) {
331
399
  const { facets } = this;
332
- if (isUpgradeDisconnection(reason)) {
400
+ if (needsRetry(facets.numWantsWatcher, reason)) {
333
401
  void watchForNumWants(facets, seat);
402
+ } else {
403
+ facets.helper.handleError(reason);
334
404
  }
405
+ throw reason;
335
406
  },
336
407
  },
337
408
  },
package/src/offers.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
- * @import {Proposal} from '@agoric/zoe';
2
+ * @import {AmountKeywordRecord, Proposal} from '@agoric/zoe';
3
3
  * @import {Passable} from '@endo/pass-style';
4
+ * @import {InvitationSpec} from './invitations.js';
4
5
  */
5
6
  /**
6
7
  * @typedef {number | string} OfferId
@@ -24,7 +25,7 @@
24
25
  /**
25
26
  * @typedef {{
26
27
  * id: OfferId;
27
- * invitationSpec: import('./invitations.js').InvitationSpec;
28
+ * invitationSpec: InvitationSpec;
28
29
  * proposal: Proposal;
29
30
  * offerArgs?: any;
30
31
  * saveResult?: ResultPlan;
@@ -62,7 +63,7 @@ export type InvokeEntryMessage = {
62
63
  */
63
64
  export type OfferSpec = {
64
65
  id: OfferId;
65
- invitationSpec: import("./invitations.js").InvitationSpec;
66
+ invitationSpec: InvitationSpec;
66
67
  proposal: Proposal;
67
68
  offerArgs?: any;
68
69
  saveResult?: ResultPlan;
@@ -77,5 +78,7 @@ export type OfferStatus = OfferSpec & {
77
78
  payouts?: AmountKeywordRecord;
78
79
  };
79
80
  import type { Passable } from '@endo/pass-style';
81
+ import type { InvitationSpec } from './invitations.js';
80
82
  import type { Proposal } from '@agoric/zoe';
83
+ import type { AmountKeywordRecord } from '@agoric/zoe';
81
84
  //# sourceMappingURL=offers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AAEH,kEAAkE;AAClE,iCAAkC,aAAa,CAAC;sBAnCnC,MAAM,GAAG,MAAM;;;;;UAKd,MAAM;;;;;;;;iCAOP;IACR,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;;;;;;wBAIS;IACR,EAAE,EAAE,OAAO,CAAC;IACZ,cAAc,EAAE,OAAO,kBAAkB,EAAE,cAAc,CAAC;IAC1D,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;0BAUS,SAAS,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EACH,OAAO,GACP,OAAO,kBAAkB,GACzB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;8BAlDuB,kBAAkB;8BADlB,aAAa"}
1
+ {"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AAEH,kEAAkE;AAClE,iCAAkC,aAAa,CAAC;sBAnCnC,MAAM,GAAG,MAAM;;;;;UAKd,MAAM;;;;;;;;iCAOP;IACR,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;;;;;;wBAIS;IACR,EAAE,EAAE,OAAO,CAAC;IACZ,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;0BAUS,SAAS,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EACH,OAAO,GACP,OAAO,kBAAkB,GACzB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;8BAnDuB,kBAAkB;oCACZ,kBAAkB;8BAFH,aAAa;yCAAb,aAAa"}
package/src/offers.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
- * @import {Proposal} from '@agoric/zoe';
2
+ * @import {AmountKeywordRecord, Proposal} from '@agoric/zoe';
3
3
  * @import {Passable} from '@endo/pass-style';
4
+ * @import {InvitationSpec} from './invitations.js';
4
5
  */
5
6
 
6
7
  /**
@@ -28,7 +29,7 @@
28
29
  /**
29
30
  * @typedef {{
30
31
  * id: OfferId;
31
- * invitationSpec: import('./invitations.js').InvitationSpec;
32
+ * invitationSpec: InvitationSpec;
32
33
  * proposal: Proposal;
33
34
  * offerArgs?: any;
34
35
  * saveResult?: ResultPlan;
@@ -1,9 +1,14 @@
1
1
  // @ts-check
2
- /// <reference types="@agoric/vats/src/core/types-ambient" />
3
2
 
4
3
  import { E } from '@endo/far';
5
4
  import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
6
5
 
6
+ /**
7
+ * @import {BootstrapPowers} from '@agoric/vats/src/core/types.js';
8
+ * @import {ChainBootstrapSpace} from '@agoric/vats/src/core/types.js';
9
+ * @import {VatSourceRef} from '@agoric/vats/src/core/types.js';
10
+ */
11
+
7
12
  /**
8
13
  * @param {BootstrapPowers & ChainBootstrapSpace} powers
9
14
  * @param {object} options
@@ -4,6 +4,14 @@ import { E } from '@endo/far';
4
4
  import { makeMarshal } from '@endo/marshal';
5
5
  import { allValues } from '@agoric/internal';
6
6
 
7
+ /**
8
+ * @import {NameHub} from '@agoric/vats';
9
+ * @import {BootstrapManifest} from '@agoric/vats/src/core/lib-boot.js';
10
+ * @import {ERef} from '@agoric/vow';
11
+ * @import {BootstrapPowers} from '@agoric/vats/src/core/types.js';
12
+ * @import {VatSourceRef} from '@agoric/vats/src/core/types.js';
13
+ */
14
+
7
15
  console.warn('upgrade-walletFactory-proposal.js module evaluating');
8
16
 
9
17
  // vstorage paths under published.*
@@ -88,7 +96,7 @@ export const publishAgoricBrandsDisplayInfo = async ({
88
96
  await E(node).setValue(JSON.stringify(aux));
89
97
  };
90
98
 
91
- /** @type {ERef<import('@agoric/vats').NameHub>} */
99
+ /** @type {ERef<NameHub>} */
92
100
  const brandHub = E(agoricNames).lookup('brand');
93
101
  const brands = await E(brandHub).values();
94
102
  // tolerate failure; in particular, for the timer brand
@@ -96,7 +104,7 @@ export const publishAgoricBrandsDisplayInfo = async ({
96
104
  };
97
105
  harden(publishAgoricBrandsDisplayInfo);
98
106
 
99
- /** @type {import('@agoric/vats/src/core/lib-boot').BootstrapManifest} */
107
+ /** @type {BootstrapManifest} */
100
108
  const manifest = {
101
109
  [upgradeWalletFactory.name]: {
102
110
  // include rationale for closely-held, high authority capabilities