@agoric/smart-wallet 0.5.4-dev-5f82b4d.0.5f82b4d → 0.5.4-dev-37d3a13.0.37d3a13

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/smart-wallet",
3
- "version": "0.5.4-dev-5f82b4d.0.5f82b4d",
3
+ "version": "0.5.4-dev-37d3a13.0.37d3a13",
4
4
  "description": "Wallet contract",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -18,9 +18,9 @@
18
18
  "lint:eslint": "yarn run -T eslint ."
19
19
  },
20
20
  "devDependencies": {
21
- "@agoric/casting": "0.4.3-dev-5f82b4d.0.5f82b4d",
22
- "@agoric/cosmic-proto": "0.4.1-dev-5f82b4d.0.5f82b4d",
23
- "@agoric/swingset-vat": "0.32.3-dev-5f82b4d.0.5f82b4d",
21
+ "@agoric/casting": "0.4.3-dev-37d3a13.0.37d3a13",
22
+ "@agoric/cosmic-proto": "0.4.1-dev-37d3a13.0.37d3a13",
23
+ "@agoric/swingset-vat": "0.32.3-dev-37d3a13.0.37d3a13",
24
24
  "@endo/bundle-source": "^4.1.2",
25
25
  "@endo/captp": "^4.4.8",
26
26
  "@endo/init": "^1.1.12",
@@ -28,15 +28,15 @@
28
28
  "import-meta-resolve": "^4.1.0"
29
29
  },
30
30
  "dependencies": {
31
- "@agoric/ertp": "0.16.3-dev-5f82b4d.0.5f82b4d",
32
- "@agoric/internal": "0.3.3-dev-5f82b4d.0.5f82b4d",
33
- "@agoric/notifier": "0.6.3-dev-5f82b4d.0.5f82b4d",
34
- "@agoric/store": "0.9.3-dev-5f82b4d.0.5f82b4d",
35
- "@agoric/vat-data": "0.5.3-dev-5f82b4d.0.5f82b4d",
36
- "@agoric/vats": "0.15.2-dev-5f82b4d.0.5f82b4d",
37
- "@agoric/vow": "0.1.1-dev-5f82b4d.0.5f82b4d",
38
- "@agoric/zoe": "0.26.3-dev-5f82b4d.0.5f82b4d",
39
- "@agoric/zone": "0.2.3-dev-5f82b4d.0.5f82b4d",
31
+ "@agoric/ertp": "0.16.3-dev-37d3a13.0.37d3a13",
32
+ "@agoric/internal": "0.3.3-dev-37d3a13.0.37d3a13",
33
+ "@agoric/notifier": "0.6.3-dev-37d3a13.0.37d3a13",
34
+ "@agoric/store": "0.9.3-dev-37d3a13.0.37d3a13",
35
+ "@agoric/vat-data": "0.5.3-dev-37d3a13.0.37d3a13",
36
+ "@agoric/vats": "0.15.2-dev-37d3a13.0.37d3a13",
37
+ "@agoric/vow": "0.1.1-dev-37d3a13.0.37d3a13",
38
+ "@agoric/zoe": "0.26.3-dev-37d3a13.0.37d3a13",
39
+ "@agoric/zone": "0.2.3-dev-37d3a13.0.37d3a13",
40
40
  "@endo/errors": "^1.2.13",
41
41
  "@endo/eventual-send": "^1.3.4",
42
42
  "@endo/far": "^1.1.14",
@@ -77,5 +77,5 @@
77
77
  "engines": {
78
78
  "node": "^20.9 || ^22.11"
79
79
  },
80
- "gitHead": "5f82b4d67f29e8ed8e321c83a3612c18c2dad72d"
80
+ "gitHead": "37d3a131d05b62f1e1353b69cf49f599c96011cc"
81
81
  }
