@agoric/smart-wallet 0.5.4-dev-df2faae.0 → 0.5.4-dev-bcab39d.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 +14 -14
- package/src/smartWallet.d.ts +0 -7
- package/src/smartWallet.d.ts.map +1 -1
- package/src/smartWallet.js +0 -124
- package/src/walletFactory.d.ts.map +1 -1
- package/src/walletFactory.js +0 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/smart-wallet",
|
|
3
|
-
"version": "0.5.4-dev-
|
|
3
|
+
"version": "0.5.4-dev-bcab39d.0+bcab39d",
|
|
4
4
|
"description": "Wallet contract",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"lint:eslint": "eslint ."
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
21
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
20
|
+
"@agoric/cosmic-proto": "0.4.1-dev-bcab39d.0+bcab39d",
|
|
21
|
+
"@agoric/swingset-vat": "0.32.3-dev-bcab39d.0+bcab39d",
|
|
22
22
|
"@endo/bundle-source": "^3.4.2",
|
|
23
23
|
"@endo/captp": "^4.4.2",
|
|
24
24
|
"@endo/init": "^1.1.6",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"import-meta-resolve": "^2.2.1"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@agoric/casting": "0.4.3-dev-
|
|
30
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
31
|
-
"@agoric/internal": "0.3.3-dev-
|
|
32
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
33
|
-
"@agoric/store": "0.9.3-dev-
|
|
34
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
35
|
-
"@agoric/vats": "0.15.2-dev-
|
|
36
|
-
"@agoric/vow": "0.1.1-dev-
|
|
37
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
38
|
-
"@agoric/zone": "0.2.3-dev-
|
|
29
|
+
"@agoric/casting": "0.4.3-dev-bcab39d.0+bcab39d",
|
|
30
|
+
"@agoric/ertp": "0.16.3-dev-bcab39d.0+bcab39d",
|
|
31
|
+
"@agoric/internal": "0.3.3-dev-bcab39d.0+bcab39d",
|
|
32
|
+
"@agoric/notifier": "0.6.3-dev-bcab39d.0+bcab39d",
|
|
33
|
+
"@agoric/store": "0.9.3-dev-bcab39d.0+bcab39d",
|
|
34
|
+
"@agoric/vat-data": "0.5.3-dev-bcab39d.0+bcab39d",
|
|
35
|
+
"@agoric/vats": "0.15.2-dev-bcab39d.0+bcab39d",
|
|
36
|
+
"@agoric/vow": "0.1.1-dev-bcab39d.0+bcab39d",
|
|
37
|
+
"@agoric/zoe": "0.26.3-dev-bcab39d.0+bcab39d",
|
|
38
|
+
"@agoric/zone": "0.2.3-dev-bcab39d.0+bcab39d",
|
|
39
39
|
"@endo/errors": "^1.2.7",
|
|
40
40
|
"@endo/eventual-send": "^1.2.7",
|
|
41
41
|
"@endo/far": "^1.1.8",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"typeCoverage": {
|
|
73
73
|
"atLeast": 94.51
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "bcab39d18519bc8edf27ba0c3b59da34812cc134"
|
|
76
76
|
}
|
package/src/smartWallet.d.ts
CHANGED
|
@@ -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
|
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":"AA4PA,kDAAmD;AAiB5C,4CAHI,OAAO,kBAAkB,EAAE,OAAO,UAClC,YAAY,6BAi1BV,IAAI,CACV,YAAY,EAChB,oBAAwB,GAAG,mBAAmB,CAC3C,GAAG;IACF,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;CACtC;IAzGE;;;;;;;;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;;;;;;;;;;;;;;IAyD7C;sBA1jCa,MAAM,GAAG,MAAM;wBAGhB;IACR,EAAE,EAAE,OAAO,CAAC;IACZ,cAAc,EAAE,OAAO,eAAe,EAAE,cAAc,CAAC;IACvD,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,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,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"}
|
package/src/smartWallet.js
CHANGED
|
@@ -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
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AA6BA,gEAKE;
|
|
1
|
+
{"version":3,"file":"walletFactory.d.ts","sourceRoot":"","sources":["walletFactory.js"],"names":[],"mappings":";;;;;AA6BA,gEAKE;AAYK,6CAJI,MAAM,UACN,OAAO,kBAAkB,EAAE,WAAW,uBACtC,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,oBAehD;AAWM,kDAFI,cAAc;IAyCrB,2BAA2B;iBAAf,KAAK;IAEjB,2BAA2B;iBAAf,KAAK;eArCP,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,YAAY,EAAE,OAAO;;;eAH9B,KAAK;qBACC,WAAW;gBAChB,MAAM;iBACL,OAAO,YAAY,EAAE,OAAO;;EAuC3C;AAyCM,6BAVI,GAAG,CAAC,wBAAwB,CAAC,eAC7B;IACN,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,mBAAmB,CAAC,EAAE,IAAI,CAC9B,OAAa,cAAc,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CACrD,CAAC;IACF,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;CACrC,WACO,OAAO,kBAAkB,EAAE,OAAO;;QAiHvC;;;;;;;;;WASG;oCARQ,MAAM,QACN,IAAI,CAAC,OAAO,8BAA8B,EAAE,IAAI,CAAC,uBACjD,IAAI,CAAC,OAAO,2BAA2B,EAAE,SAAS,CAAC,GACjD,OAAO,CACnB,CAAK,MAAM,EAAE,OAAO,kBAAkB,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CACjE;;GAuDT;uCAlNY;IACR,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,KAAK,EAAE,IAAI,CAAC,OAAO,cAAc,EAAE,KAAK,CAAC,CAAC;IAC1C,cAAc,EAAE,cAAc,CAAC;CAChC;6BAGS;IACR,oBAAoB,EAAE,MAAM,IAAI,CAC9B,iBAAiB,CAAC,OAAO,8BAA8B,EAAE,eAAe,CAAC,CAC1E,CAAC;CACH;uBAGS,OAAO;4BAEP;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"}
|
package/src/walletFactory.js
CHANGED
|
@@ -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',
|