@agoric/smart-wallet 0.5.4-u15.0 → 0.5.4-u16.1

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/src/utils.js CHANGED
@@ -1,15 +1,16 @@
1
- /* eslint-disable no-undef-init */
2
1
  import { deeplyFulfilledObject, objectMap, makeTracer } from '@agoric/internal';
3
2
  import { observeIteration, subscribeEach } from '@agoric/notifier';
4
3
  import { E } from '@endo/far';
5
4
 
5
+ /** @import {OfferId, OfferStatus} from './offers.js'; */
6
+
6
7
  export const NO_SMART_WALLET_ERROR = 'no smart wallet';
7
8
 
8
9
  const trace = makeTracer('WUTIL', false);
9
10
 
10
11
  /** @param {Brand<'set'>} [invitationBrand] */
11
12
  export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
12
- /** @type {Map<import('./offers').OfferId, import('./offers').OfferStatus>} */
13
+ /** @type {Map<OfferId, OfferStatus>} */
13
14
  const offerStatuses = new Map();
14
15
  /** @type {Map<Brand, Amount>} */
15
16
  const balances = new Map();
@@ -17,11 +18,21 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
17
18
  /**
18
19
  * keyed by description; xxx assumes unique
19
20
  *
20
- * @type {Map<import('./offers').OfferId, { acceptedIn: import('./offers').OfferId, description: string, instance: Instance }>}
21
+ * @type {Map<
22
+ * OfferId,
23
+ * {
24
+ * acceptedIn: OfferId;
25
+ * description: string;
26
+ * instance: Instance;
27
+ * }
28
+ * >}
21
29
  */
22
30
  const invitationsReceived = new Map();
23
31
 