package/src/utils.d.ts CHANGED
@@ -1,49 +1,21 @@
1
- /**
2
- * @import {OfferId, OfferStatus} from './offers.js';
3
- * @import {UpdateRecord} from './smartWallet.js';
4
- * @import {Follower} from '@agoric/casting';
5
- * @import {Subscriber} from '@agoric/notifier';
6
- * @import {PublicSubscribers} from './types.js';
7
- * @import {TopicsRecord} from '@agoric/zoe/src/contractSupport/index.js';
8
- * @import {Instance} from '@agoric/zoe';
9
- * @import {Brand} from '@agoric/ertp';
10
- * @import {Amount} from '@agoric/ertp';
11
- * @import {ERef} from '@agoric/vow';
12
- */
13
- export const NO_SMART_WALLET_ERROR: "no smart wallet";
14
- export function makeWalletStateCoalescer(invitationBrand?: Brand<"set">): {
15
- state: {
16
- invitationsReceived: Map<string, {
17
- acceptedIn: OfferId;
18
- description: string;
19
- instance: Instance;
20
- }>;
21
- offerStatuses: Map<OfferId, OfferStatus>;
22
- balances: Map<Brand, Amount>;
23
- };
24
- update: (updateRecord: UpdateRecord | {}) => void;
25
- };
26
1
  export function coalesceUpdates(updates: ERef<Subscriber<UpdateRecord>>, invitationBrand?: Brand<"set">): {
27
2
  invitationsReceived: Map<string, {
28
- acceptedIn: OfferId;
3
+ acceptedIn?: OfferId;
29
4
  description: string;
30
5
  instance: Instance;
31
6
  }>;
32
7
  offerStatuses: Map<OfferId, OfferStatus>;
33
8
  balances: Map<Brand, Amount>;
34
9
  };
35
- export function assertHasData(follower: Follower<any>): Promise<void>;
36
10
  export function objectMapStoragePath(subscribers?: PublicSubscribers | TopicsRecord): ERef<Record<string, string>> | null;
37
- export type CoalescedWalletState = ReturnType<typeof makeWalletStateCoalescer>["state"];
11
+ import type { UpdateRecord } from './smartWallet.js';
12
+ import type { Subscriber } from '@agoric/notifier';
13
+ import type { ERef } from '@agoric/vow';
38
14
  import type { Brand } from '@agoric/ertp';
39
15
  import type { OfferId } from './offers.js';
40
16
  import type { Instance } from '@agoric/zoe';
41
17
  import type { OfferStatus } from './offers.js';
42
18
  import type { Amount } from '@agoric/ertp';
43
- import type { UpdateRecord } from './smartWallet.js';
44
- import type { Subscriber } from '@agoric/notifier';
45
- import type { ERef } from '@agoric/vow';
46
- import type { Follower } from '@agoric/casting';
47
19
  import type { PublicSubscribers } from './types.js';
48
20
  import type { TopicsRecord } from '@agoric/zoe/src/contractSupport/index.js';
49
21
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,oCAAqC,iBAAiB,CAAC;AAKhD,2DADK,MAAM,KAAK,CAAC;;;wBAaH,OAAO;yBACN,MAAM;sBACT,QAAQ;;;;;2BAOd,YAAY,GAAG,EAAE;EA+D7B;AAaM,yCAHI,KAAK,WAAW,YAAY,CAAC,CAAC,oBAC9B,MAAM,KAAK,CAAC;;oBAnFF,OAAO;qBACN,MAAM;kBACT,QAAQ;;;;EA4F1B;AAMM,wCAHI,SAAS,GAAG,CAAC,iBAYvB;AAQM,mDAHI,iBAAiB,GAAG,YAAY,GAC9B,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAY/C;mCAtDa,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,OAAO,CAAC;2BA/F1C,cAAc;6BAPC,aAAa;8BAMzB,aAAa;iCAND,aAAa;4BAQ3B,cAAc;kCAPR,kBAAkB;gCAEpB,kBAAkB;0BAMxB,aAAa;8BAPT,iBAAiB;uCAER,YAAY;kCACjB,0CAA0C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAmHO,yCAHI,KAAK,WAAW,YAAY,CAAC,CAAC,oBAC9B,MAAM,KAAK,CAAC;;qBAlFD,OAAO;qBACP,MAAM;kBACT,QAAQ;;;;EA2F1B;AAQM,mDAHI,iBAAiB,GAAG,YAAY,GAC9B,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAY/C;kCAxI8B,kBAAkB;gCACpB,kBAAkB;0BAMxB,aAAa;2BAFZ,cAAc;6BANC,aAAa;8BAKzB,aAAa;iCALD,aAAa;4BAO3B,cAAc;uCAJH,YAAY;kCACjB,0CAA0C"}
package/src/utils.js CHANGED
@@ -1,11 +1,10 @@
1
- import { deeplyFulfilledObject, objectMap, makeTracer } from '@agoric/internal';
1
+ import { deeplyFulfilledObject, makeTracer, objectMap } from '@agoric/internal';
2
2
  import { observeIteration, subscribeEach } from '@agoric/notifier';
