@agoric/wallet-backend 0.14.4-dev-1933b27.0 → 0.14.4-dev-08f8549.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/bundles/bundle-wallet-js-meta.json +84 -84
- package/bundles/bundle-wallet.js +1 -1
- package/package.json +14 -14
- package/src/lib-wallet.js +16 -17
- package/src/wallet.js +3 -4
- package/test/lib-wallet.test.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/wallet-backend",
|
|
3
|
-
"version": "0.14.4-dev-
|
|
3
|
+
"version": "0.14.4-dev-08f8549.0+08f8549",
|
|
4
4
|
"description": "Wallet backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
"lint:eslint": "eslint ."
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@agoric/vats": "0.15.2-dev-
|
|
17
|
+
"@agoric/vats": "0.15.2-dev-08f8549.0+08f8549",
|
|
18
18
|
"@endo/bundle-source": "^3.2.3",
|
|
19
19
|
"@endo/far": "^1.1.2",
|
|
20
20
|
"@endo/init": "^1.1.2",
|
|
21
21
|
"ava": "^5.3.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@agoric/assert": "0.6.1-dev-
|
|
25
|
-
"@agoric/cache": "0.3.3-dev-
|
|
26
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
27
|
-
"@agoric/internal": "0.3.3-dev-
|
|
28
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
29
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
30
|
-
"@agoric/store": "0.9.3-dev-
|
|
31
|
-
"@agoric/time": "0.3.3-dev-
|
|
32
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
33
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
34
|
-
"@agoric/zone": "0.2.3-dev-
|
|
24
|
+
"@agoric/assert": "0.6.1-dev-08f8549.0+08f8549",
|
|
25
|
+
"@agoric/cache": "0.3.3-dev-08f8549.0+08f8549",
|
|
26
|
+
"@agoric/ertp": "0.16.3-dev-08f8549.0+08f8549",
|
|
27
|
+
"@agoric/internal": "0.3.3-dev-08f8549.0+08f8549",
|
|
28
|
+
"@agoric/notifier": "0.6.3-dev-08f8549.0+08f8549",
|
|
29
|
+
"@agoric/smart-wallet": "0.5.4-dev-08f8549.0+08f8549",
|
|
30
|
+
"@agoric/store": "0.9.3-dev-08f8549.0+08f8549",
|
|
31
|
+
"@agoric/time": "0.3.3-dev-08f8549.0+08f8549",
|
|
32
|
+
"@agoric/vat-data": "0.5.3-dev-08f8549.0+08f8549",
|
|
33
|
+
"@agoric/zoe": "0.26.3-dev-08f8549.0+08f8549",
|
|
34
|
+
"@agoric/zone": "0.2.3-dev-08f8549.0+08f8549",
|
|
35
35
|
"@endo/eventual-send": "^1.2.2",
|
|
36
36
|
"@endo/marshal": "^1.5.0",
|
|
37
37
|
"@endo/nat": "^5.0.7",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"typeCoverage": {
|
|
66
66
|
"atLeast": 0
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "08f854940bab55f61cee0edc788811abe0ff5c8b"
|
|
69
69
|
}
|
package/src/lib-wallet.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* This file defines the wallet internals without dependency on the ag-solo on
|
|
@@ -579,7 +578,7 @@ export function makeWalletRoot({
|
|
|
579
578
|
status: 'complete',
|
|
580
579
|
});
|
|
581
580
|
idToOffer.set(id, completedOffer);
|
|
582
|
-
updateInboxState(id, completedOffer);
|
|
581
|
+
void updateInboxState(id, completedOffer);
|
|
583
582
|
}
|
|
584
583
|
|
|
585
584
|
/**
|
|
@@ -588,8 +587,8 @@ export function makeWalletRoot({
|
|
|
588
587
|
* @param {string} id
|
|
589
588
|
* @param {ERef<UserSeat>} seat
|
|
590
589
|
*/
|
|
591
|
-
|
|
592
|
-
E(E(seat).getExitSubscriber())
|
|
590
|
+
function subscribeToUpdates(id, seat) {
|
|
591
|
+
return E(E(seat).getExitSubscriber())
|
|
593
592
|
.subscribeAfter()
|
|
594
593
|
.then(update => updateOrResubscribe(id, seat, update));
|
|
595
594
|
}
|
|
@@ -676,7 +675,7 @@ export function makeWalletRoot({
|
|
|
676
675
|
);
|
|
677
676
|
// By the time Zoe settles the seat promise, the escrow should be complete.
|
|
678
677
|
// Reclaim if it is somehow not.
|
|
679
|
-
seat.finally(tryReclaimingWithdrawnPayments);
|
|
678
|
+
void seat.finally(tryReclaimingWithdrawnPayments);
|
|
680
679
|
|
|
681
680
|
// Even if the seat doesn't settle, we can still pipeline our request for
|
|
682
681
|
// payouts.
|
|
@@ -698,7 +697,7 @@ export function makeWalletRoot({
|
|
|
698
697
|
// Regardless of the status of the offer, we try to clean up any of our
|
|
699
698
|
// unclaimed payments. Defensively, we want to do this as soon as possible
|
|
700
699
|
// even if the seat doesn't settle.
|
|
701
|
-
depositedP.finally(tryReclaimingWithdrawnPayments);
|
|
700
|
+
void depositedP.finally(tryReclaimingWithdrawnPayments);
|
|
702
701
|
|
|
703
702
|
// Return a promise that will resolve after successful deposit, as well as
|
|
704
703
|
// the promise for the seat.
|
|
@@ -791,7 +790,7 @@ export function makeWalletRoot({
|
|
|
791
790
|
// possible display in the wallet.
|
|
792
791
|
petname = instanceMapping.suggestPetname(petname, instanceHandle);
|
|
793
792
|
// We don't wait for the update before returning.
|
|
794
|
-
updateAllState();
|
|
793
|
+
void updateAllState();
|
|
795
794
|
return `instance ${q(petname)} successfully added to wallet`;
|
|
796
795
|
};
|
|
797
796
|
|
|
@@ -829,7 +828,7 @@ export function makeWalletRoot({
|
|
|
829
828
|
await updatePursesState(petnameForPurse, purse);
|
|
830
829
|
|
|
831
830
|
// Just notice the balance updates for the purse.
|
|
832
|
-
observeNotifier(E(purse).getCurrentAmountNotifier(), {
|
|
831
|
+
void observeNotifier(E(purse).getCurrentAmountNotifier(), {
|
|
833
832
|
updateState(_balance) {
|
|
834
833
|
updatePursesState(purseMapping.valToPetname.get(purse), purse).catch(
|
|
835
834
|
e => console.error('cannot updateState', e),
|
|
@@ -1029,7 +1028,7 @@ export function makeWalletRoot({
|
|
|
1029
1028
|
petname,
|
|
1030
1029
|
});
|
|
1031
1030
|
updateDapp(dappRecord);
|
|
1032
|
-
updateAllState();
|
|
1031
|
+
void updateAllState();
|
|
1033
1032
|
return dappRecord.actions;
|
|
1034
1033
|
},
|
|
1035
1034
|
enable() {
|
|
@@ -1151,7 +1150,7 @@ export function makeWalletRoot({
|
|
|
1151
1150
|
status: 'decline',
|
|
1152
1151
|
});
|
|
1153
1152
|
idToOffer.set(id, declinedOffer);
|
|
1154
|
-
updateInboxState(id, declinedOffer);
|
|
1153
|
+
void updateInboxState(id, declinedOffer);
|
|
1155
1154
|
|
|
1156
1155
|
// Try to reclaim the invitation.
|
|
1157
1156
|
const compiledOfferP = idToCompiledOfferP.get(id);
|
|
@@ -1178,7 +1177,7 @@ export function makeWalletRoot({
|
|
|
1178
1177
|
status: 'cancel',
|
|
1179
1178
|
});
|
|
1180
1179
|
idToOffer.set(id, cancelledOffer);
|
|
1181
|
-
updateInboxState(id, cancelledOffer);
|
|
1180
|
+
return updateInboxState(id, cancelledOffer);
|
|
1182
1181
|
})
|
|
1183
1182
|
.catch(e => console.error(`Cannot cancel offer ${id}:`, e));
|
|
1184
1183
|
|
|
@@ -1204,7 +1203,7 @@ export function makeWalletRoot({
|
|
|
1204
1203
|
error: `${e}`,
|
|
1205
1204
|
});
|
|
1206
1205
|
idToOffer.set(id, rejectOffer);
|
|
1207
|
-
updateInboxState(id, rejectOffer);
|
|
1206
|
+
void updateInboxState(id, rejectOffer);
|
|
1208
1207
|
};
|
|
1209
1208
|
|
|
1210
1209
|
await null;
|
|
@@ -1214,7 +1213,7 @@ export function makeWalletRoot({
|
|
|
1214
1213
|
status: 'pending',
|
|
1215
1214
|
});
|
|
1216
1215
|
idToOffer.set(id, pendingOffer);
|
|
1217
|
-
updateInboxState(id, pendingOffer);
|
|
1216
|
+
void updateInboxState(id, pendingOffer);
|
|
1218
1217
|
const compiledOffer = await idToCompiledOfferP.get(id);
|
|
1219
1218
|
|
|
1220
1219
|
const { depositedP, seat } = await executeOffer(compiledOffer);
|
|
@@ -1226,11 +1225,11 @@ export function makeWalletRoot({
|
|
|
1226
1225
|
idToSeat.set(id, seat);
|
|
1227
1226
|
// The offer might have been postponed, or it might have been immediately
|
|
1228
1227
|
// consummated. Only subscribe if it was postponed.
|
|
1229
|
-
E(seat)
|
|
1228
|
+
void E(seat)
|
|
1230
1229
|
.hasExited()
|
|
1231
1230
|
.then(exited => {
|
|
1232
1231
|
if (!exited) {
|
|
1233
|
-
subscribeToUpdates(id, seat);
|
|
1232
|
+
return subscribeToUpdates(id, seat);
|
|
1234
1233
|
}
|
|
1235
1234
|
});
|
|
1236
1235
|
|
|
@@ -1253,7 +1252,7 @@ export function makeWalletRoot({
|
|
|
1253
1252
|
status: 'accept',
|
|
1254
1253
|
});
|
|
1255
1254
|
idToOffer.set(id, acceptedOffer);
|
|
1256
|
-
updateInboxState(id, acceptedOffer);
|
|
1255
|
+
void updateInboxState(id, acceptedOffer);
|
|
1257
1256
|
}
|
|
1258
1257
|
})
|
|
1259
1258
|
.catch(rejected);
|
|
@@ -1895,7 +1894,7 @@ export function makeWalletRoot({
|
|
|
1895
1894
|
// don't really trust.
|
|
1896
1895
|
// The param is{import('@agoric/vats/src/vat-bank.js').Bank} but that here triggers https://github.com/Agoric/agoric-sdk/issues/4620
|
|
1897
1896
|
const importBankAssets = async bank => {
|
|
1898
|
-
observeIteration(
|
|
1897
|
+
void observeIteration(
|
|
1899
1898
|
subscribeEach(E(bank).getAssetSubscription()),
|
|
1900
1899
|
harden({
|
|
1901
1900
|
async updateState({ proposedName, issuerName, issuer, brand }) {
|
package/src/wallet.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* This file defines the vat launched by the spawner in the ../deploy.js script.
|
|
@@ -173,7 +172,7 @@ export function buildRootObject(vatPowers) {
|
|
|
173
172
|
await approve();
|
|
174
173
|
const pursesNotifier = walletAdmin.getAttenuatedPursesNotifier();
|
|
175
174
|
const { notifier, updater } = makeNotifierKit();
|
|
176
|
-
observeIteration(makeApprovedNotifier(pursesNotifier), updater);
|
|
175
|
+
void observeIteration(makeApprovedNotifier(pursesNotifier), updater);
|
|
177
176
|
return notifier;
|
|
178
177
|
},
|
|
179
178
|
async getCacheCoordinator() {
|
|
@@ -202,7 +201,7 @@ export function buildRootObject(vatPowers) {
|
|
|
202
201
|
}));
|
|
203
202
|
};
|
|
204
203
|
|
|
205
|
-
observeIteration(makeApprovedNotifier(offerNotifier), {
|
|
204
|
+
void observeIteration(makeApprovedNotifier(offerNotifier), {
|
|
206
205
|
updateState(offers) {
|
|
207
206
|
updater.updateState(filteredOffers(offers));
|
|
208
207
|
},
|
|
@@ -441,7 +440,7 @@ export function buildRootObject(vatPowers) {
|
|
|
441
440
|
},
|
|
442
441
|
);
|
|
443
442
|
if (notYetEnabled) {
|
|
444
|
-
E(otherSide).dappApproved(dappOrigin);
|
|
443
|
+
await E(otherSide).dappApproved(dappOrigin);
|
|
445
444
|
}
|
|
446
445
|
};
|
|
447
446
|
|
package/test/lib-wallet.test.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
3
2
|
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
|
|
4
3
|
|
|
5
4
|
import bundleSource from '@endo/bundle-source';
|
|
@@ -1639,7 +1638,7 @@ test('stamps from dateNow', async t => {
|
|
|
1639
1638
|
await E(wallet).addPayment(pmt1);
|
|
1640
1639
|
const { value: val1a, updateCount: count1a } =
|
|
1641
1640
|
await E(paymentNotifier).getUpdateSince(count0);
|
|
1642
|
-
E(wallet).addPayment(pmt4);
|
|
1641
|
+
void E(wallet).addPayment(pmt4);
|
|
1643
1642
|
const { value: val1, updateCount: count1 } =
|
|
1644
1643
|
await E(paymentNotifier).getUpdateSince(count1a);
|
|
1645
1644
|
|