@agoric/smart-wallet 0.5.4-u12.0 → 0.5.4-upgrade-14-dev-0a0580c.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/CHANGELOG.md +8 -0
- package/package.json +15 -13
- package/src/offerWatcher.d.ts +46 -0
- package/src/offerWatcher.d.ts.map +1 -0
- package/src/offerWatcher.js +248 -0
- package/src/offers.d.ts +0 -24
- package/src/offers.d.ts.map +1 -1
- package/src/offers.js +0 -174
- 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 +59 -0
- package/src/smartWallet.d.ts +37 -14
- package/src/smartWallet.d.ts.map +1 -1
- package/src/smartWallet.js +518 -143
- package/src/types.d.ts +11 -1
- package/src/walletFactory.d.ts +6 -4
- 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: MapStore<string, unknown>, shared: S
|
|
|
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: MapStore<string, unknown>, shared: S
|
|
|
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.
|
|
@@ -124,12 +146,11 @@ export type BrandDescriptor = {
|
|
|
124
146
|
brand: Brand;
|
|
125
147
|
displayInfo: DisplayInfo;
|
|
126
148
|
issuer: Issuer;
|
|
127
|
-
petname: import('./types').Petname;
|
|
149
|
+
petname: import('./types.js').Petname;
|
|
128
150
|
};
|
|
129
|
-
export type RemotePurse = import('./types').RemotePurse;
|
|
130
151
|
export type UniqueParams = {
|
|
131
152
|
address: string;
|
|
132
|
-
bank: ERef<import('@agoric/vats/src/vat-bank').Bank>;
|
|
153
|
+
bank: ERef<import('@agoric/vats/src/vat-bank.js').Bank>;
|
|
133
154
|
currentStorageNode: StorageNode;
|
|
134
155
|
invitationPurse: Purse<'set'>;
|
|
135
156
|
walletStorageNode: StorageNode;
|
|
@@ -143,6 +164,7 @@ export type SharedParams = {
|
|
|
143
164
|
invitationDisplayInfo: DisplayInfo;
|
|
144
165
|
publicMarshaller: Marshaller;
|
|
145
166
|
zoe: ERef<ZoeService>;
|
|
167
|
+
secretWalletFactoryKey: any;
|
|
146
168
|
};
|
|
147
169
|
/**
|
|
148
170
|
* - `brandPurses` is precious and closely held. defined as late as possible to reduce its scope.
|
|
@@ -153,14 +175,15 @@ export type SharedParams = {
|
|
|
153
175
|
export type State = ImmutableState & MutableState;
|
|
154
176
|
export type ImmutableState = Readonly<UniqueParams & {
|
|
155
177
|
paymentQueues: MapStore<Brand, Array<Payment>>;
|
|
156
|
-
offerToInvitationMakers: MapStore<string, import('./types').
|
|
178
|
+
offerToInvitationMakers: MapStore<string, import('./types').RemoteInvitationMakers>;
|
|
157
179
|
offerToPublicSubscriberPaths: MapStore<string, Record<string, string>>;
|
|
158
180
|
offerToUsedInvitation: MapStore<string, Amount>;
|
|
159
|
-
purseBalances: MapStore<
|
|
181
|
+
purseBalances: MapStore<Purse, Amount>;
|
|
160
182
|
updateRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<UpdateRecord>;
|
|
161
183
|
currentRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<CurrentWalletRecord>;
|
|
162
|
-
liveOffers: MapStore<
|
|
163
|
-
liveOfferSeats:
|
|
184
|
+
liveOffers: MapStore<OfferId, import('./offers.js').OfferStatus>;
|
|
185
|
+
liveOfferSeats: MapStore<OfferId, UserSeat<unknown>>;
|
|
186
|
+
liveOfferPayments: MapStore<OfferId, MapStore<Brand, Payment>>;
|
|
164
187
|
}>;
|
|
165
188
|
export type PurseRecord = BrandDescriptor & {
|
|
166
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":"AAiOA,kDAAmD;AAiB5C,+EAFI,YAAY;uBAg4B2E,KAAK,WAAW,CAAC;;IAnH3G;;;;;;OAMG;sCAHQ,OAAO,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,mCAErC,QAAQ,IAAI,CAAC;;QA7O1B;;;;;;;;WAQG;yBAHQ,OAAO,GACL,QAAQ,MAAM,CAAC;;;QAsG5B;;;;;;WAMG;gCAHQ,SAAS,GACP,QAAQ,IAAI,CAAC;QA2G1B;;;;;;WAMG;8BAHQ,OAAO,GACL,QAAQ,IAAI,CAAC;;IAmE1B,sCAAsC;;IAKtC,sCAAsC;;;;;;;;;;;;;;IAsBtC;;;;;OAKG;qCADQ,MAAM;GA2CxB;sBA3kCa,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