@agoric/wallet-backend 0.14.4-dev-eb7e9eb.0 → 0.14.4-u11.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/bundles/bundle-wallet-js-meta.json +273 -297
- package/bundles/bundle-wallet.js +1 -1
- package/{tsconfig.json → jsconfig.json} +0 -4
- package/package.json +21 -23
- package/src/lib-wallet.js +23 -30
- package/src/wallet.js +0 -1
- package/test/test-getPursesNotifier.js +4 -2
- package/test/test-lib-wallet.js +6 -3
- package/test/test-middleware.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/wallet-backend",
|
|
3
|
-
"version": "0.14.4-
|
|
3
|
+
"version": "0.14.4-u11.0",
|
|
4
4
|
"description": "Wallet backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -10,32 +10,30 @@
|
|
|
10
10
|
"test:xs": "exit 0",
|
|
11
11
|
"lint": "run-s --continue-on-error lint:*",
|
|
12
12
|
"lint-fix": "yarn lint:eslint --fix",
|
|
13
|
-
"lint:types": "tsc",
|
|
13
|
+
"lint:types": "tsc -p jsconfig.json",
|
|
14
14
|
"lint:eslint": "eslint ."
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@agoric/vats": "0.15.2-
|
|
18
|
-
"@endo/bundle-source": "^2.5.
|
|
19
|
-
"@endo/
|
|
20
|
-
"
|
|
21
|
-
"ava": "^5.3.0"
|
|
17
|
+
"@agoric/vats": "^0.15.2-u11.0",
|
|
18
|
+
"@endo/bundle-source": "^2.5.1",
|
|
19
|
+
"@endo/init": "^0.5.56",
|
|
20
|
+
"ava": "^5.2.0"
|
|
22
21
|
},
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@agoric/assert": "0.6.
|
|
25
|
-
"@agoric/cache": "0.3.3-
|
|
26
|
-
"@agoric/ertp": "0.16.3-
|
|
27
|
-
"@agoric/internal": "0.3.3-
|
|
28
|
-
"@agoric/notifier": "0.6.3-
|
|
29
|
-
"@agoric/smart-wallet": "0.5.4-
|
|
30
|
-
"@agoric/store": "0.9.3-
|
|
31
|
-
"@agoric/time": "0.3.3-
|
|
32
|
-
"@agoric/vat-data": "0.5.3-
|
|
33
|
-
"@agoric/zoe": "0.26.3-
|
|
34
|
-
"@
|
|
35
|
-
"@endo/
|
|
36
|
-
"@endo/
|
|
37
|
-
"@endo/
|
|
38
|
-
"@endo/promise-kit": "^0.2.57",
|
|
23
|
+
"@agoric/assert": "^0.6.0",
|
|
24
|
+
"@agoric/cache": "^0.3.3-u11.0",
|
|
25
|
+
"@agoric/ertp": "^0.16.3-u11.0",
|
|
26
|
+
"@agoric/internal": "^0.3.3-u11.0",
|
|
27
|
+
"@agoric/notifier": "^0.6.3-u11.0",
|
|
28
|
+
"@agoric/smart-wallet": "^0.5.4-u11.0",
|
|
29
|
+
"@agoric/store": "^0.9.3-u11.0",
|
|
30
|
+
"@agoric/time": "^0.3.3-u11.0",
|
|
31
|
+
"@agoric/vat-data": "^0.5.3-u11.0",
|
|
32
|
+
"@agoric/zoe": "^0.26.3-u11.0",
|
|
33
|
+
"@endo/eventual-send": "^0.17.2",
|
|
34
|
+
"@endo/marshal": "^0.8.5",
|
|
35
|
+
"@endo/nat": "^4.1.27",
|
|
36
|
+
"@endo/promise-kit": "^0.2.56",
|
|
39
37
|
"import-meta-resolve": "^2.2.1"
|
|
40
38
|
},
|
|
41
39
|
"keywords": [],
|
|
@@ -59,5 +57,5 @@
|
|
|
59
57
|
"publishConfig": {
|
|
60
58
|
"access": "public"
|
|
61
59
|
},
|
|
62
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "92b6cd72484079b0349d8ccfa4510aeb820e8d67"
|
|
63
61
|
}
|
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
|
|
@@ -727,7 +726,7 @@ export function makeWalletRoot({
|
|
|
727
726
|
// eslint-disable-next-line no-use-before-define
|
|
728
727
|
p = makeEmptyPurse(petnameForBrand, petnameForBrand, true);
|
|
729
728
|
} else {
|
|
730
|
-
p = Promise.resolve(
|
|
729
|
+
p = Promise.resolve();
|
|
731
730
|
}
|
|
732
731
|
return E.when(p, _ => petnameForBrand);
|
|
733
732
|
};
|
|
@@ -1210,7 +1209,6 @@ export function makeWalletRoot({
|
|
|
1210
1209
|
updateInboxState(id, rejectOffer);
|
|
1211
1210
|
};
|
|
1212
1211
|
|
|
1213
|
-
await null;
|
|
1214
1212
|
try {
|
|
1215
1213
|
const pendingOffer = addMeta({
|
|
1216
1214
|
...offer,
|
|
@@ -1374,7 +1372,6 @@ export function makeWalletRoot({
|
|
|
1374
1372
|
brandToAutoDepositPurse.init(brand, purse);
|
|
1375
1373
|
}
|
|
1376
1374
|
|
|
1377
|
-
await null;
|
|
1378
1375
|
if (updateState) {
|
|
1379
1376
|
await updateAllPurseState();
|
|
1380
1377
|
}
|
|
@@ -1896,32 +1893,28 @@ export function makeWalletRoot({
|
|
|
1896
1893
|
// don't really trust.
|
|
1897
1894
|
// The param is{import('@agoric/vats/src/vat-bank.js').Bank} but that here triggers https://github.com/Agoric/agoric-sdk/issues/4620
|
|
1898
1895
|
const importBankAssets = async bank => {
|
|
1899
|
-
observeIteration(
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
await
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
}
|
|
1922
|
-
},
|
|
1923
|
-
}),
|
|
1924
|
-
).finally(() => console.error('/// This is the end of the bank assets'));
|
|
1896
|
+
observeIteration(subscribeEach(E(bank).getAssetSubscription()), {
|
|
1897
|
+
async updateState({ proposedName, issuerName, issuer, brand }) {
|
|
1898
|
+
try {
|
|
1899
|
+
issuerName = await addIssuer(issuerName, issuer);
|
|
1900
|
+
const purse = await E(bank).getPurse(brand);
|
|
1901
|
+
// We can import this purse, because we trust the bank.
|
|
1902
|
+
await internalUnsafeImportPurse(
|
|
1903
|
+
issuerName,
|
|
1904
|
+
proposedName,
|
|
1905
|
+
true,
|
|
1906
|
+
purse,
|
|
1907
|
+
);
|
|
1908
|
+
} catch (e) {
|
|
1909
|
+
console.error('/// could not add bank asset purse', e, {
|
|
1910
|
+
issuerName,
|
|
1911
|
+
proposedName,
|
|
1912
|
+
issuer,
|
|
1913
|
+
brand,
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
},
|
|
1917
|
+
}).finally(() => console.error('/// This is the end of the bank assets'));
|
|
1925
1918
|
};
|
|
1926
1919
|
return {
|
|
1927
1920
|
admin: wallet,
|
package/src/wallet.js
CHANGED
|
@@ -3,8 +3,10 @@ import { test } from '@agoric/zoe/tools/prepare-test-env-ava.js';
|
|
|
3
3
|
|
|
4
4
|
import { makeIssuerKit } from '@agoric/ertp';
|
|
5
5
|
import { makeZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
|
|
6
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
6
7
|
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
|
|
7
|
-
|
|
8
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
9
|
+
import { heapZone } from '@agoric/zone';
|
|
8
10
|
import {
|
|
9
11
|
makeNameHubKit,
|
|
10
12
|
prepareMixinMyAddress,
|
|
@@ -13,7 +15,7 @@ import { makeWalletRoot } from '../src/lib-wallet.js';
|
|
|
13
15
|
|
|
14
16
|
import '../src/types.js';
|
|
15
17
|
|
|
16
|
-
const mixinMyAddress = prepareMixinMyAddress(
|
|
18
|
+
const mixinMyAddress = prepareMixinMyAddress(heapZone);
|
|
17
19
|
|
|
18
20
|
function makeFakeMyAddressNameAdmin() {
|
|
19
21
|
const { nameAdmin } = makeNameHubKit();
|
package/test/test-lib-wallet.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
|
4
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
5
|
import bundleSource from '@endo/bundle-source';
|
|
6
6
|
import { makeCache } from '@agoric/cache';
|
|
7
7
|
import { makeIssuerKit, AmountMath, AssetKind } from '@agoric/ertp';
|
|
@@ -12,20 +12,23 @@ import { makeZoeForTest } from '@agoric/zoe/tools/setup-zoe.js';
|
|
|
12
12
|
import { E } from '@endo/eventual-send';
|
|
13
13
|
|
|
14
14
|
import { assert } from '@agoric/assert';
|
|
15
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
15
16
|
import { makeFakeBoard } from '@agoric/vats/tools/board-utils.js';
|
|
17
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
16
18
|
import {
|
|
17
19
|
makeNameHubKit,
|
|
18
20
|
prepareMixinMyAddress,
|
|
19
21
|
} from '@agoric/vats/src/nameHub.js';
|
|
20
22
|
import { resolve as importMetaResolve } from 'import-meta-resolve';
|
|
21
|
-
|
|
23
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
24
|
+
import { heapZone } from '@agoric/zone';
|
|
22
25
|
import { makeWalletRoot } from '../src/lib-wallet.js';
|
|
23
26
|
|
|
24
27
|
import '../src/types.js';
|
|
25
28
|
|
|
26
29
|
const ZOE_INVITE_PURSE_PETNAME = 'Default Zoe invite purse';
|
|
27
30
|
|
|
28
|
-
const mixinMyAddress = prepareMixinMyAddress(
|
|
31
|
+
const mixinMyAddress = prepareMixinMyAddress(heapZone);
|
|
29
32
|
|
|
30
33
|
function makeFakeMyAddressNameAdmin() {
|
|
31
34
|
const { nameAdmin } = makeNameHubKit();
|