24
- /** @param {import('./smartWallet').UpdateRecord | {}} updateRecord newer than previous */
32
+ /**
33
+ * @param {import('./smartWallet.js').UpdateRecord | {}} updateRecord newer
34
+ * than previous
35
+ */
25
36
  const update = updateRecord => {
26
37
  if (!('updated' in updateRecord)) {
27
38
  return;
@@ -93,7 +104,7 @@ export const makeWalletStateCoalescer = (invitationBrand = undefined) => {
93
104
  * If this proves to be a problem we can add an option to this or a related
94
105
  * utility to reset state from RPC.
95
106
  *
96
- * @param {ERef<Subscriber<import('./smartWallet').UpdateRecord>>} updates
107
+ * @param {ERef<Subscriber<import('./smartWallet.js').UpdateRecord>>} updates
97
108
  * @param {Brand<'set'>} [invitationBrand]
98
109
  */
99
110
  export const coalesceUpdates = (updates, invitationBrand) => {
@@ -125,7 +136,8 @@ export const assertHasData = async follower => {
125
136
  /**
126
137
  * Handles the case of falsy argument so the caller can consistently await.
127
138
  *
128
- * @param {import('./types.js').PublicSubscribers | import('@agoric/zoe/src/contractSupport').TopicsRecord} [subscribers]
139
+ * @param {import('./types.js').PublicSubscribers
140
+ * | import('@agoric/zoe/src/contractSupport/index.js').TopicsRecord} [subscribers]
129
141
  * @returns {ERef<Record<string, string>> | null}
130
142
  */
131
143
  export const objectMapStoragePath = subscribers => {
@@ -1,10 +1,10 @@
1
1
  export namespace customTermsShape {
2
- const agoricNames: any;
3
- const board: any;
4
- const assetPublisher: any;
2
+ let agoricNames: globalThis.Pattern;
3
+ let board: globalThis.Pattern;
4
+ let assetPublisher: globalThis.Pattern;
5
5
  }
6
6
  export const privateArgsShape: import("@endo/patterns").Matcher;
7
- export function publishDepositFacet(address: string, wallet: import('./smartWallet.js').SmartWallet, namesByAddressAdmin: ERef<import('@agoric/vats').NameAdmin>): Promise<unknown>;
7
+ export function publishDepositFacet(address: string, wallet: import("./smartWallet.js").SmartWallet, namesByAddressAdmin: ERef<import("@agoric/vats").NameAdmin>): Promise<unknown>;
8
8
  export function makeAssetRegistry(assetPublisher: AssetPublisher): {
9
9
  /** @param {Brand} brand */
10
10
  has: (brand: Brand) => boolean;
@@ -13,103 +13,47 @@ export function makeAssetRegistry(assetPublisher: AssetPublisher): {
13
13
  brand: Brand;
14
14
  displayInfo: DisplayInfo;
15
15
  issuer: Issuer;
16
- petname: import('./types').Petname;
16
+ petname: import("./types.js").Petname;
17
17
  };
18
18
  values: () => Iterable<{
19
19
  brand: Brand;
20
20
  displayInfo: DisplayInfo;
21
21
  issuer: Issuer;
22
- petname: import('./types').Petname;
22
+ petname: import("./types.js").Petname;
23
23
  }>;
24
24
  };
25
25
  export function prepare(zcf: ZCF<SmartWalletContractTerms>, privateArgs: {
26
26
  storageNode: ERef<StorageNode>;
27
- walletBridgeManager?: ERef<import("@agoric/vats").ScopedBridgeManager> | undefined;
28
- walletReviver?: ERef<WalletReviver> | undefined;
29
- }, baggage: MapStore<string, unknown>): Promise<{
30
- creatorFacet: {
27
+ walletBridgeManager?: ERef<import("@agoric/vats").ScopedBridgeManager<"wallet">>;
28
+ walletReviver?: ERef<WalletReviver>;
29
+ }, baggage: import("@agoric/vat-data").Baggage): Promise<{
30
+ creatorFacet: import("@endo/exo").Guarded<{
31
31
  /**
32
32
  * @param {string} address
33
- * @param {ERef<import('@agoric/vats/src/vat-bank').Bank>} bank
34
- * @param {ERef<import('@agoric/vats/').NameAdmin>} namesByAddressAdmin
35
- * @returns {Promise<[wallet: import('./smartWallet').SmartWallet, isNew: boolean]>} wallet
36
- * along with a flag to distinguish between looking up an existing wallet
37
- * and creating a new one.
33
+ * @param {ERef<import('@agoric/vats/src/vat-bank.js').Bank>} bank
34
+ * @param {ERef<import('@agoric/vats/src/types.js').NameAdmin>} namesByAddressAdmin
35
+ * @returns {Promise<
36
+ * [wallet: import('./smartWallet.js').SmartWallet, isNew: boolean]
37
+ * >}
38
+ * wallet along with a flag to distinguish between looking up an existing
39
+ * wallet and creating a new one.
38
40
  */
39
- provideSmartWallet(address: string, bank: ERef<import('@agoric/vats/src/vat-bank').Bank>, namesByAddressAdmin: ERef<import('@agoric/vats/').NameAdmin>): Promise<[wallet: {
40
- handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string>, canSpend?: boolean | undefined): Promise<void>;
41
- getDepositFacet(): {
42
- receive(payment: Payment<AssetKind>): Promise<Amount<AssetKind>>;
43
- };
44
- getOffersFacet(): {
45
- executeOffer(offerSpec: import("./smartWallet.js").OfferSpec): Promise<void>;
46
- tryExitOffer(offerId: import("./smartWallet.js").OfferId): Promise<void>;
47
- };
48
- getCurrentSubscriber(): Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
49
- getUpdatesSubscriber(): Subscriber<import("./smartWallet.js").UpdateRecord>;
50
- getPublicTopics(): {
51
- current: {
52
- description: string;
53
- subscriber: Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
54
- storagePath: Promise<string>;
55
- };
56
- updates: {
57
- description: string;
58
- subscriber: Subscriber<import("./smartWallet.js").UpdateRecord>;
59
- storagePath: Promise<string>;
60
- };
61
- };
62
- repairWalletForIncarnation2(key: any): void;
63
- }, isNew: boolean]>;
64
- } & import("@endo/eventual-send").RemotableBrand<{}, {
65
- /**
66
- * @param {string} address
67
- * @param {ERef<import('@agoric/vats/src/vat-bank').Bank>} bank
68
- * @param {ERef<import('@agoric/vats/').NameAdmin>} namesByAddressAdmin
69
- * @returns {Promise<[wallet: import('./smartWallet').SmartWallet, isNew: boolean]>} wallet
70
- * along with a flag to distinguish between looking up an existing wallet
71
- * and creating a new one.
72
- */
73
- provideSmartWallet(address: string, bank: ERef<import('@agoric/vats/src/vat-bank').Bank>, namesByAddressAdmin: ERef<import('@agoric/vats/').NameAdmin>): Promise<[wallet: {
74
- handleBridgeAction(actionCapData: import("@endo/marshal").CapData<string>, canSpend?: boolean | undefined): Promise<void>;
75
- getDepositFacet(): {
76
- receive(payment: Payment<AssetKind>): Promise<Amount<AssetKind>>;
77
- };
78
- getOffersFacet(): {
79
- executeOffer(offerSpec: import("./smartWallet.js").OfferSpec): Promise<void>;
80
- tryExitOffer(offerId: import("./smartWallet.js").OfferId): Promise<void>;
81
- };
82
- getCurrentSubscriber(): Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
83
- getUpdatesSubscriber(): Subscriber<import("./smartWallet.js").UpdateRecord>;
84
- getPublicTopics(): {
85
- current: {
86
- description: string;
87
- subscriber: Subscriber<import("./smartWallet.js").CurrentWalletRecord>;
88
- storagePath: Promise<string>;
89
- };
90
- updates: {
91
- description: string;
92
- subscriber: Subscriber<import("./smartWallet.js").UpdateRecord>;
93
- storagePath: Promise<string>;
94
- };
95
- };
96
- repairWalletForIncarnation2(key: any): void;
97
- }, isNew: boolean]>;
41
+ provideSmartWallet(address: string, bank: ERef<import("@agoric/vats/src/vat-bank.js").Bank>, namesByAddressAdmin: ERef<import("@agoric/vats/src/types.js").NameAdmin>): Promise<[wallet: import("./smartWallet.js").SmartWallet, isNew: boolean]>;
98
42
  }>;
99
43
  }>;
100
44
  export type SmartWalletContractTerms = {
101
45
  agoricNames: ERef<NameHub>;
102
- board: ERef<import('@agoric/vats').Board>;
46
+ board: ERef<import("@agoric/vats").Board>;
103
47
  assetPublisher: AssetPublisher;
104
48
  };
105
- export type NameHub = import('@agoric/vats').NameHub;
106
49
  export type AssetPublisher = {
107
- getAssetSubscription: () => ERef<IterableEachTopic<import('@agoric/vats/src/vat-bank').AssetDescriptor>>;
50
+ getAssetSubscription: () => ERef<IterableEachTopic<import("@agoric/vats/src/vat-bank.js").AssetDescriptor>>;
108
51
  };
109
- export type isRevive = boolean;
52
+ export type IsRevive = boolean;
110
53
  export type WalletReviver = {
111
- reviveWallet: (address: string) => Promise<import('./smartWallet').SmartWallet>;
112
- ackWallet: (address: string) => isRevive;
54
+ reviveWallet: (address: string) => Promise<import("./smartWallet.js").SmartWallet>;
55
+ ackWallet: (address: string) => IsRevive;
113
56
  };
114
57
  export type start = typeof prepare;
58
+ import type { NameHub } from '@agoric/vats';
115
59
  //# sourceMappingURL=walletFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AA2BA,gEAKE;AAaK,6CAJI,MAAM,UACN,OAAO,kBAAkB,EAAE,WAAW,uBACtC,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC,oBAehD;AAWM,kDAFI,cAAc;IAwCrB,2BAA2B;iBAAf,KAAK;IAEjB,2BAA2B;iBAAf,KAAK;eApCP,KAAK;qBACC,WAAW;gBACh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test uses a slightly modified copy of this file. When the
7
- * interface changes here, that will also need to change.
6
+ * Note: The upgrade test uses a slightly modified copy of this file. When the
7
+ * interface changes here, that will also need to change.
8
8
  */
9
9
 
10
10
  import { makeTracer, WalletName } from '@agoric/internal';
@@ -17,6 +17,8 @@ import { E } from '@endo/far';
17
17
  import { prepareSmartWallet } from './smartWallet.js';
18
18
  import { shape } from './typeGuards.js';
19
19
 
20
+ /** @import {NameHub} from '@agoric/vats'; */
21
+
20
22
  const trace = makeTracer('WltFct');
21
23
 
22
24
  export const customTermsShape = harden({
@@ -62,8 +64,8 @@ export const publishDepositFacet = async (
62
64
  * Make a registry for use by the wallet instances.
63
65
  *
64
66
  * This doesn't need to persist durably because the `assetPublisher` has a
65
- * "pinned" topic and call to getAssetSubscription gets a fresh stream of all the
66
- * assets that it knows of.
67
+ * "pinned" topic and call to getAssetSubscription gets a fresh stream of all
68
+ * the assets that it knows of.
67
69
  *
68
70
  * @param {AssetPublisher} assetPublisher
69
71
  */
@@ -71,12 +73,13 @@ export const makeAssetRegistry = assetPublisher => {
71
73
  trace('makeAssetRegistry', assetPublisher);
72
74
  /**
73
75
  * @typedef {{
74
- * brand: Brand,
75
- * displayInfo: DisplayInfo,
76
- * issuer: Issuer,
77
- * petname: import('./types').Petname
76
+ * brand: Brand;
77
+ * displayInfo: DisplayInfo;
78
+ * issuer: Issuer;
79
+ * petname: import('./types.js').Petname;
78
80
  * }} BrandDescriptor
79
- * For use by clients to describe brands to users. Includes `displayInfo` to save a remote call.
81
+ * For use by clients to describe brands to users. Includes `displayInfo` to
82
+ * save a remote call.
80
83
  */
81
84
  /** @type {MapStore<Brand, BrandDescriptor>} */
82
85
  const brandDescriptors = makeScalarMapStore();
@@ -116,22 +119,26 @@ export const makeAssetRegistry = assetPublisher => {
116
119
 
117
120
  /**
118
121
  * @typedef {{
119
- * agoricNames: ERef<NameHub>,
120
- * board: ERef<import('@agoric/vats').Board>,
121
- * assetPublisher: AssetPublisher,
122
+ * agoricNames: ERef<NameHub>;
123
+ * board: ERef<import('@agoric/vats').Board>;
124
+ * assetPublisher: AssetPublisher;
122
125
  * }} SmartWalletContractTerms
123
126
  *
124
- * @typedef {import('@agoric/vats').NameHub} NameHub
125
127
  *
126
128
  * @typedef {{
127
129
  * getAssetSubscription: () => ERef<
128
- * IterableEachTopic<import('@agoric/vats/src/vat-bank').AssetDescriptor>>
130
+ * IterableEachTopic<import('@agoric/vats/src/vat-bank.js').AssetDescriptor>
131
+ * >;
129
132
  * }} AssetPublisher
130
133
  *
131
- * @typedef {boolean} isRevive
134
+ *
135
+ * @typedef {boolean} IsRevive
136
+ *
132
137
  * @typedef {{
133
- * reviveWallet: (address: string) => Promise<import('./smartWallet').SmartWallet>,
134
- * ackWallet: (address: string) => isRevive,
138
+ * reviveWallet: (
139
+ * address: string,
140
+ * ) => Promise<import('./smartWallet.js').SmartWallet>;
141
+ * ackWallet: (address: string) => IsRevive;
135
142
  * }} WalletReviver
136
143
  */
137
144
 
@@ -141,9 +148,11 @@ export const makeAssetRegistry = assetPublisher => {
141
148
  /**
142
149
  * @param {ZCF<SmartWalletContractTerms>} zcf
143
150
  * @param {{
144
- * storageNode: ERef<StorageNode>,
145
- * walletBridgeManager?: ERef<import('@agoric/vats').ScopedBridgeManager>,
146
- * walletReviver?: ERef<WalletReviver>,
151
+ * storageNode: ERef<StorageNode>;
152
+ * walletBridgeManager?: ERef<
153
+ * import('@agoric/vats').ScopedBridgeManager<'wallet'>
154
+ * >;
155
+ * walletReviver?: ERef<WalletReviver>;
147
156
  * }} privateArgs
148
157
  * @param {import('@agoric/vat-data').Baggage} baggage
149
158
  */
@@ -167,17 +176,20 @@ export const prepare = async (zcf, privateArgs, baggage) => {
167
176
  /**
168
177
  * Designed to be called by the bridgeManager vat.
169
178
  *
170
- * If this errors before calling handleBridgeAction(), the failure will not be observable. The
171
- * promise does reject, but as of now bridge manager drops instead of handling it. Eventually
172
- * we'll make the bridge able to give feedback about the requesting transaction. Meanwhile we
173
- * could write the error to chainStorage but we don't have a guarantee of the wallet owner to
174
- * associate it with. (We could have a shared `lastError` node but it would be so noisy as to
175
- * not provide much info to the end user.)
179
+ * If this errors before calling handleBridgeAction(), the failure will
180
+ * not be observable. The promise does reject, but as of now bridge
181
+ * manager drops instead of handling it. Eventually we'll make the bridge
182
+ * able to give feedback about the requesting transaction. Meanwhile we
183
+ * could write the error to chainStorage but we don't have a guarantee of
184
+ * the wallet owner to associate it with. (We could have a shared
185
+ * `lastError` node but it would be so noisy as to not provide much info
186
+ * to the end user.)
176
187
  *
177
- * Once the owner is known, this calls handleBridgeAction which ensures that all errors
178
- * are published in the owner wallet's vstorage path.
188
+ * Once the owner is known, this calls handleBridgeAction which ensures
189
+ * that all errors are published in the owner wallet's vstorage path.
179
190
  *
180
- * @param {import('./types.js').WalletBridgeMsg} obj validated by shape.WalletBridgeMsg
191
+ * @param {import('./types.js').WalletBridgeMsg} obj validated by
192
+ * shape.WalletBridgeMsg
181
193
  * @returns {Promise<void>}
182
194
  */
183
195
  fromBridge: async obj => {
@@ -248,6 +260,7 @@ export const prepare = async (zcf, privateArgs, baggage) => {
248
260
 
249
261
  /**
250
262
  * Holders of this object:
263
+ *
251
264
  * - vat (transitively from holding the wallet factory)
252
265
  * - wallet-ui (which has key material; dapps use wallet-ui to propose actions)
253
266
  */
@@ -282,16 +295,22 @@ export const prepare = async (zcf, privateArgs, baggage) => {
282
295
  {
283
296
  /**
284
297
  * @param {string} address
285
- * @param {ERef<import('@agoric/vats/src/vat-bank').Bank>} bank
286
- * @param {ERef<import('@agoric/vats/').NameAdmin>} namesByAddressAdmin
287
- * @returns {Promise<[wallet: import('./smartWallet').SmartWallet, isNew: boolean]>} wallet
288
- * along with a flag to distinguish between looking up an existing wallet
289
- * and creating a new one.
298
+ * @param {ERef<import('@agoric/vats/src/vat-bank.js').Bank>} bank
299
+ * @param {ERef<import('@agoric/vats/src/types.js').NameAdmin>} namesByAddressAdmin
300
+ * @returns {Promise<
301
+ * [wallet: import('./smartWallet.js').SmartWallet, isNew: boolean]
302
+ * >}
303
+ * wallet along with a flag to distinguish between looking up an existing
304
+ * wallet and creating a new one.
290
305
  */
291
306
  provideSmartWallet(address, bank, namesByAddressAdmin) {
292
307
  let isNew = false;
293
308
 
294
- /** @type {(address: string) => Promise<import('./smartWallet').SmartWallet>} */
309
+ /**
310
+ * @type {(
311
+ * address: string,
312
+ * ) => Promise<import('./smartWallet.js').SmartWallet>}
313
+ */
295
314
  const maker = async _address => {
296
315
  const invitationPurse = await E(invitationIssuer).makeEmptyPurse();
297
316
  const walletStorageNode = E(storageNode).makeChildNode(address);
package/CHANGELOG.md DELETED
@@ -1,250 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ### [0.5.4-u15.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.4-u14.1...@agoric/smart-wallet@0.5.4-u15.0) (2024-04-20)
7
-
8
-
9
- ### Features
10
-
11
- * **smart-wallet:** tryExitOffer reclaims withdrawn payments ([6f01f63](https://github.com/Agoric/agoric/commit/6f01f633be6ac3b43f965c704f8116405896c993))
12
-
13
-
14
- ### Bug Fixes
15
-
16
- * in SmartWallet, if invitation is invalid, don't process offer ([29078f7](https://github.com/Agoric/agoric/commit/29078f75f59ae5a5b47b463f9a65f9a5d4d69a8e))
17
-
18
-
19
-
20
- ### [0.5.4-u14.1](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.4-u14.0...@agoric/smart-wallet@0.5.4-u14.1) (2024-03-12)
21
-
22
- **Note:** Version bump only for package @agoric/smart-wallet
23
-
24
-
25
-
26
-
27
-
28
- ### [0.5.4-u14.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.4-u13.0...@agoric/smart-wallet@0.5.4-u14.0) (2024-02-27)
29
-
30
-
31
- ### Features
32
-
33
- * smartWallet verstion 2 with watchedPromises ([31d7c2f](https://github.com/Agoric/agoric/commit/31d7c2f4ecea9a34956cc6716fb8d73cbeb12e64))
34
- * repairUnwatchedPurses ([aad9f16](https://github.com/Agoric/agoric/commit/aad9f1640e46da4e80f959767a485e1ee7fb0ea5))
35
-
36
-
37
- ### Bug Fixes
38
-
39
- * burn invitation made for repair ([be80ef9](https://github.com/Agoric/agoric/commit/be80ef92b7cbbb161e00414851ccf397ec9d3180))
40
- * handle promises in repairWalletForIncarnation2 ([2a8dab2](https://github.com/Agoric/agoric/commit/2a8dab23ae0d20f77481f26d7ed098f649537bf7))
41
- * publish 'error' message for failure after upgrade ([d4ab282](https://github.com/Agoric/agoric/commit/d4ab282d8b07fdaf52326d5952fcb1ad9528b353))
42
- * re-use invitation from offerToUsedInvitation ([445dec7](https://github.com/Agoric/agoric/commit/445dec7d468609a41cf1c3078570a282f6789779))
43
- * repair incorrect fix for repairWalletForIncarnation2 (backport [#8984](https://github.com/Agoric/agoric/issues/8984)) ([#8985](https://github.com/Agoric/agoric/issues/8985)) ([b818d30](https://github.com/Agoric/agoric/commit/b818d30fed4fdaeb3f76af920e6a67824c608318))
44
- * **smartWallet:** handle upgrade disconnects from purse notifiers ([f82b82b](https://github.com/Agoric/agoric/commit/f82b82bb79b21c0789609cc26b1c8f58ccdb32bc))
45
-
46
-
47
-
48
- ### [0.5.4-u13.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.4-u12.0...@agoric/smart-wallet@0.5.4-u13.0) (2023-12-07)
49
-
50
- **Note:** Version bump only for package @agoric/smart-wallet
51
-
52
-
53
-
54
-
55
-
56
- ### [0.5.4-u12.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.4-u11wf.0...@agoric/smart-wallet@0.5.4-u12.0) (2023-11-10)
57
-
58
-
59
- ### Bug Fixes
60
-
61
- * **walletFactory:** move upgrading check before baggage is populated ([#8322](https://github.com/Agoric/agoric/issues/8322)) ([330b7a2](https://github.com/Agoric/agoric/commit/330b7a26da9a8eefb95e3e0fd082714fdfad7873))
62
-
63
-
64
-
65
- ### [0.5.4-u11wf.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.4-u11.0...@agoric/smart-wallet@0.5.4-u11wf.0) (2023-09-23)
66
-
67
-
68
- ### Features
69
-
70
- * **smart-wallet:** trading in non-vbank asset ([dc99ca0](https://github.com/Agoric/agoric/commit/dc99ca0b58af3a66778071993f0d73d099605069))
71
- * **smart-wallet:** upgrade walletFactory for non-vbank assets ([073b450](https://github.com/Agoric/agoric/commit/073b450b0790d1837d59e80c0109f0923b5f0cd2))
72
- * **smart-wallet:** withdraw payments before getting invitation ([82ed64e](https://github.com/Agoric/agoric/commit/82ed64ec20ce7884d6cdf6caac63fab85d02af40)), closes [#7098](https://github.com/Agoric/agoric/issues/7098)
73
-
74
-
75
-
76
- ### [0.5.4-u11.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.3...@agoric/smart-wallet@0.5.4-u11.0) (2023-08-24)
77
-
78
- **Note:** Version bump only for package @agoric/smart-wallet
79
-
80
-
81
-
82
-
83
-
84
- ### [0.5.3](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.2...@agoric/smart-wallet@0.5.3) (2023-06-09)
85
-
86
- **Note:** Version bump only for package @agoric/smart-wallet
87
-
88
-
89
-
90
-
91
-
92
- ### [0.5.2](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.1...@agoric/smart-wallet@0.5.2) (2023-06-02)
93
-
94
- **Note:** Version bump only for package @agoric/smart-wallet
95
-
96
-
97
-
98
-
99
-
100
- ### [0.5.1](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.5.0...@agoric/smart-wallet@0.5.1) (2023-05-24)
101
-
102
- **Note:** Version bump only for package @agoric/smart-wallet
103
-
104
-
105
-
106
-
107
-
108
- ## [0.5.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.2...@agoric/smart-wallet@0.5.0) (2023-05-19)
109
-
110
-
111
- ### ⚠ BREAKING CHANGES
112
-
113
- * emit smallcaps-format data in all marshallers
114
- * move PublicTopic to Zoe contractSupport
115
- * **wallet:** reject executeOffer on failure
116
- * storage paths by getPublicTopics
117
- * rename 'fit' to 'mustMatch'
118
-
119
- ### Features
120
-
121
- * emit smallcaps-format data in all marshallers ([1753df8](https://github.com/Agoric/agoric/commit/1753df83465785b5ee71b250770c9b012d750ffc)), closes [#6822](https://github.com/Agoric/agoric/issues/6822)
122
- * **board-utils:** BoardRemote like Remotables ([3aa44de](https://github.com/Agoric/agoric/commit/3aa44debbdc955892611ba870478fb088395cf10))
123
- * **smartWallet:** fail early on offerId re-use ([08307e0](https://github.com/Agoric/agoric/commit/08307e01a6c9a3d53144df55f52e03f8f9df2a78))
124
- * Add incarnation number to the transcript store records ([5d64be7](https://github.com/Agoric/agoric/commit/5d64be7aa1fd222822b145240f541f5eabb01c43)), closes [#7482](https://github.com/Agoric/agoric/issues/7482)
125
- * **contractSupport:** provideAll takes thunks ([f35034b](https://github.com/Agoric/agoric/commit/f35034b13b99dbfb8d472816644e09f9b4f2be3a))
126
- * **contractSupport:** providePublicTopic ([5bdb71e](https://github.com/Agoric/agoric/commit/5bdb71e1af9ecde163322612de3e648fd75d7a47))
127
- * **smart-wallet:** exit offer ([7323023](https://github.com/Agoric/agoric/commit/7323023308aa40c145e60093b7fc52580534cd2d))
128
- * **smart-wallet:** preserve existing `myAddressNameAdmin` ([8f283af](https://github.com/Agoric/agoric/commit/8f283aff0fc7b6146e9b6393c158cd9ca15f31f9))
129
- * **smart-wallet:** publish pending offers before completion ([c913b36](https://github.com/Agoric/agoric/commit/c913b36950be1d2ae1b16d16bfcfc8df32305e0c))
130
- * **smart-wallet:** publish possibly exitable offers ([de0170a](https://github.com/Agoric/agoric/commit/de0170add5bd4c82cbef23431bffaa95f7007880))
131
- * **topics:** makePublicTopic ([c8b464c](https://github.com/Agoric/agoric/commit/c8b464c26c53535097e4df573e126c81e00e5aa6))
132
- * **vats:** Scoped bridge managers ([11f6429](https://github.com/Agoric/agoric/commit/11f64298d8529cca249d2933894236dc534dfe3e))
133
- * **wallet:** executeOffer throw errors ([224dbca](https://github.com/Agoric/agoric/commit/224dbca918343608d53f691a448171c8a48d283e))
134
- * **wallet:** record bridge errors to vstorage ([f8581e9](https://github.com/Agoric/agoric/commit/f8581e95311f7cb4105f6d81f0ac7b6a9121b68f))
135
- * **wallet:** reject executeOffer on failure ([308caab](https://github.com/Agoric/agoric/commit/308caab24c1680c2c7910eff8128f9089dedf26d))
136
- * **walletFactory:** more durability ([7e6c98d](https://github.com/Agoric/agoric/commit/7e6c98d4a448eb94de98c865bc8280534bd5069f))
137
- * **walletFactory:** upgradable ([ca30e05](https://github.com/Agoric/agoric/commit/ca30e05988fae00f437b5708dbabe061742797f1))
138
- * agoricContract invitation getter ([ca6166f](https://github.com/Agoric/agoric/commit/ca6166f94a934811f698631f9ce1dd2a32ad422c))
139
- * allow string for offer id, leave uniqueness to client ([7856e56](https://github.com/Agoric/agoric/commit/7856e5635ba04671da17334080dad061a8f9fc15))
140
- * boot-oracles ([ce8f8de](https://github.com/Agoric/agoric/commit/ce8f8de65ad4c14b4e8d699cd721683cfa1cc495))
141
- * durable smart wallet ([6977f73](https://github.com/Agoric/agoric/commit/6977f73f820a9345ef49f4f18095a5c88af06729))
142
- * fixed heap for getPublicTopics ([1886c3a](https://github.com/Agoric/agoric/commit/1886c3af2319b9540faa318cf6179d4d01eec084))
143
- * storage paths by getPublicTopics ([40a8624](https://github.com/Agoric/agoric/commit/40a8624240f241a686c28bd7d7c7ef1ef780f984))
144
- * support TopicsRecord ([8618461](https://github.com/Agoric/agoric/commit/8618461781fe11f28e6b891a4d31ebfd9dda5e0d))
145
- * track publicSubscribers ([30cae51](https://github.com/Agoric/agoric/commit/30cae513a624a74f2df05b668f4eaa02d6d13656))
146
- * vaults list command ([894c92f](https://github.com/Agoric/agoric/commit/894c92f9ee6331aba43aaeebd6c007dd03d53996))
147
-
148
-
149
- ### Bug Fixes
150
-
151
- * handle {} wallet update records ([c7dbccb](https://github.com/Agoric/agoric/commit/c7dbccbad2d2007af398c31c94f68793fe4e8504))
152
- * **cli:** dont blow up from old wallet updates ([ac5a28e](https://github.com/Agoric/agoric/commit/ac5a28e9e47916b0d3ba7978d90067a757470be3))
153
- * **walletFactory:** handle restartContract ([f8b7200](https://github.com/Agoric/agoric/commit/f8b720014c2987301a67d073348b80fc1d30d756))
154
- * Improve the smart wallet revival handshake ([69ec2e7](https://github.com/Agoric/agoric/commit/69ec2e76f06cf87454d087adfa2ef6c2adcea8a0))
155
- * **vats:** Extract revivable wallet addresses from the correct chain storage path ([2454d3f](https://github.com/Agoric/agoric/commit/2454d3f48eefb2bdea5a0d03a250d8a5a74b0ba3))
156
- * add missing facet interface ([d16bc2e](https://github.com/Agoric/agoric/commit/d16bc2e121810c8c432519028e4382146b066956))
157
- * bootstrap handles BundleIDs, not full bundles ([de8b0f5](https://github.com/Agoric/agoric/commit/de8b0f5d35e0938fa00d795d11cfad3acadd9428)), closes [#6826](https://github.com/Agoric/agoric/issues/6826) [#4374](https://github.com/Agoric/agoric/issues/4374)
158
- * number/string inconsistency with offer lookup ([59abbdb](https://github.com/Agoric/agoric/commit/59abbdb0a6498333ec48e971347076f7739c9b84))
159
- * Preserve smart wallets through bulldozer upgrade ([160bf6c](https://github.com/Agoric/agoric/commit/160bf6cad0bbdfe6a245f6b7a8e260d244c44f21)), closes [#7537](https://github.com/Agoric/agoric/issues/7537)
160
- * use `subscribeEach` to get reconnect benefits ([fb24132](https://github.com/Agoric/agoric/commit/fb24132f9b4e117e56bae2803994e57c188344f3))
161
- * **wallet:** pipeTopicToStorage with Recorder kit ([31b79b7](https://github.com/Agoric/agoric/commit/31b79b71eda59b62d3bacd7ca648b53b9385afc0))
162
- * **wallet:** recording handleBridgeAction errors ([8e64158](https://github.com/Agoric/agoric/commit/8e6415872dafc1cd5def9c038d673842464b316b))
163
- * multiple deposits of unknown brand ([6ef6062](https://github.com/Agoric/agoric/commit/6ef6062a4b69b0d44b18dc576021bbbaf372b3b2))
164
- * purse making (use vbank) ([9175882](https://github.com/Agoric/agoric/commit/91758824848ea24f5cd4cae5eaadf88169b80e39))
165
- * race in watchPurse to update balance ([51869c1](https://github.com/Agoric/agoric/commit/51869c1ffce90350cbaed84b5f92fa05c3473f3e))
166
- * rename from FarClass to ExoClass, etc ([#6323](https://github.com/Agoric/agoric/issues/6323)) ([da96c7c](https://github.com/Agoric/agoric/commit/da96c7c3c902a5e266baeedf23df02481f2e9c9d))
167
- * **smart-wallet:** create purses for new assets lazily ([e241ba0](https://github.com/Agoric/agoric/commit/e241ba03a7d9f441436b3d987f9327060d7dd8ce))
168
-
169
-
170
- ### Miscellaneous Chores
171
-
172
- * rename 'fit' to 'mustMatch' ([9fa3232](https://github.com/Agoric/agoric/commit/9fa32324f84bfb85de9e99e0c9ad277b8017b50e)), closes [#6844](https://github.com/Agoric/agoric/issues/6844)
173
-
174
-
175
- ### Code Refactoring
176
-
177
- * move PublicTopic to Zoe contractSupport ([c51ea3d](https://github.com/Agoric/agoric/commit/c51ea3de22f50e05fcc1aaabd2108e785d51eb2e))
178
-
179
-
180
-
181
- ### [0.4.4](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.3...@agoric/smart-wallet@0.4.4) (2023-02-17)
182
-
183
- **Note:** Version bump only for package @agoric/smart-wallet
184
-
185
-
186
-
187
-
188
-
189
- ### [0.4.3](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.2...@agoric/smart-wallet@0.4.3) (2022-12-14)
190
-
191
- **Note:** Version bump only for package @agoric/smart-wallet
192
-
193
-
194
-
195
-
196
-
197
- ### [0.4.2](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.1...@agoric/smart-wallet@0.4.2) (2022-10-18)
198
-
199
- **Note:** Version bump only for package @agoric/smart-wallet
200
-
201
-
202
-
203
-
204
-
205
- ### [0.4.1](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.4.0...@agoric/smart-wallet@0.4.1) (2022-10-08)
206
-
207
- **Note:** Version bump only for package @agoric/smart-wallet
208
-
209
-
210
-
211
-
212
-
213
- ## [0.4.0](https://github.com/Agoric/agoric/compare/@agoric/smart-wallet@0.3.0...@agoric/smart-wallet@0.4.0) (2022-10-05)
214
-
215
-
216
- ### Features
217
-
218
- * **cli:** use new wallet.current node ([71effe7](https://github.com/Agoric/agoric/commit/71effe758c28181b8709ae4ccf025fcec7bb8a38))
219
- * track consumed invitation amounts ([e9e3c35](https://github.com/Agoric/agoric/commit/e9e3c35cebdc85e80fb2eaa117ff0be00d26c9bb))
220
- * **cli:** show status of invitations ([8506e6d](https://github.com/Agoric/agoric/commit/8506e6d87ef331e781c9d2e2251fdcf48e784e04))
221
-
222
-
223
- ### Bug Fixes
224
-
225
- * **vats:** handle duplicate provision requests ([#6307](https://github.com/Agoric/agoric/issues/6307)) ([05d405d](https://github.com/Agoric/agoric/commit/05d405d5409e1f80612bb002234f5a9c3910a7df))
226
- * **wallet-ui:** detect unprovisioned wallet ([1747d57](https://github.com/Agoric/agoric/commit/1747d5781f4ee594eca1ded76af4944c405e7000))
227
-
228
-
229
-
230
- ## 0.3.0 (2022-09-20)
231
-
232
-
233
- ### Features
234
-
235
- * **wallet:** more diagnostics for invitation match ([98630ee](https://github.com/Agoric/agoric/commit/98630ee96a202cf3907e37b5d4d549bb37b1263d))
236
- * **wallet-ui:** start displaying balances ([0f36da9](https://github.com/Agoric/agoric/commit/0f36da99daef86f24670d606ae5fd1adb32b419b))
237
- * ensure voting via PSMCharter works with a unit test ([#6167](https://github.com/Agoric/agoric/issues/6167)) ([ff9471b](https://github.com/Agoric/agoric/commit/ff9471bf3a90ffab050e8b659d64d4cbd7c2d764))
238
- * **smart-wallet:** include lastOfferId in error ([932cb7d](https://github.com/Agoric/agoric/commit/932cb7d90b8e281f0922d0b38287230aabd6f535))
239
- * **smartWallet:** defer deposits until purse available ([#6172](https://github.com/Agoric/agoric/issues/6172)) ([1a1cc41](https://github.com/Agoric/agoric/commit/1a1cc41d421760563892212e1ca3df237a7a6661))
240
- * **smartWallet:** virtual objects ([659ad58](https://github.com/Agoric/agoric/commit/659ad58349f972881a540d78ec5d856872dacc7d))
241
- * distribute PSM Charter Invitatitons ([#6166](https://github.com/Agoric/agoric/issues/6166)) ([50cd3e2](https://github.com/Agoric/agoric/commit/50cd3e240fb33079948fa03b32bda86276879b4a))
242
- * new Smart Wallet ([708972f](https://github.com/Agoric/agoric/commit/708972f1f531c9ea5e346f833c6d253efe80f837))
243
-
244
-
245
- ### Bug Fixes
246
-
247
- * **smart-wallet:** invitation brand is remote ([6613136](https://github.com/Agoric/agoric/commit/66131366f563ebfefbeabeecffda43211a093d1e))
248
- * **smart-wallet:** not yet durable-able ([db66c2c](https://github.com/Agoric/agoric/commit/db66c2c13de92f2a0783bcaf174223691ab0a339))
249
- * Fix test failures in packages other than "vats" ([364815b](https://github.com/Agoric/agoric/commit/364815b88429e3443734681b5b0771b7d824ebe8))
250
- * two corrections we found by demoing on 6084 ([#6155](https://github.com/Agoric/agoric/issues/6155)) ([88b1067](https://github.com/Agoric/agoric/commit/88b10676b9617e662fed38df61ab3210df07c602))