3
3
  import { E } from '@endo/far';
4
4
 
5
5
  /**
6
6
  * @import {OfferId, OfferStatus} from './offers.js';
7
7
  * @import {UpdateRecord} from './smartWallet.js';
8
- * @import {Follower} from '@agoric/casting';
9
8
  * @import {Subscriber} from '@agoric/notifier';
10
9
  * @import {PublicSubscribers} from './types.js';
11
10
  * @import {TopicsRecord} from '@agoric/zoe/src/contractSupport/index.js';
@@ -15,12 +14,10 @@ import { E } from '@endo/far';
15
14
  * @import {ERef} from '@agoric/vow';
16
15
  */
17
16
 
18
- export const NO_SMART_WALLET_ERROR = 'no smart wallet';
19
-
20
17
  const trace = makeTracer('WUTIL', false);
21
18
 
22
19
  /** @param {Brand<'set'>} [invitationBrand] */
23
- export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
20
+ const makeCoalescer = (invitationBrand = undefined) => {
24
21
  /** @type {Map<OfferId, OfferStatus>} */
25
22
  const offerStatuses = new Map();
26
23
  /** @type {Map<Brand, Amount>} */
@@ -32,7 +29,7 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
32
29
  * @type {Map<
33
30
  * string,
34
31
  * {
35
- * acceptedIn: OfferId;
32
+ * acceptedIn?: OfferId;
36
33
  * description: string;
37
34
  * instance: Instance;
38
35
  * }
@@ -105,7 +102,6 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
105
102
  update,
106
103
  };
107
104
  };
108
- /** @typedef {ReturnType<typeof makeWalletStateCoalescer>['state']} CoalescedWalletState */
109
105
 
110
106
  /**
111
107
  * Coalesce updates from a wallet UpdateRecord publication feed. Note that local
@@ -118,7 +114,7 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
118
114
  * @param {Brand<'set'>} [invitationBrand]
119
115
  */
120
116
  export const coalesceUpdates = (updates, invitationBrand) => {
121
- const coalescer = makeWalletStateCoalescer(invitationBrand);
117
+ const coalescer = makeCoalescer(invitationBrand);
122
118
 
123
119
  void observeIteration(subscribeEach(updates), {
124
120
  updateState: updateRecord => {
@@ -128,21 +124,6 @@ export const coalesceUpdates = (updates, invitationBrand) => {
128
124
  return coalescer.state;
129
125
  };
130
126
 
131
- /**
132
- * @param {Follower<any>} follower
133
- * @throws if there is no first height
134
- */
135
- export const assertHasData = async follower => {
136
- const eachIterable = E(follower).getReverseIterable();
137
- const iterator = await E(eachIterable)[Symbol.asyncIterator]();
138
- const el = await iterator.next();
139
-
140
- // done before we started
141
- if (el.done && !el.value) {
142
- assert.fail(NO_SMART_WALLET_ERROR);
143
- }
144
- };
145
-
146
127
  /**
147
128
  * Handles the case of falsy argument so the caller can consistently await.
148
129
  *