@agoric/smart-wallet 0.5.4-u17.1 → 0.5.4-u18.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,13 +1,14 @@
1
1
  {
2
2
  "name": "@agoric/smart-wallet",
3
- "version": "0.5.4-u17.1",
3
+ "version": "0.5.4-u18.0",
4
4
  "description": "Wallet contract",
5
5
  "type": "module",
6
+ "main": "src/index.js",
6
7
  "scripts": {
7
8
  "build": "yarn build:bundles",
8
9
  "build:bundles": "node ./scripts/build-bundles.js",
9
10
  "prepack": "tsc --build tsconfig.build.json",
10
- "postpack": "git clean -f '*.d.ts*'",
11
+ "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
11
12
  "test": "ava",
12
13
  "test:xs": "exit 0",
13
14
  "lint": "run-s --continue-on-error lint:*",
@@ -16,31 +17,31 @@
16
17
  "lint:eslint": "eslint ."
17
18
  },
18
19
  "devDependencies": {
19
- "@agoric/cosmic-proto": "^0.5.0-u17.1",
20
- "@agoric/swingset-vat": "^0.33.0-u17.1",
21
- "@endo/bundle-source": "^3.4.0",
22
- "@endo/captp": "^4.3.0",
23
- "@endo/init": "^1.1.4",
20
+ "@agoric/cosmic-proto": "^0.5.0-u18.0",
21
+ "@agoric/swingset-vat": "^0.33.0-u18.0",
22
+ "@endo/bundle-source": "^3.4.2",
23
+ "@endo/captp": "^4.4.2",
24
+ "@endo/init": "^1.1.6",
24
25
  "ava": "^5.3.0",
25
26
  "import-meta-resolve": "^2.2.1"
26
27
  },
27
28
  "dependencies": {
28
- "@agoric/casting": "^0.4.3-u17.1",
29
- "@agoric/ertp": "^0.16.3-u17.1",
30
- "@agoric/internal": "^0.4.0-u17.1",
31
- "@agoric/notifier": "^0.7.0-u17.1",
32
- "@agoric/store": "^0.9.3-u17.1",
33
- "@agoric/vat-data": "^0.5.3-u17.1",
34
- "@agoric/vats": "^0.16.0-u17.1",
35
- "@agoric/vow": "^0.2.0-u17.1",
36
- "@agoric/zoe": "^0.26.3-u17.1",
37
- "@agoric/zone": "^0.3.0-u17.1",
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"
29
+ "@agoric/casting": "^0.4.3-u18.0",
30
+ "@agoric/ertp": "^0.16.3-u18.0",
31
+ "@agoric/internal": "^0.4.0-u18.0",
32
+ "@agoric/notifier": "^0.7.0-u18.0",
33
+ "@agoric/store": "^0.9.3-u18.0",
34
+ "@agoric/vat-data": "^0.5.3-u18.0",
35
+ "@agoric/vats": "^0.16.0-u18.0",
36
+ "@agoric/vow": "^0.2.0-u18.0",
37
+ "@agoric/zoe": "^0.26.3-u18.0",
38
+ "@agoric/zone": "^0.3.0-u18.0",
39
+ "@endo/errors": "^1.2.7",
40
+ "@endo/eventual-send": "^1.2.7",
41
+ "@endo/far": "^1.1.8",
42
+ "@endo/marshal": "^1.6.1",
43
+ "@endo/nat": "^5.0.12",
44
+ "@endo/promise-kit": "^1.1.7"
44
45
  },
45
46
  "files": [
46
47
  "src/"
@@ -71,5 +72,5 @@
71
72
  "typeCoverage": {
72
73
  "atLeast": 94.51
73
74
  },
74
- "gitHead": "5259430561693bfcf58516c3ea54123895859708"
75
+ "gitHead": "c22e7250188bbdb07bc021dffdb88af0309a7aa8"
75
76
  }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./types-index.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":""}
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // eslint-disable-next-line import/export
2
+ export * from './types-index.js'; // no named exports
@@ -1 +1 @@
1
- {"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["invitations.js"],"names":[],"mappings":"A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C,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;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,QAAQ,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;;;;;;;kCAGS;IACR,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;;;;;uCAOS;IACR,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,OAAO,aAAa,EAAE,OAAO,CAAC;IAC7C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;CACxB;oCAMS,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,UAAU,CAAC"}
@@ -10,7 +10,7 @@ export function makeExportContext(): {
10
10
  * @param {Purse} purse
11
11
  */
12
12
  initPurseId: (id: number, purse: Purse) => void;
13
- purseEntries: (keyPatt?: globalThis.Pattern, valuePatt?: globalThis.Pattern) => Iterable<[number, globalThis.Purse]>;
13
+ purseEntries: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[number, globalThis.Purse]>;
14
14
  /**
15
15
  * @param {BoardId} id
16
16
  * @param {RemotableObject} val
@@ -1 +1 @@
1
- {"version":3,"file":"marshal-contexts.d.ts","sourceRoot":"","sources":["marshal-contexts.js"],"names":[],"mappings":"AAuHO;;;;;;;IAoFH;;;OAGG;sBAFQ,MAAM,SACN,KAAK;;IAMhB;;;OAGG;sBAFQ,OAAO,OACP,eAAe;IAK1B;;;OAGG;wBAFQ,OAAO,OACP,eAAe;EAW7B;AAcM,0DAFY,MAAM,KAAK,WAAW;IA8FrC;;;OAGG;sBAFQ,OAAO,OACP,WAAW;IAKtB;;;OAGG;wBAFQ,OAAO,OACP,WAAW;;;;;;;;;;;;;;;;;;;;;;;EAYzB;AA4BM,2CAHI,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;IACZ,MAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAChC,KAAS,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;CAC5B;4BAgJU,UAAU,CAAC,OAAO,iBAAiB,CAAC;4BA+HpC,UAAU,CAAC,OAAO,iBAAiB,CAAC;6BA5VxB,+BAA+B;qCAFV,eAAe;iCAAf,eAAe;yBACxC,gBAAgB"}
1
+ {"version":3,"file":"marshal-contexts.d.ts","sourceRoot":"","sources":["marshal-contexts.js"],"names":[],"mappings":"AAuHO;;;;;;;IAoFH;;;OAGG;sBAFQ,MAAM,SACN,KAAK;;IAMhB;;;OAGG;sBAFQ,OAAO,OACP,eAAe;IAK1B;;;OAGG;wBAFQ,OAAO,OACP,eAAe;EAW7B;AAcM,0DAFY,MAAM,KAAK,WAAW;IA8FrC;;;OAGG;sBAFQ,OAAO,OACP,WAAW;IAKtB;;;OAGG;wBAFQ,OAAO,OACP,WAAW;;;;;;;;;;;;;;;;;;;;;;;EAYzB;AA4BM,2CAHI,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,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC5B,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;CAC5B;4BAgJU,UAAU,CAAC,OAAO,iBAAiB,CAAC;4BA+HpC,UAAU,CAAC,OAAO,iBAAiB,CAAC;6BA5VxB,+BAA+B;qCAFV,eAAe;iCAAf,eAAe;yBACxC,gBAAgB"}
@@ -1,7 +1,7 @@
1
1
  export function makeWatchOfferOutcomes(vowTools: VowTools): (watchers: OutcomeWatchers, seat: UserSeat) => Promise<any>;
2
2
  export function prepareOfferWatcher(baggage: Baggage, vowTools: VowTools): (walletHelper: any, deposit: {
3
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<{
4
+ }, offerSpec: OfferSpec, address: string, invitationAmount: import("@agoric/ertp").SetAmount<import("@endo/patterns").Key>, seatRef: UserSeat<unknown>) => import("@endo/exo").GuardedKit<{
5
5
  helper: {
6
6
  /**
7
7
  * @param {Record<string, unknown>} offerStatusUpdates
@@ -1 +1 @@
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;CAC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 @@
1
- {"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;sBAbnC,MAAM,GAAG,MAAM;wBAIf;IACZ,EAAM,EAAE,OAAO,CAAC;IAChB,cAAkB,EAAE,OAAO,kBAAkB,EAAE,cAAc,CAAC;IAC9D,QAAY,EAAE,QAAQ,CAAC;IACvB,SAAa,CAAC,EAAE,GAAG,CAAC;CACjB;0BAOS,SAAS,GAAG;IACxB,KAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,MAAU,CAAC,EAAE,OAAO,GAAG,OAAO,kBAAkB,CAAC;IACjD,OAAW,CAAC,EAAE,mBAAmB,CAAC;CAC/B"}
1
+ {"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["offers.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AAEH,kEAAkE;AAClE,+CAAgD;sBAbnC,MAAM,GAAG,MAAM;wBAIf;IACR,EAAE,EAAE,OAAO,CAAC;IACZ,cAAc,EAAE,OAAO,kBAAkB,EAAE,cAAc,CAAC;IAC1D,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB;0BAOS,SAAS,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,kBAAkB,CAAC;IAC7C,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B"}
@@ -62,12 +62,6 @@ export function prepareSmartWallet(baggage: import("@agoric/vat-data").Baggage,
62
62
  storagePath: Promise<string>;
63
63
  };
64
64
  };
65
- /**
66
- * To be called once ever per wallet.
67
- *
68
- * @param {object} key
69
- */
70
- repairWalletForIncarnation2(key: object): void;
71
65
  }>>;
72
66
  export type OfferId = number | string;
73
67
  export type OfferSpec = {
@@ -178,7 +172,6 @@ export type SharedParams = {
178
172
  invitationDisplayInfo: DisplayInfo;
179
173
  publicMarshaller: Marshaller;
180
174
  zoe: ERef<ZoeService>;
181
- secretWalletFactoryKey: any;
182
175
  };
183
176
  /**
184
177
  * - `brandPurses` is precious
@@ -1 +1 @@
1
- {"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"AA6PA,kDAAmD;AAiB5C,4CAHI,OAAO,kBAAkB,EAAE,OAAO,UAClC,YAAY,6BA48BV,IAAI,CACd,YAAgB,EAChB,oBAAwB,GAAG,mBAAmB,CAC3C,GAAG;IACN,iBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;CACtC;IA9HE;;;;;;;;OAQG;sCAJQ,OAAO,eAAe,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,mCAG5C,OAAO,CAAC,IAAI,CAAC;;QApR1B;;;;;;;;;WASG;yBAJQ,OAAO,GACL,OAAO,CAAC,MAAM,CAAC;;;QA8H5B;;;;;;;;;WASG;gCALQ,SAAS,GACP,OAAO,CAAC,IAAI,CAAC;QA0G1B;;;;;;WAMG;8BAHQ,OAAO,GACL,OAAO,CAAC,IAAI,CAAC;;IAkF1B,sCAAsC;;IAKtC,sCAAsC;;;;;;;;;;;;;;IAuBtC;;;;OAIG;qCADQ,MAAM;IAoDxB;sBAtrCa,MAAM,GAAG,MAAM;wBAGhB;IACZ,EAAM,EAAE,OAAO,CAAC;IAChB,cAAkB,EAAE,OAAO,eAAe,EAAE,cAAc,CAAC;IAC3D,QAAY,EAAE,QAAQ,CAAC;IACvB,SAAa,CAAC,EAAE,GAAG,CAAC;CACjB;6BAIS;IACZ,MAAU,EAAE;QACZ,IAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;QACrC,KAAW,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAA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EAAE,OAAO,6CAA6C,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACnG,kBAAkB,EAAE,OAAO,6CAA6C,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC3G,UAAU,EAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,cAAc,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACrD,iBAAiB,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;CAChE,CACF;0BAGS,eAAe,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE;2BAElC,EAAE;0BAg6BD,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;6BAtkChC,aAAa;iCAAb,aAAa"}
@@ -178,7 +178,6 @@ const trace = makeTracer('SmrtWlt');
178
178
  * invitationDisplayInfo: DisplayInfo;
179
179
  * publicMarshaller: Marshaller;
180
180
  * zoe: ERef<ZoeService>;
181
- * secretWalletFactoryKey: any;
182
181
  * }} SharedParams
183
182
  *
184
183
  *
@@ -279,12 +278,6 @@ export const prepareSmartWallet = (baggage, shared) => {
279
278
  invitationDisplayInfo: DisplayInfoShape,
280
279
  publicMarshaller: M.remotable('Marshaller'),
281
280
  zoe: M.eref(M.remotable('ZoeService')),
282
-
283
- // known only to smartWallets and walletFactory, this allows the
284
- // walletFactory to invoke functions on the self facet that no one else
285
- // can. Used to protect the upgrade-to-incarnation 2 repair. This can be
286
- // dropped once the repair has taken place.
287
- secretWalletFactoryKey: M.any(),
288
281
  }),
289
282
  );
290
283
  const zone = makeDurableZone(baggage);
@@ -443,8 +436,6 @@ export const prepareSmartWallet = (baggage, shared) => {
443
436
  publishCurrentState: M.call().returns(),
444
437
  watchPurse: M.call(M.eref(PurseShape)).returns(M.promise()),
445
438
  watchNextBalance: M.call(M.any(), NotifierShape, M.bigint()).returns(),
446
- repairUnwatchedSeats: M.call().returns(M.promise()),
447
- repairUnwatchedPurses: M.call().returns(M.promise()),
448
439
  updateStatus: M.call(M.any()).returns(),
449
440
  addContinuingOffer: M.call(
450
441
  M.or(M.number(), M.string()),
@@ -483,7 +474,6 @@ export const prepareSmartWallet = (baggage, shared) => {
483
474
  getCurrentSubscriber: M.call().returns(SubscriberShape),
484
475
  getUpdatesSubscriber: M.call().returns(SubscriberShape),
485
476
  getPublicTopics: M.call().returns(TopicsRecordShape),
486
- repairWalletForIncarnation2: M.call(M.any()).returns(),
487
477
  }),
488
478
  };
489
479
 
@@ -645,99 +635,6 @@ export const prepareSmartWallet = (baggage, shared) => {
645
635
  return purse;
646
636
  },
647
637
 
648
- /**
649
- * see https://github.com/Agoric/agoric-sdk/issues/8445 and
650
- * https://github.com/Agoric/agoric-sdk/issues/8286. As originally
651
- * released, the smartWallet didn't durably monitor the promises for the
652
- * outcomes of offers, and would have dropped them on upgrade of Zoe or
653
- * the smartWallet itself. Using watchedPromises, (see offerWatcher.js)
654
- * we've addressed the problem for new offers. This function will
655
- * backfill the solution for offers that were outstanding before the
656
- * transition to incarnation 2 of the smartWallet.
657
- */
658
- async repairUnwatchedSeats() {
659
- const { state, facets } = this;
660
- const { address, invitationPurse, liveOffers, liveOfferSeats } =
661
- state;
662
- const { zoe, agoricNames, invitationBrand, invitationIssuer } =
663
- shared;
664
-
665
- const invitationFromSpec = makeInvitationsHelper(
666
- zoe,
667
- agoricNames,
668
- invitationBrand,
669
- invitationPurse,
670
- state.offerToInvitationMakers.get,
671
- );
672
-
673
- const watcherPromises = [];
674
- for (const seatId of liveOfferSeats.keys()) {
675
- facets.helper.logWalletInfo(`repairing ${seatId}`);
676
- const offerSpec = liveOffers.get(seatId);
677
- const seat = liveOfferSeats.get(seatId);
678
-
679
- const watchOutcome = (async () => {
680
- await null;
681
- let invitationAmount = state.offerToUsedInvitation.has(
682
- // @ts-expect-error older type allowed number
683
- offerSpec.id,
684
- )
685
- ? state.offerToUsedInvitation.get(
686
- // @ts-expect-error older type allowed number
687
- offerSpec.id,
688
- )
689
- : undefined;
690
- if (invitationAmount) {
691
- facets.helper.logWalletInfo(
692
- 'recovered invitation amount for offer',
693
- offerSpec.id,
694
- );
695
- } else {
696
- facets.helper.logWalletInfo(
697
- 'inferring invitation amount for offer',
698
- offerSpec.id,
699
- );
700
- const tempInvitation = invitationFromSpec(
701
- offerSpec.invitationSpec,
702
- );
703
- invitationAmount =
704
- await E(invitationIssuer).getAmountOf(tempInvitation);
705
- void E(invitationIssuer).burn(tempInvitation);
706
- }
707
-
708
- const watcher = makeOfferWatcher(
709
- facets.helper,
710
- facets.deposit,
711
- offerSpec,
712
- address,
713
- invitationAmount,
714
- seat,
715
- );
716
- return watchOfferOutcomes(watcher, seat);
717
- })();
718
- trace(`Repaired seat ${seatId} for wallet ${address}`);
719
- watcherPromises.push(watchOutcome);
720
- }
721
-
722
- await Promise.all(watcherPromises);
723
- },
724
- async repairUnwatchedPurses() {
725
- const { state, facets } = this;
726
- const { helper, self } = facets;
727
- const { invitationPurse, address } = state;
728
-
729
- const brandToPurses = getBrandToPurses(walletPurses, self);
730
- trace(`Found ${brandToPurses.values()} purse(s) for ${address}`);
731
- for (const purses of brandToPurses.values()) {
732
- for (const record of purses) {
733
- void helper.watchPurse(record.purse);
734
- trace(`Repaired purse ${record.petname} of ${address}`);
735
- }
736
- }
737
-
738
- void helper.watchPurse(invitationPurse);
739
- },
740
-
741
638
  /** @param {OfferStatus} offerStatus */
742
639
  updateStatus(offerStatus) {
743
640
  const { state, facets } = this;
@@ -1204,27 +1101,6 @@ export const prepareSmartWallet = (baggage, shared) => {
1204
1101
  },
1205
1102
  });
1206
1103
  },
1207
- // TODO remove this and repairUnwatchedSeats once the repair has taken place.
1208
- /**
1209
- * To be called once ever per wallet.
1210
- *
1211
- * @param {object} key
1212
- */
1213
- repairWalletForIncarnation2(key) {
1214
- const { state, facets } = this;
1215
-
1216
- if (key !== shared.secretWalletFactoryKey) {
1217
- return;
1218
- }
1219
-
1220
- facets.helper.repairUnwatchedSeats().catch(e => {
1221
- console.error('repairUnwatchedSeats rejection', e);
1222
- });
1223
- facets.helper.repairUnwatchedPurses().catch(e => {
1224
- console.error('repairUnwatchedPurses rejection', e);
1225
- });
1226
- trace(`repaired wallet ${state.address}`);
1227
- },
1228
1104
  },
