@agoric/smart-wallet 0.5.4-dev-6388a00.0 → 0.5.4-dev-376e47d.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 +13 -13
- package/src/offerWatcher.d.ts +31 -0
- package/src/offerWatcher.d.ts.map +1 -0
- package/src/offerWatcher.js +243 -0
- package/src/offers.d.ts +0 -24
- package/src/offers.d.ts.map +1 -1
- package/src/offers.js +0 -172
- package/src/proposals/upgrade-wallet-factory2-proposal.d.ts +23 -0
- package/src/proposals/upgrade-wallet-factory2-proposal.d.ts.map +1 -0
- package/src/proposals/upgrade-wallet-factory2-proposal.js +58 -0
- package/src/smartWallet.d.ts +33 -9
- package/src/smartWallet.d.ts.map +1 -1
- package/src/smartWallet.js +415 -111
- package/src/utils.d.ts +1 -1
- package/src/walletFactory.d.ts +12 -8
- package/src/walletFactory.d.ts.map +1 -1
- package/src/walletFactory.js +35 -3
- package/src/payments.d.ts +0 -20
- package/src/payments.d.ts.map +0 -1
- package/src/payments.js +0 -89
package/src/smartWallet.d.ts
CHANGED
|
@@ -26,19 +26,19 @@ export function prepareSmartWallet(baggage: import('@agoric/vat-data').Baggage,
|
|
|
26
26
|
/**
|
|
27
27
|
* Take an offer description provided in capData, augment it with payments and call zoe.offer()
|
|
28
28
|
*
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {OfferSpec} offerSpec
|
|
30
30
|
* @returns {Promise<void>} after the offer has been both seated and exited by Zoe.
|
|
31
31
|
* @throws if any parts of the offer can be determined synchronously to be invalid
|
|
32
32
|
*/
|
|
33
|
-
executeOffer(offerSpec:
|
|
33
|
+
executeOffer(offerSpec: OfferSpec): Promise<void>;
|
|
34
34
|
/**
|
|
35
35
|
* Take an offer's id, look up its seat, try to exit.
|
|
36
36
|
*
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {OfferId} offerId
|
|
38
38
|
* @returns {Promise<void>}
|
|
39
39
|
* @throws if the seat can't be found or E(seatRef).tryExit() fails.
|
|
40
40
|
*/
|
|
41
|
-
tryExitOffer(offerId:
|
|
41
|
+
tryExitOffer(offerId: OfferId): Promise<void>;
|
|
42
42
|
}>;
|
|
43
43
|
/** @deprecated use getPublicTopics */
|
|
44
44
|
getCurrentSubscriber(): Subscriber<CurrentWalletRecord>;
|
|
@@ -56,14 +56,36 @@ export function prepareSmartWallet(baggage: import('@agoric/vat-data').Baggage,
|
|
|
56
56
|
storagePath: Promise<string>;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* one-time use function. Remove this and repairUnwatchedSeats once the
|
|
61
|
+
* repair has taken place.
|
|
62
|
+
*
|
|
63
|
+
* @param {object} key
|
|
64
|
+
*/
|
|
65
|
+
repairWalletForIncarnation2(key: object): void;
|
|
59
66
|
}>>;
|
|
67
|
+
export type OfferId = number | string;
|
|
68
|
+
export type OfferSpec = {
|
|
69
|
+
id: OfferId;
|
|
70
|
+
invitationSpec: import('./invitations').InvitationSpec;
|
|
71
|
+
proposal: Proposal;
|
|
72
|
+
offerArgs?: unknown;
|
|
73
|
+
};
|
|
74
|
+
export type ExecutorPowers = {
|
|
75
|
+
logger: {
|
|
76
|
+
info: (...args: any[]) => void;
|
|
77
|
+
error: (...args: any[]) => void;
|
|
78
|
+
};
|
|
79
|
+
makeOfferWatcher: import('./offerWatcher.js').MakeOfferWatcher;
|
|
80
|
+
invitationFromSpec: ERef<Invitation>;
|
|
81
|
+
};
|
|
60
82
|
export type ExecuteOfferAction = {
|
|
61
83
|
method: 'executeOffer';
|
|
62
|
-
offer:
|
|
84
|
+
offer: OfferSpec;
|
|
63
85
|
};
|
|
64
86
|
export type TryExitOfferAction = {
|
|
65
87
|
method: 'tryExitOffer';
|
|
66
|
-
offerId:
|
|
88
|
+
offerId: OfferId;
|
|
67
89
|
};
|
|
68
90
|
export type BridgeAction = ExecuteOfferAction | TryExitOfferAction;
|
|
69
91
|
/**
|
|
@@ -91,7 +113,7 @@ export type CurrentWalletRecord = {
|
|
|
91
113
|
offerToPublicSubscriberPaths: [offerId: string, publicTopics: {
|
|
92
114
|
[subscriberName: string]: string;
|
|
93
115
|
}][];
|
|
94
|
-
liveOffers: Array<[
|
|
116
|
+
liveOffers: Array<[OfferId, import('./offers.js').OfferStatus]>;
|
|
95
117
|
};
|
|
96
118
|
/**
|
|
97
119
|
* Record of an update to the state of this wallet.
|
|
@@ -142,6 +164,7 @@ export type SharedParams = {
|
|
|
142
164
|
invitationDisplayInfo: DisplayInfo;
|
|
143
165
|
publicMarshaller: Marshaller;
|
|
144
166
|
zoe: ERef<ZoeService>;
|
|
167
|
+
secretWalletFactoryKey: any;
|
|
145
168
|
};
|
|
146
169
|
/**
|
|
147
170
|
* - `brandPurses` is precious and closely held. defined as late as possible to reduce its scope.
|
|
@@ -158,8 +181,9 @@ export type ImmutableState = Readonly<UniqueParams & {
|
|
|
158
181
|
purseBalances: MapStore<Purse, Amount>;
|
|
159
182
|
updateRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<UpdateRecord>;
|
|
160
183
|
currentRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<CurrentWalletRecord>;
|
|
161
|
-
liveOffers: MapStore<
|
|
162
|
-
liveOfferSeats:
|
|
184
|
+
liveOffers: MapStore<OfferId, import('./offers.js').OfferStatus>;
|
|
185
|
+
liveOfferSeats: MapStore<OfferId, UserSeat<unknown>>;
|
|
186
|
+
liveOfferPayments: MapStore<OfferId, MapStore<Brand, Payment>>;
|
|
163
187
|
}>;
|
|
164
188
|
export type PurseRecord = BrandDescriptor & {
|
|
165
189
|
purse: Purse;
|
package/src/smartWallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smartWallet.d.ts","sourceRoot":"","sources":["smartWallet.js"],"names":[],"mappings":"AA+NA,kDAAmD;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