1229
1105
  },
1230
1106
  {
@@ -0,0 +1,2 @@
1
+ // Export all the types this package provides
2
+ export type * from './types.js';
@@ -0,0 +1,2 @@
1
+ // Empty JS file to correspond with its .d.ts twin
2
+ export {};
package/src/types.d.ts CHANGED
@@ -4,17 +4,9 @@
4
4
  * Similar to types.js but in TypeScript syntax because some types here need it.
5
5
  * Downside is it can't reference any ambient types, which most of agoric-sdk type are presently.
6
6
  */
7
-
8
- import type { ERef } from '@endo/far';
9
- import type { CapData } from '@endo/marshal';
10
- import type { agoric } from '@agoric/cosmic-proto';
11
7
  import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
12
- import type { StoredFacet } from '@agoric/internal/src/lib-chainStorage.js';
13
8
  import type { PublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
14
9
  import type { OfferSpec } from './offers.js';
15
-
16
- declare const CapDataShape: unique symbol;
17
-
18
10
  /**
19
11
  * A petname can either be a plain string or a path for which the first element
20
12
  * is a petname for the origin, and the rest of the elements are a snapshot of
@@ -22,54 +14,44 @@ declare const CapDataShape: unique symbol;
22
14
  * using plain strings, for consistency.
23
15
  */
24
16
  export type Petname = string | string[];
25
-
26
- export type InvitationMakers = Record<
27
- string,
28
- (...args: any[]) => Promise<Invitation>
29
- >;
30
-
31
- export type PublicSubscribers = Record<string, PublicTopic>;
32
-
17
+ export type InvitationMakers = Record<string, (...args: any[]) => Promise<Invitation>>;
18
+ export type PublicSubscribers = Record<string, PublicTopic<unknown>>;
33
19
  export interface ContinuingOfferResult {
34
- invitationMakers: InvitationMakers;
35
- publicSubscribers: PublicSubscribers;
20
+ invitationMakers: InvitationMakers;
21
+ publicSubscribers: PublicSubscribers;
36
22
  }
37
-
38
23
  export type Cell<T> = {
39
- get: () => T;
40
- set(val: T): void;
24
+ get: () => T;
25
+ set(val: T): void;
41
26
  };
42
-
43
27
  /**
44
28
  * Defined by walletAction struct in msg_server.go
45
29
  *
46
30
  * @see {agoric.swingset.MsgWalletAction} and walletSpendAction in msg_server.go
47
31
  */
48
32
  export type WalletActionMsg = {
49
- type: 'WALLET_ACTION';
50
- /** base64 of Uint8Array of bech32 data */
51
- owner: string;
52
- /** JSON of marshalled BridgeAction */
53
- action: string;
54
- blockHeight: unknown; // int64
55
- blockTime: unknown; // int64
33
+ type: 'WALLET_ACTION';
34
+ /** base64 of Uint8Array of bech32 data */
35
+ owner: string;
36
+ /** JSON of marshalled BridgeAction */
37
+ action: string;
38
+ blockHeight: unknown;
39
+ blockTime: unknown;
56
40
  };
57
-
58
41
  /**
59
42
  * Defined by walletSpendAction struct in msg_server.go
60
43
  *
61
44
  * @see {agoric.swingset.MsgWalletSpendAction} and walletSpendAction in msg_server.go
62
45
  */
63
46
  export type WalletSpendActionMsg = {
64
- type: 'WALLET_SPEND_ACTION';
65
- /** base64 of Uint8Array of bech32 data */
66
- owner: string;
67
- /** JSON of BridgeActionCapData */
68
- spendAction: string;
69
- blockHeight: unknown; // int64
70
- blockTime: unknown; // int64
47
+ type: 'WALLET_SPEND_ACTION';
48
+ /** base64 of Uint8Array of bech32 data */
49
+ owner: string;
50
+ /** JSON of BridgeActionCapData */
51
+ spendAction: string;
52
+ blockHeight: unknown;
53
+ blockTime: unknown;
71
54
  };
72
-
73
55
  /**
74
56
  * Messages transmitted over Cosmos chain, cryptographically verifying that the
75
57
  * message came from the 'owner'.
@@ -78,11 +60,8 @@ export type WalletSpendActionMsg = {
78
60
  * the sending of the message (as is the case for WALLET_SPEND_ACTION).
79
61
  */
80
62
  export type WalletBridgeMsg = WalletActionMsg | WalletSpendActionMsg;
81
-
82
63
  /**
83
64
  * Used for clientSupport helpers
84
65
  */
85
- export type OfferMaker = (
86
- agoricNames: AgoricNamesRemotes,
87
- ...rest: any[]
88
- ) => OfferSpec;
66
+ export type OfferMaker = (agoricNames: AgoricNamesRemotes, ...rest: any[]) => OfferSpec;
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAExC,MAAM,MAAM,gBAAgB,GAAG,MAAM,CACnC,MAAM,EACN,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IACpB,GAAG,EAAE,MAAM,CAAC,CAAC;IACb,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CACvB,WAAW,EAAE,kBAAkB,EAC/B,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,SAAS,CAAC"}
package/src/types.ts ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @file Some types for smart-wallet contract
3
+ *
4
+ * Similar to types.js but in TypeScript syntax because some types here need it.
5
+ * Downside is it can't reference any ambient types, which most of agoric-sdk type are presently.
6
+ */
7
+
8
+ import type { agoric } from '@agoric/cosmic-proto/agoric/bundle.js';
9
+ import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js';
10
+ import type { PublicTopic } from '@agoric/zoe/src/contractSupport/topics.js';
11
+ import type { OfferSpec } from './offers.js';
12
+
13
+ declare const CapDataShape: unique symbol;
14
+
15
+ /**
16
+ * A petname can either be a plain string or a path for which the first element
17
+ * is a petname for the origin, and the rest of the elements are a snapshot of
18
+ * the names that were first given by that origin. We are migrating away from
19
+ * using plain strings, for consistency.
20
+ */
21
+ export type Petname = string | string[];
22
+
23
+ export type InvitationMakers = Record<
24
+ string,
25
+ (...args: any[]) => Promise<Invitation>
26
+ >;
27
+
28
+ export type PublicSubscribers = Record<string, PublicTopic<unknown>>;
29
+
30
+ export interface ContinuingOfferResult {
31
+ invitationMakers: InvitationMakers;
32
+ publicSubscribers: PublicSubscribers;
33
+ }
34
+
35
+ export type Cell<T> = {
36
+ get: () => T;
37
+ set(val: T): void;
38
+ };
39
+
40
+ /**
41
+ * Defined by walletAction struct in msg_server.go
42
+ *
43
+ * @see {agoric.swingset.MsgWalletAction} and walletSpendAction in msg_server.go
44
+ */
45
+ export type WalletActionMsg = {
46
+ type: 'WALLET_ACTION';
47
+ /** base64 of Uint8Array of bech32 data */
48
+ owner: string;
49
+ /** JSON of marshalled BridgeAction */
50
+ action: string;
51
+ blockHeight: unknown; // int64
52
+ blockTime: unknown; // int64
53
+ };
54
+
55
+ /**
56
+ * Defined by walletSpendAction struct in msg_server.go
57
+ *
58
+ * @see {agoric.swingset.MsgWalletSpendAction} and walletSpendAction in msg_server.go
59
+ */
60
+ export type WalletSpendActionMsg = {
61
+ type: 'WALLET_SPEND_ACTION';
62
+ /** base64 of Uint8Array of bech32 data */
63
+ owner: string;
64
+ /** JSON of BridgeActionCapData */
65
+ spendAction: string;
66
+ blockHeight: unknown; // int64
67
+ blockTime: unknown; // int64
68
+ };
69
+
70
+ /**
71
+ * Messages transmitted over Cosmos chain, cryptographically verifying that the
72
+ * message came from the 'owner'.
73
+ *
74
+ * The two wallet actions are distinguished by whether the user had to confirm
75
+ * the sending of the message (as is the case for WALLET_SPEND_ACTION).
76
+ */
77
+ export type WalletBridgeMsg = WalletActionMsg | WalletSpendActionMsg;
78
+
79
+ /**
80
+ * Used for clientSupport helpers
81
+ */
82
+ export type OfferMaker = (
83
+ agoricNames: AgoricNamesRemotes,
84
+ ...rest: any[]
85
+ ) => OfferSpec;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAIA,yDAAyD;AAEzD,sDAAuD;AAKhD;;;wBAYc,OAAO;yBACN,MAAM;sBACT,QAAQ;;;;;2BAOd,OAAO,kBAAkB,EAAE,YAAY,GAAG,EAAE;EAgExD;AAaM,yCAHI,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,EAAE,YAAY,CAAC,CAAC;;oBAnF/C,OAAO;qBACN,MAAM;kBACT,QAAQ;;;;EA6F1B;AAMM,wCAHI,OAAO,iBAAiB,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAYjD;AASM,2KAFM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAW/C;mCAtDa,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,OAAO,CAAC;6BA7F1B,aAAa;iCAAb,aAAa"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAIA,yDAAyD;AAEzD,sDAAuD;AAKhD;;;wBAYc,OAAO;yBACN,MAAM;sBACT,QAAQ;;;;;2BAOd,OAAO,kBAAkB,EAAE,YAAY,GAAG,EAAE;EAgExD;AAaM,yCAHI,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,EAAE,YAAY,CAAC,CAAC;;oBAnF/C,OAAO;qBACN,MAAM;kBACT,QAAQ;;;;EA6F1B;AAMM,wCAHI,OAAO,iBAAiB,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAYjD;AASM,2KAFM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAY/C;mCAvDa,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,OAAO,CAAC;6BA7F1B,aAAa;iCAAb,aAAa"}
package/src/utils.js CHANGED
@@ -146,6 +146,7 @@ export const objectMapStoragePath = subscribers => {
146
146
  }
147
147
  return deeplyFulfilledObject(
148
148
  objectMap(subscribers, sub =>
149
+ // @ts-expect-error backwards compat
149
150
  'subscriber' in sub ? sub.storagePath : E(sub).getPath(),
150
151
  ),
151
152
  );
@@ -1 +1 @@
1
- {"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AA6BA,gEAKE;AAaK,6CAJI,MAAM,UACN,OAAO,kBAAkB,EAAE,WAAW,uBACtC,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,oBAehD;AAWM,kDAFI,cAAc;IAyCrB,2BAA2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IACR,YAAY,EAAE,CACZ,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,OAAO,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACrD,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC;CAC1C;oBAkMU,OAAO,OAAO;6BA3TD,cAAc"}
@@ -35,7 +35,6 @@ export const privateArgsShape = harden(
35
35
  );
36
36
 
37
37
  const WALLETS_BY_ADDRESS = 'walletsByAddress';
38
- const UPGRADE_TO_INCARNATION_TWO = 'upgrade to incarnation two';
39
38
 
40
39
  /**
41
40
  * Provide a NameHub for this address and insert depositFacet only if not
@@ -238,15 +237,6 @@ export const prepare = async (zcf, privateArgs, baggage) => {
238
237
 
239
238
  const registry = makeAssetRegistry(assetPublisher);
240
239
 
241
- /**
242
- * An object known only to walletFactory and smartWallets. The WalletFactory
243
- * only has the self facet for the pre-existing wallets that must be repaired.
244
- * Self is too accessible, so use of the repair function requires use of a
245
- * secret that clients won't have. This can be removed once the upgrade has
246
- * taken place.
247
- */
248
- const upgradeToIncarnation2Key = harden({});
249
-
250
240
  const shared = harden({
251
241
  agoricNames,
252
242
  invitationBrand,
@@ -255,7 +245,6 @@ export const prepare = async (zcf, privateArgs, baggage) => {
255
245
  publicMarshaller,
256
246
  registry,
257
247
  zoe,
258
- secretWalletFactoryKey: upgradeToIncarnation2Key,
259
248
  });
260
249
 
261
250
  /**
@@ -266,22 +255,6 @@ export const prepare = async (zcf, privateArgs, baggage) => {
266
255
  */
267
256
  const makeSmartWallet = prepareSmartWallet(baggage, shared);
268
257
 
269
- // One time repair for incarnation 2. We're adding WatchedPromises to allow
270
- // wallets to durably monitor offer outcomes, but wallets that already exist
271
- // need to be backfilled. This code needs to run once at the beginning of
272
- // incarnation 2, and then shouldn't be needed again.
273
- if (!baggage.has(UPGRADE_TO_INCARNATION_TWO)) {
274
- trace('Wallet Factory upgrading to incarnation 2');
275
-
276
- // This could take a while, depending on how many outstanding wallets exist.
277
- // The current plan is that it will run exactly once, and inside an upgrade
278
- // handler, between blocks.
279
- for (const wallet of walletsByAddress.values()) {
280
- wallet.repairWalletForIncarnation2(upgradeToIncarnation2Key);
281
- }
282
- baggage.init(UPGRADE_TO_INCARNATION_TWO, 'done');
283
- }
284
-
285
258
  const creatorFacet = prepareExo(
286
259
  baggage,
287
260
  'walletFactoryCreator',