@agoric/vats 0.15.2-dev-857e650.0 → 0.15.2-dev-284e2db.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 +20 -20
- package/src/bridge.d.ts.map +1 -1
- package/src/bridge.js +23 -11
- package/src/centralSupply.d.ts.map +1 -1
- package/src/centralSupply.js +3 -3
- package/src/core/basic-behaviors.d.ts.map +1 -1
- package/src/core/basic-behaviors.js +55 -49
- package/src/core/boot-chain.js +3 -3
- package/src/core/boot-sim.js +3 -3
- package/src/core/boot-solo.js +4 -4
- package/src/core/chain-behaviors.d.ts.map +1 -1
- package/src/core/chain-behaviors.js +28 -23
- package/src/core/client-behaviors.d.ts.map +1 -1
- package/src/core/client-behaviors.js +5 -4
- package/src/core/demoIssuers.d.ts +17 -15
- package/src/core/demoIssuers.d.ts.map +1 -1
- package/src/core/demoIssuers.js +34 -34
- package/src/core/lib-boot.d.ts +9 -8
- package/src/core/lib-boot.d.ts.map +1 -1
- package/src/core/lib-boot.js +26 -15
- package/src/core/promise-space.d.ts.map +1 -1
- package/src/core/promise-space.js +14 -14
- package/src/core/startWalletFactory.d.ts +4 -1
- package/src/core/startWalletFactory.d.ts.map +1 -1
- package/src/core/startWalletFactory.js +25 -16
- package/src/core/types.d.ts +19 -278
- package/src/core/types.d.ts.map +1 -1
- package/src/core/types.js +385 -210
- package/src/core/utils.d.ts +4 -2
- package/src/core/utils.d.ts.map +1 -1
- package/src/core/utils.js +30 -28
- package/src/crc.d.ts +2 -6
- package/src/crc.d.ts.map +1 -1
- package/src/crc.js +5 -15
- package/src/ibc.d.ts +5 -5
- package/src/ibc.d.ts.map +1 -1
- package/src/ibc.js +22 -40
- package/src/lib-board.d.ts +48 -49
- package/src/lib-board.d.ts.map +1 -1
- package/src/lib-board.js +32 -39
- package/src/mintHolder.d.ts.map +1 -1
- package/src/mintHolder.js +5 -6
- package/src/nameHub.d.ts.map +1 -1
- package/src/nameHub.js +17 -7
- package/src/proposals/network-proposal.d.ts.map +1 -1
- package/src/proposals/network-proposal.js +13 -10
- package/src/proposals/restart-vats-proposal.d.ts +1 -1
- package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
- package/src/proposals/restart-vats-proposal.js +3 -3
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPool.js +9 -10
- package/src/provisionPoolKit.d.ts +14 -27
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/provisionPoolKit.js +26 -29
- package/src/repl.js +1 -1
- package/src/types.d.ts +28 -27
- package/src/types.d.ts.map +1 -1
- package/src/types.js +49 -46
- package/src/vat-bank.d.ts +49 -48
- package/src/vat-bank.d.ts.map +1 -1
- package/src/vat-bank.js +55 -50
- package/src/vat-mints.d.ts +10 -10
- package/src/vat-mints.d.ts.map +1 -1
- package/src/vat-mints.js +6 -6
- package/src/vat-provisioning.d.ts.map +1 -1
- package/src/vat-provisioning.js +11 -6
- package/src/virtual-purse.d.ts +6 -6
- package/src/virtual-purse.d.ts.map +1 -1
- package/src/virtual-purse.js +34 -33
- package/src/walletFlags.js +1 -2
- package/tools/authorityViz.d.ts.map +1 -1
- package/tools/authorityViz.js +34 -25
- package/tools/bank-utils.d.ts +1 -1
- package/tools/bank-utils.d.ts.map +1 -1
- package/tools/bank-utils.js +12 -5
- package/tools/board-utils.d.ts +1 -1
- package/tools/board-utils.d.ts.map +1 -1
- package/tools/board-utils.js +22 -14
- package/tools/boot-test-utils.d.ts.map +1 -1
- package/tools/boot-test-utils.js +7 -9
package/src/vat-bank.js
CHANGED
|
@@ -32,6 +32,7 @@ const BridgeChannelI = M.interface('BridgeChannel', {
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @typedef {import('./virtual-purse').VirtualPurseController} VirtualPurseController
|
|
35
|
+
*
|
|
35
36
|
* @typedef {Awaited<ReturnType<ReturnType<typeof prepareVirtualPurse>>>} VirtualPurse
|
|
36
37
|
*/
|
|
37
38
|
|
|
@@ -44,10 +45,14 @@ const BalanceUpdaterI = M.interface('BalanceUpdater', {
|
|
|
44
45
|
update: M.call(M.string()).optional(M.string()).returns(),
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @typedef {Pick<
|
|
50
|
+
* import('./types.js').ScopedBridgeManager,
|
|
51
|
+
* 'fromBridge' | 'toBridge'
|
|
52
|
+
* >} BridgeChannel
|
|
53
|
+
*/
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
|
-
*
|
|
51
56
|
* @param {import('@agoric/zone').Zone} zone
|
|
52
57
|
* @returns {(brand: Brand, publisher: Publisher<Amount>) => BalanceUpdater}
|
|
53
58
|
*/
|
|
@@ -76,9 +81,7 @@ const prepareBalanceUpdater = zone =>
|
|
|
76
81
|
},
|
|
77
82
|
);
|
|
78
83
|
|
|
79
|
-
/**
|
|
80
|
-
* @param {import('@agoric/zone').Zone} zone
|
|
81
|
-
*/
|
|
84
|
+
/** @param {import('@agoric/zone').Zone} zone */
|
|
82
85
|
const prepareBankPurseController = zone => {
|
|
83
86
|
/**
|
|
84
87
|
* @param {BridgeChannel} bankBridge
|
|
@@ -170,16 +173,12 @@ const prepareRewardPurseController = zone =>
|
|
|
170
173
|
},
|
|
171
174
|
);
|
|
172
175
|
|
|
173
|
-
/**
|
|
174
|
-
* @param {import('@agoric/zone').Zone} zone
|
|
175
|
-
*/
|
|
176
|
+
/** @param {import('@agoric/zone').Zone} zone */
|
|
176
177
|
const prepareBankChannelHandler = zone =>
|
|
177
178
|
zone.exoClass(
|
|
178
179
|
'BankChannelHandler',
|
|
179
180
|
BridgeHandlerI,
|
|
180
|
-
/**
|
|
181
|
-
* @param {MapStore<string, MapStore<string, BalanceUpdater>>} denomToAddressUpdater
|
|
182
|
-
*/
|
|
181
|
+
/** @param {MapStore<string, MapStore<string, BalanceUpdater>>} denomToAddressUpdater */
|
|
183
182
|
denomToAddressUpdater => ({ denomToAddressUpdater }),
|
|
184
183
|
{
|
|
185
184
|
async fromBridge(obj) {
|
|
@@ -221,7 +220,7 @@ const prepareBankChannelHandler = zone =>
|
|
|
221
220
|
* Concatenate multiple iterables to form a new one.
|
|
222
221
|
*
|
|
223
222
|
* @template T
|
|
224
|
-
* @param {
|
|
223
|
+
* @param {(Iterable<T> | AsyncIterable<T>)[]} iterables
|
|
225
224
|
*/
|
|
226
225
|
async function* concatAsyncIterables(iterables) {
|
|
227
226
|
for (const asyncIterable of iterables) {
|
|
@@ -273,12 +272,15 @@ const makeHistoricalTopic = (historyValues, futureSubscriber, skipValue) => {
|
|
|
273
272
|
return makeSubscriberFromAsyncIterable(allHistory, skipValue);
|
|
274
273
|
};
|
|
275
274
|
|
|
276
|
-
/** @type {WeakMap<MapStore<Brand, AssetDescriptor>, Promise<PublicationRecord<AssetDescriptor>>>} */
|
|
277
|
-
const fullAssetPubLists = new WeakMap();
|
|
278
|
-
|
|
279
275
|
/**
|
|
280
|
-
* @
|
|
276
|
+
* @type {WeakMap<
|
|
277
|
+
* MapStore<Brand, AssetDescriptor>,
|
|
278
|
+
* Promise<PublicationRecord<AssetDescriptor>>
|
|
279
|
+
* >}
|
|
281
280
|
*/
|
|
281
|
+
const fullAssetPubLists = new WeakMap();
|
|
282
|
+
|
|
283
|
+
/** @param {import('@agoric/zone').Zone} zone */
|
|
282
284
|
const prepareAssetSubscription = zone => {
|
|
283
285
|
const assetSubscriptionCache = zone.weakMapStore('assetSubscriptionCache');
|
|
284
286
|
|
|
@@ -358,9 +360,7 @@ const AssetIssuerKitShape = M.splitRecord(BaseIssuerKitShape, {
|
|
|
358
360
|
mint: M.remotable('Mint'),
|
|
359
361
|
});
|
|
360
362
|
|
|
361
|
-
/**
|
|
362
|
-
* @typedef {AssetIssuerKit & { denom: string, escrowPurse?: ERef<Purse> }} AssetRecord
|
|
363
|
-
*/
|
|
363
|
+
/** @typedef {AssetIssuerKit & { denom: string; escrowPurse?: ERef<Purse> }} AssetRecord */
|
|
364
364
|
|
|
365
365
|
/**
|
|
366
366
|
* @typedef {object} AssetDescriptor
|
|
@@ -372,18 +372,18 @@ const AssetIssuerKitShape = M.splitRecord(BaseIssuerKitShape, {
|
|
|
372
372
|
*/
|
|
373
373
|
|
|
374
374
|
/**
|
|
375
|
-
* @typedef {
|
|
376
|
-
* issuer: Issuer<'nat'
|
|
377
|
-
* displayInfo: DisplayInfo
|
|
375
|
+
* @typedef {AssetDescriptor & {
|
|
376
|
+
* issuer: Issuer<'nat'>; // settled identity
|
|
377
|
+
* displayInfo: DisplayInfo;
|
|
378
378
|
* }} AssetInfo
|
|
379
379
|
*/
|
|
380
380
|
|
|
381
381
|
/**
|
|
382
382
|
* @typedef {object} Bank
|
|
383
|
-
* @property {() => IterableEachTopic<AssetDescriptor>} getAssetSubscription
|
|
384
|
-
* assets as they are added to the bank
|
|
385
|
-
* @property {(brand: Brand) => Promise<VirtualPurse>} getPurse Find any
|
|
386
|
-
* (keyed by address and brand) or create a new one.
|
|
383
|
+
* @property {() => IterableEachTopic<AssetDescriptor>} getAssetSubscription
|
|
384
|
+
* Returns assets as they are added to the bank
|
|
385
|
+
* @property {(brand: Brand) => Promise<VirtualPurse>} getPurse Find any
|
|
386
|
+
* existing vpurse (keyed by address and brand) or create a new one.
|
|
387
387
|
*/
|
|
388
388
|
|
|
389
389
|
export const BankI = M.interface('Bank', {
|
|
@@ -410,7 +410,12 @@ const prepareBank = (
|
|
|
410
410
|
// we decide to partition the provider and use `brandToVPurse` directly, we'd
|
|
411
411
|
// need ephemera for each `makeBank` call.
|
|
412
412
|
const addressDenomToPurse = zone.mapStore('addressDenomToPurse');
|
|
413
|
-
/**
|
|
413
|
+
/**
|
|
414
|
+
* @type {import('@agoric/store/src/stores/store-utils.js').AtomicProvider<
|
|
415
|
+
* string,
|
|
416
|
+
* VirtualPurse
|
|
417
|
+
* >}
|
|
418
|
+
*/
|
|
414
419
|
const purseProvider = makeAtomicProvider(addressDenomToPurse);
|
|
415
420
|
|
|
416
421
|
const makeBank = zone.exoClass(
|
|
@@ -574,12 +579,17 @@ const prepareBankManager = (
|
|
|
574
579
|
const brandToAssetDescriptor = detachedZone.mapStore(
|
|
575
580
|
'brandToAssetDescriptor',
|
|
576
581
|
);
|
|
577
|
-
/**
|
|
582
|
+
/**
|
|
583
|
+
* @type {MapStore<
|
|
584
|
+
* string,
|
|
585
|
+
* { bank: Bank; brandToVPurse: MapStore<Brand, VirtualPurse> }
|
|
586
|
+
* >}
|
|
587
|
+
*/
|
|
578
588
|
const addressToBank = detachedZone.mapStore('addressToBank');
|
|
579
589
|
|
|
580
590
|
/**
|
|
581
591
|
* CAVEAT: The history for the assetSubscriber needs to be loaded into the
|
|
582
|
-
* heap on first use in this incarnation.
|
|
592
|
+
* heap on first use in this incarnation. Use provideAssetSubscription to
|
|
583
593
|
* set that up.
|
|
584
594
|
*
|
|
585
595
|
* @type {PublishKit<AssetDescriptor>}
|
|
@@ -637,7 +647,7 @@ const prepareBankManager = (
|
|
|
637
647
|
*
|
|
638
648
|
* @param {string} moduleName
|
|
639
649
|
* @returns {Promise<string | null>} address of named module account, or
|
|
640
|
-
*
|
|
650
|
+
* null if unimplemented (no bankChannel)
|
|
641
651
|
*/
|
|
642
652
|
async getModuleAccountAddress(moduleName) {
|
|
643
653
|
const { bankChannel } = this.state;
|
|
@@ -652,16 +662,17 @@ const prepareBankManager = (
|
|
|
652
662
|
},
|
|
653
663
|
|
|
654
664
|
/**
|
|
655
|
-
* Add an asset to the bank, and publish it to the subscriptions.
|
|
656
|
-
*
|
|
665
|
+
* Add an asset to the bank, and publish it to the subscriptions. If
|
|
666
|
+
* nameAdmin is defined, update with denom to AssetInfo entry.
|
|
657
667
|
*
|
|
658
|
-
* Note that AssetInfo has the settled identity of the issuer,
|
|
659
|
-
*
|
|
668
|
+
* Note that AssetInfo has the settled identity of the issuer, not just a
|
|
669
|
+
* promise for it.
|
|
660
670
|
*
|
|
661
671
|
* @param {string} denom lower-level denomination string
|
|
662
672
|
* @param {string} issuerName
|
|
663
673
|
* @param {string} proposedName
|
|
664
|
-
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
674
|
+
* @param {AssetIssuerKit & { payment?: ERef<Payment> }} kit ERTP issuer
|
|
675
|
+
* kit (mint, brand, issuer)
|
|
665
676
|
*/
|
|
666
677
|
async addAsset(denom, issuerName, proposedName, kit) {
|
|
667
678
|
const {
|
|
@@ -722,7 +733,7 @@ const prepareBankManager = (
|
|
|
722
733
|
([issuer, displayInfo]) =>
|
|
723
734
|
E(nameAdmin).update(
|
|
724
735
|
denom,
|
|
725
|
-
/** @type {
|
|
736
|
+
/** @type {AssetInfo} */ (
|
|
726
737
|
harden({
|
|
727
738
|
brand,
|
|
728
739
|
issuer,
|
|
@@ -774,9 +785,7 @@ const prepareBankManager = (
|
|
|
774
785
|
return makeBankManager;
|
|
775
786
|
};
|
|
776
787
|
|
|
777
|
-
/**
|
|
778
|
-
* @param {MapStore<string, any>} baggage
|
|
779
|
-
*/
|
|
788
|
+
/** @param {MapStore<string, any>} baggage */
|
|
780
789
|
const prepareFromBaggage = baggage => {
|
|
781
790
|
const rootZone = makeDurableZone(baggage);
|
|
782
791
|
|
|
@@ -797,9 +806,7 @@ const prepareFromBaggage = baggage => {
|
|
|
797
806
|
const makeRewardPurseController = prepareRewardPurseController(rootZone);
|
|
798
807
|
const makeBankChannelHandler = prepareBankChannelHandler(rootZone);
|
|
799
808
|
|
|
800
|
-
/**
|
|
801
|
-
* @type {import('@agoric/internal/src/callback.js').MakeAttenuator<BridgeChannel>}
|
|
802
|
-
*/
|
|
809
|
+
/** @type {import('@agoric/internal/src/callback.js').MakeAttenuator<BridgeChannel>} */
|
|
803
810
|
const makeBridgeChannelAttenuator = prepareGuardedAttenuator(
|
|
804
811
|
rootZone.subZone('attenuators'),
|
|
805
812
|
BridgeChannelI,
|
|
@@ -839,11 +846,11 @@ export function buildRootObject(_vatPowers, _args, baggage) {
|
|
|
839
846
|
|
|
840
847
|
return Far('bankMaker', {
|
|
841
848
|
/**
|
|
842
|
-
* @param {ERef<import('./types.js').ScopedBridgeManager | undefined>} [bankBridgeManagerP]
|
|
843
|
-
* manager for the "remote" bank (such as on cosmos-sdk).
|
|
844
|
-
* (such as on sim-chain), we just use local purses.
|
|
845
|
-
* @param {ERef<{ update: import('./types.js').NameAdmin['update'] }>} [nameAdminP]
|
|
846
|
-
* a NameAdmin; see addAsset() for detail.
|
|
849
|
+
* @param {ERef<import('./types.js').ScopedBridgeManager | undefined>} [bankBridgeManagerP]
|
|
850
|
+
* a bridge manager for the "remote" bank (such as on cosmos-sdk). If not
|
|
851
|
+
* supplied (such as on sim-chain), we just use local purses.
|
|
852
|
+
* @param {ERef<{ update: import('./types.js').NameAdmin['update'] }>} [nameAdminP]
|
|
853
|
+
* update facet of a NameAdmin; see addAsset() for detail.
|
|
847
854
|
*/
|
|
848
855
|
async makeBankManager(
|
|
849
856
|
bankBridgeManagerP = undefined,
|
|
@@ -856,9 +863,7 @@ export function buildRootObject(_vatPowers, _args, baggage) {
|
|
|
856
863
|
'denomToAddressUpdater',
|
|
857
864
|
);
|
|
858
865
|
|
|
859
|
-
/**
|
|
860
|
-
* @param {ERef<import('./types.js').ScopedBridgeManager>} [bankBridgeMgr]
|
|
861
|
-
*/
|
|
866
|
+
/** @param {ERef<import('./types.js').ScopedBridgeManager>} [bankBridgeMgr] */
|
|
862
867
|
async function getBankChannel(bankBridgeMgr) {
|
|
863
868
|
// We do the logic here if the bridge manager is available. Otherwise,
|
|
864
869
|
// the bank is not "remote" (such as on sim-chain), so we just use
|
package/src/vat-mints.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export function buildRootObject(): {
|
|
|
4
4
|
/** @param {string[]} issuerNames */
|
|
5
5
|
getIssuers: (issuerNames: string[]) => Issuer<AssetKind>[];
|
|
6
6
|
/**
|
|
7
|
-
* WARNING: a mint is ability to mint new digital assets,
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* WARNING: a mint is ability to mint new digital assets, a very powerful
|
|
8
|
+
* authority that is usually closely held. But this mint is for demo /
|
|
9
|
+
* faucet purposes.
|
|
10
10
|
*
|
|
11
11
|
* @param {string} name
|
|
12
12
|
*/
|
|
@@ -14,8 +14,8 @@ export function buildRootObject(): {
|
|
|
14
14
|
/** @param {string[]} issuerNames */
|
|
15
15
|
getMints: (issuerNames: string[]) => Mint<AssetKind>[];
|
|
16
16
|
/**
|
|
17
|
-
* @param {
|
|
18
|
-
* @param
|
|
17
|
+
* @param {any} issuerNameSingular For example, 'moola', or 'simolean'
|
|
18
|
+
* @param {[AssetKind?, DisplayInfo?]} issuerArgs
|
|
19
19
|
*/
|
|
20
20
|
makeMintAndIssuer: (issuerNameSingular: any, issuerArgs_0?: AssetKind | undefined, issuerArgs_1?: DisplayInfo<AssetKind> | undefined) => Issuer<"set" | "nat" | "copySet" | "copyBag">;
|
|
21
21
|
provideIssuerKit: (issuerName: any, ...issuerArgs: any[]) => {
|
|
@@ -39,9 +39,9 @@ export function buildRootObject(): {
|
|
|
39
39
|
/** @param {string[]} issuerNames */
|
|
40
40
|
getIssuers: (issuerNames: string[]) => Issuer<AssetKind>[];
|
|
41
41
|
/**
|
|
42
|
-
* WARNING: a mint is ability to mint new digital assets,
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* WARNING: a mint is ability to mint new digital assets, a very powerful
|
|
43
|
+
* authority that is usually closely held. But this mint is for demo /
|
|
44
|
+
* faucet purposes.
|
|
45
45
|
*
|
|
46
46
|
* @param {string} name
|
|
47
47
|
*/
|
|
@@ -49,8 +49,8 @@ export function buildRootObject(): {
|
|
|
49
49
|
/** @param {string[]} issuerNames */
|
|
50
50
|
getMints: (issuerNames: string[]) => Mint<AssetKind>[];
|
|
51
51
|
/**
|
|
52
|
-
* @param {
|
|
53
|
-
* @param
|
|
52
|
+
* @param {any} issuerNameSingular For example, 'moola', or 'simolean'
|
|
53
|
+
* @param {[AssetKind?, DisplayInfo?]} issuerArgs
|
|
54
54
|
*/
|
|
55
55
|
makeMintAndIssuer: (issuerNameSingular: any, issuerArgs_0?: AssetKind | undefined, issuerArgs_1?: DisplayInfo<AssetKind> | undefined) => Issuer<"set" | "nat" | "copySet" | "copyBag">;
|
|
56
56
|
provideIssuerKit: (issuerName: any, ...issuerArgs: any[]) => {
|
package/src/vat-mints.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-mints.d.ts","sourceRoot":"","sources":["vat-mints.js"],"names":[],"mappings":"AAUA;;;IAUI,oCAAoC;8BAAxB,MAAM,EAAE;IAGpB;;;;;;OAMG;oBADQ,MAAM;IAMjB,oCAAoC;4BAAxB,MAAM,EAAE;IAEpB;;;OAGG
|
|
1
|
+
{"version":3,"file":"vat-mints.d.ts","sourceRoot":"","sources":["vat-mints.js"],"names":[],"mappings":"AAUA;;;IAUI,oCAAoC;8BAAxB,MAAM,EAAE;IAGpB;;;;;;OAMG;oBADQ,MAAM;IAMjB,oCAAoC;4BAAxB,MAAM,EAAE;IAEpB;;;OAGG;4CAFQ,GAAG;;;;;;IA6Bd;;;OAGG;qCAFQ,MAAM,SACN,MAAM;IAUjB;;;OAGG;uCAFQ,MAAM,EAAE,UACR,MAAM,EAAE;;;;IA5DnB,oCAAoC;8BAAxB,MAAM,EAAE;IAGpB;;;;;;OAMG;oBADQ,MAAM;IAMjB,oCAAoC;4BAAxB,MAAM,EAAE;IAEpB;;;OAGG;4CAFQ,GAAG;;;;;;IA6Bd;;;OAGG;qCAFQ,MAAM,SACN,MAAM;IAUjB;;;OAGG;uCAFQ,MAAM,EAAE,UACR,MAAM,EAAE;GAStB"}
|
package/src/vat-mints.js
CHANGED
|
@@ -9,7 +9,7 @@ import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only
|
|
|
9
9
|
// simoleanMint.
|
|
10
10
|
|
|
11
11
|
export function buildRootObject() {
|
|
12
|
-
/** @type {MapStore<string, { mint: Mint
|
|
12
|
+
/** @type {MapStore<string, { mint: Mint; brand: Brand }>} */
|
|
13
13
|
const mintsAndBrands = makeScalarMapStore('issuerName');
|
|
14
14
|
|
|
15
15
|
const api = Far('api', {
|
|
@@ -22,9 +22,9 @@ export function buildRootObject() {
|
|
|
22
22
|
getIssuers: issuerNames => issuerNames.map(api.getIssuer),
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* WARNING: a mint is ability to mint new digital assets,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* WARNING: a mint is ability to mint new digital assets, a very powerful
|
|
26
|
+
* authority that is usually closely held. But this mint is for demo /
|
|
27
|
+
* faucet purposes.
|
|
28
28
|
*
|
|
29
29
|
* @param {string} name
|
|
30
30
|
*/
|
|
@@ -35,8 +35,8 @@ export function buildRootObject() {
|
|
|
35
35
|
/** @param {string[]} issuerNames */
|
|
36
36
|
getMints: issuerNames => issuerNames.map(api.getMint),
|
|
37
37
|
/**
|
|
38
|
-
* @param {
|
|
39
|
-
* @param
|
|
38
|
+
* @param {any} issuerNameSingular For example, 'moola', or 'simolean'
|
|
39
|
+
* @param {[AssetKind?, DisplayInfo?]} issuerArgs
|
|
40
40
|
*/
|
|
41
41
|
makeMintAndIssuer: (issuerNameSingular, ...issuerArgs) => {
|
|
42
42
|
notForProductionUse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-provisioning.d.ts","sourceRoot":"","sources":["vat-provisioning.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vat-provisioning.d.ts","sourceRoot":"","sources":["vat-provisioning.js"],"names":[],"mappings":"AAmFA;;;;GAIG;AACH,4CAJW,OAAO,kBACP,OAAO;kBAqBL,KAAK,aAAa,CAAC,KACnB,YAAY,KACZ,QAAQ;gCASR,MAAM,WACN,MAAM,cACN,MAAM,EAAE;;;;;;;;kBAbR,KAAK,aAAa,CAAC,KACnB,YAAY,KACZ,QAAQ;gCASR,MAAM,WACN,MAAM,cACN,MAAM,EAAE;;;;;;;GAsDpB"}
|
package/src/vat-provisioning.js
CHANGED
|
@@ -20,7 +20,11 @@ import {
|
|
|
20
20
|
const prepareSpecializedNameAdmin = zone => {
|
|
21
21
|
const mixinMyAddress = prepareMixinMyAddress(zone);
|
|
22
22
|
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @type {import('@agoric/internal/src/callback.js').MakeAttenuator<
|
|
25
|
+
* import('./types.js').NamesByAddressAdmin
|
|
26
|
+
* >}
|
|
27
|
+
*/
|
|
24
28
|
const specialize = prepareGuardedAttenuator(zone, NameHubIKit.nameAdmin, {
|
|
25
29
|
tag: 'NamesByAddressAdmin',
|
|
26
30
|
});
|
|
@@ -34,7 +38,10 @@ const prepareSpecializedNameAdmin = zone => {
|
|
|
34
38
|
/**
|
|
35
39
|
* @param {string} address
|
|
36
40
|
* @param {string[]} [reserved]
|
|
37
|
-
* @returns {Promise<{
|
|
41
|
+
* @returns {Promise<{
|
|
42
|
+
* nameHub: NameHub;
|
|
43
|
+
* nameAdmin: import('./types.js').MyAddressNameAdmin;
|
|
44
|
+
* }>}
|
|
38
45
|
*/
|
|
39
46
|
async provideChild(address, reserved) {
|
|
40
47
|
const { nameAdmin } = this.state;
|
|
@@ -50,7 +57,7 @@ const prepareSpecializedNameAdmin = zone => {
|
|
|
50
57
|
// XXX relies on callers not to provide other admins via update()
|
|
51
58
|
// TODO: enforce?
|
|
52
59
|
|
|
53
|
-
/** @type {
|
|
60
|
+
/** @type {import('./types').MyAddressNameAdmin} */
|
|
54
61
|
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
|
|
55
62
|
// @ts-ignore cast
|
|
56
63
|
const myAdmin = nameAdmin.lookupAdmin(address);
|
|
@@ -59,9 +66,7 @@ const prepareSpecializedNameAdmin = zone => {
|
|
|
59
66
|
},
|
|
60
67
|
);
|
|
61
68
|
|
|
62
|
-
/**
|
|
63
|
-
* @param {import('./types.js').NameAdmin} nameAdmin
|
|
64
|
-
*/
|
|
69
|
+
/** @param {import('./types.js').NameAdmin} nameAdmin */
|
|
65
70
|
const makeMyAddressNameAdmin = nameAdmin => {
|
|
66
71
|
const overrideFacet = makeOverrideFacet(nameAdmin);
|
|
67
72
|
return specialize({
|
package/src/virtual-purse.d.ts
CHANGED
|
@@ -44,20 +44,20 @@ export type Retain = (pmt: Payment, optAmountShape?: Pattern) => Promise<Amount>
|
|
|
44
44
|
export type Redeem = (amt: Amount) => Promise<Payment>;
|
|
45
45
|
/**
|
|
46
46
|
* The object that determines the
|
|
47
|
-
*
|
|
47
|
+
* remote behaviour of a virtual purse.
|
|
48
48
|
*/
|
|
49
49
|
export type VirtualPurseController = {
|
|
50
50
|
/**
|
|
51
51
|
* Tell the controller
|
|
52
|
-
* to send an amount from "us" to the "other side".
|
|
53
|
-
* success and reject on failure.
|
|
54
|
-
* operation.
|
|
52
|
+
* to send an amount from "us" to the "other side". This should resolve on
|
|
53
|
+
* success and reject on failure. IT IS IMPORTANT NEVER TO FAIL in normal
|
|
54
|
+
* operation. That will irrecoverably lose assets.
|
|
55
55
|
*/
|
|
56
56
|
pushAmount: (amount: Amount) => Promise<void>;
|
|
57
57
|
/**
|
|
58
58
|
* Tell the controller
|
|
59
|
-
* to send an amount from the "other side" to "us".
|
|
60
|
-
* success and reject on failure.
|
|
59
|
+
* to send an amount from the "other side" to "us". This should resolve on
|
|
60
|
+
* success and reject on failure. We can still recover assets from failure to
|
|
61
61
|
* pull.
|
|
62
62
|
*/
|
|
63
63
|
pullAmount: (amount: Amount) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-purse.d.ts","sourceRoot":"","sources":["virtual-purse.js"],"names":[],"mappings":"AAsBO,qDAHI,OAAO,gBACP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DjB;
|
|
1
|
+
{"version":3,"file":"virtual-purse.d.ts","sourceRoot":"","sources":["virtual-purse.js"],"names":[],"mappings":"AAsBO,qDAHI,OAAO,gBACP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DjB;AA2LM,0CADK,OAAO,cAAc,EAAE,IAAI,SAK1B,KAAK,sBAAsB,CAAC;YAG1B,KAAK,MAAM,CAAC;WACb,KAAK;;;MAWJ,QAAQ,QAAQ,MAAM,KAAK,CAAC,CAAC,CAAC,CAyB5C;uBAnOY,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;2BAGrB,OAAO,mBAAmB,OAAO,KAAK,QAAQ,MAAM,CAAC;2BACrD,MAAM,KAAK,QAAQ,OAAO,CAAC;;;;;;;;;;;;yBAKxB,MAAM,KAAK,QAAQ,IAAI,CAAC;;;;;;;yBAIxB,MAAM,KAAK,QAAQ,IAAI,CAAC;;;;;yBAIzB,KAAK,KAAK,YAAY,MAAM,CAAC"}
|
package/src/virtual-purse.js
CHANGED
|
@@ -91,30 +91,28 @@ export const makeVirtualPurseKitIKit = (
|
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* @typedef {object} VirtualPurseController The object that determines the
|
|
94
|
-
*
|
|
94
|
+
* remote behaviour of a virtual purse.
|
|
95
95
|
* @property {(amount: Amount) => Promise<void>} pushAmount Tell the controller
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
96
|
+
* to send an amount from "us" to the "other side". This should resolve on
|
|
97
|
+
* success and reject on failure. IT IS IMPORTANT NEVER TO FAIL in normal
|
|
98
|
+
* operation. That will irrecoverably lose assets.
|
|
99
99
|
* @property {(amount: Amount) => Promise<void>} pullAmount Tell the controller
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
100
|
+
* to send an amount from the "other side" to "us". This should resolve on
|
|
101
|
+
* success and reject on failure. We can still recover assets from failure to
|
|
102
|
+
* pull.
|
|
103
103
|
* @property {(brand: Brand) => LatestTopic<Amount>} getBalances Return the
|
|
104
|
-
*
|
|
104
|
+
* current balance iterable for a given brand.
|
|
105
105
|
*/
|
|
106
106
|
|
|
107
|
-
/**
|
|
108
|
-
* @param {import('@agoric/zone').Zone} zone
|
|
109
|
-
*/
|
|
107
|
+
/** @param {import('@agoric/zone').Zone} zone */
|
|
110
108
|
const prepareVirtualPurseKit = zone =>
|
|
111
109
|
zone.exoClassKit(
|
|
112
110
|
'VirtualPurseKit',
|
|
113
111
|
makeVirtualPurseKitIKit().VirtualPurseIKit,
|
|
114
112
|
/**
|
|
115
113
|
* @param {ERef<VirtualPurseController>} vpc
|
|
116
|
-
* @param {{ issuer: ERef<Issuer
|
|
117
|
-
* @param {{ recoveryPurse: ERef<Purse
|
|
114
|
+
* @param {{ issuer: ERef<Issuer>; brand: Brand; mint?: ERef<Mint> }} issuerKit
|
|
115
|
+
* @param {{ recoveryPurse: ERef<Purse>; escrowPurse?: ERef<Purse> }} purses
|
|
118
116
|
*/
|
|
119
117
|
(vpc, issuerKit, purses) => ({
|
|
120
118
|
vpc,
|
|
@@ -127,9 +125,9 @@ const prepareVirtualPurseKit = zone =>
|
|
|
127
125
|
{
|
|
128
126
|
utils: {
|
|
129
127
|
/**
|
|
130
|
-
* Claim a payment for recovery via our `recoveryPurse`.
|
|
131
|
-
* the `retain` operations (since we are just burning the
|
|
132
|
-
* depositing it directly in the `escrowPurse`).
|
|
128
|
+
* Claim a payment for recovery via our `recoveryPurse`. No need for
|
|
129
|
+
* this on the `retain` operations (since we are just burning the
|
|
130
|
+
* payment or depositing it directly in the `escrowPurse`).
|
|
133
131
|
*
|
|
134
132
|
* @param {ERef<Payment>} payment
|
|
135
133
|
* @param {Amount} [optAmountShape]
|
|
@@ -267,28 +265,31 @@ const prepareVirtualPurseKit = zone =>
|
|
|
267
265
|
},
|
|
268
266
|
);
|
|
269
267
|
|
|
270
|
-
/**
|
|
271
|
-
* @param {import('@agoric/zone').Zone} zone
|
|
272
|
-
*/
|
|
268
|
+
/** @param {import('@agoric/zone').Zone} zone */
|
|
273
269
|
export const prepareVirtualPurse = zone => {
|
|
274
270
|
const makeVirtualPurseKit = prepareVirtualPurseKit(zone);
|
|
275
271
|
|
|
276
272
|
/**
|
|
277
|
-
* @param {ERef<VirtualPurseController>} vpc the controller that represents
|
|
278
|
-
* "other side" of this purse.
|
|
279
|
-
* @param {{
|
|
280
|
-
*
|
|
281
|
-
*
|
|
273
|
+
* @param {ERef<VirtualPurseController>} vpc the controller that represents
|
|
274
|
+
* the "other side" of this purse.
|
|
275
|
+
* @param {{
|
|
276
|
+
* issuer: ERef<Issuer>;
|
|
277
|
+
* brand: Brand;
|
|
278
|
+
* mint?: ERef<Mint>;
|
|
279
|
+
* escrowPurse?: ERef<Purse>;
|
|
280
|
+
* }} params
|
|
281
|
+
* the contents of the issuer kit for "us".
|
|
282
282
|
*
|
|
283
|
-
*
|
|
284
|
-
* instead of minting/burning them.
|
|
285
|
-
* escrow doesn't support the case where the "other side" is
|
|
286
|
-
* assets... our escrow purse may not have enough assets in it
|
|
287
|
-
* ones that are sent from the "other side".
|
|
288
|
-
* @returns {Promise<Awaited<EOnly<Purse>>>} This is not just a Purse because
|
|
289
|
-
* fast-and-loose with the synchronous Purse interface.
|
|
290
|
-
* this result must only interact with the virtual purse via
|
|
291
|
-
* conceal the methods that are returning promises instead
|
|
283
|
+
* If the mint is not specified, then the virtual purse will escrow local
|
|
284
|
+
* assets instead of minting/burning them. That is a better option in
|
|
285
|
+
* general, but escrow doesn't support the case where the "other side" is
|
|
286
|
+
* also minting assets... our escrow purse may not have enough assets in it
|
|
287
|
+
* to redeem the ones that are sent from the "other side".
|
|
288
|
+
* @returns {Promise<Awaited<EOnly<Purse>>>} This is not just a Purse because
|
|
289
|
+
* it plays fast-and-loose with the synchronous Purse interface. So, the
|
|
290
|
+
* consumer of this result must only interact with the virtual purse via
|
|
291
|
+
* eventual-send (to conceal the methods that are returning promises instead
|
|
292
|
+
* of synchronously).
|
|
292
293
|
*/
|
|
293
294
|
const makeVirtualPurse = async (
|
|
294
295
|
vpc,
|
package/src/walletFlags.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// XXX domain of @agoric/cosmic-proto
|
|
2
2
|
/**
|
|
3
|
-
* non-exhaustive list of powerFlags
|
|
4
|
-
* REMOTE_WALLET is currently a default.
|
|
3
|
+
* non-exhaustive list of powerFlags REMOTE_WALLET is currently a default.
|
|
5
4
|
*
|
|
6
5
|
* See also MsgProvision in golang/cosmos/proto/agoric/swingset/msgs.proto
|
|
7
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorityViz.d.ts","sourceRoot":"","sources":["authorityViz.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"authorityViz.d.ts","sourceRoot":"","sources":["authorityViz.js"],"names":[],"mappings":";wBA8Ba;IACZ,EAAM,EAAE,MAAM,CAAC;IACf,OAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAS,EAAE,MAAM,CAAC;IAClB,KAAS,CAAC,EAAE,MAAM,CAAC;CAChB;qBAkCW,IAAI,GACZ,CAAC;IACP,aAAqB,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,SAAiB,CAAC,EAAE,OAAO,MAAM,EAAE,IAAI,CAAC,CAAC;IACzC,IAAY,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAe,CAAC,EAAE,OAAO,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,IAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,MAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,KAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,WAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,YAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,QAAgB,CAAC,EAAE,UAAU,CAAC;CACvB,GAAG,UAAU,CAAC;yBAET;IACZ,OAAW,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAW,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;qBAES,OAAO,GAAG,OAAO;sBAEjB,MAAM;mCA0IM,MAAM,UAAU,MAAM,KAAK,QAAQ,MAAM,CAAC"}
|
package/tools/authorityViz.js
CHANGED
|
@@ -25,13 +25,14 @@ const styles = {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* @param {Set<GraphNode>} nodes
|
|
28
|
-
* @param {Map<string, Set<{ id: string
|
|
29
|
-
* @yields {
|
|
28
|
+
* @param {Map<string, Set<{ id: string; style?: string }>>} neighbors
|
|
29
|
+
* @yields {string}
|
|
30
|
+
*
|
|
30
31
|
* @typedef {{
|
|
31
|
-
* id: string
|
|
32
|
-
* cluster?: string
|
|
33
|
-
* label: string
|
|
34
|
-
* style?: string
|
|
32
|
+
* id: string;
|
|
33
|
+
* cluster?: string;
|
|
34
|
+
* label: string;
|
|
35
|
+
* style?: string;
|
|
35
36
|
* }} GraphNode
|
|
36
37
|
*/
|
|
37
38
|
function* fmtGraph(nodes, neighbors) {
|
|
@@ -65,24 +66,32 @@ function* fmtGraph(nodes, neighbors) {
|
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
68
|
* @param {Record<string, Permit>} manifest
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
69
|
+
*
|
|
70
|
+
* @typedef {| true
|
|
71
|
+
* | ({
|
|
72
|
+
* vatParameters?: Record<string, Permit>;
|
|
73
|
+
* vatPowers?: Record<string, true>;
|
|
74
|
+
* vats?: Record<string, Status>;
|
|
75
|
+
* devices?: Record<string, true>;
|
|
76
|
+
* home?: PowerSpace;
|
|
77
|
+
* issuer?: PowerSpace;
|
|
78
|
+
* brand?: PowerSpace;
|
|
79
|
+
* oracleBrand?: PowerSpace;
|
|
80
|
+
* installation?: PowerSpace;
|
|
81
|
+
* instance?: PowerSpace;
|
|
82
|
+
* } & PowerSpace)} Permit
|
|
83
|
+
*
|
|
84
|
+
* @typedef {{
|
|
85
|
+
* produce?: Record<string, Status>;
|
|
86
|
+
* consume?: Record<string, Status>;
|
|
87
|
+
* }} PowerSpace
|
|
88
|
+
*
|
|
89
|
+
* @typedef {boolean | VatName} Status
|
|
90
|
+
*
|
|
91
|
+
* @typedef {string} VatName
|
|
83
92
|
*/
|
|
84
93
|
const manifest2graph = manifest => {
|
|
85
|
-
/** @type {
|
|
94
|
+
/** @type {Set<GraphNode>} */
|
|
86
95
|
const nodes = new Set();
|
|
87
96
|
const neighbors = new Map();
|
|
88
97
|
|
|
@@ -212,9 +221,9 @@ const loadConfig = async (specifier, { resolve, readFile }) => {
|
|
|
212
221
|
* @param {typeof import('process').stdout} io.stdout
|
|
213
222
|
* @param {typeof import('fs/promises')} io.fsp
|
|
214
223
|
* @param {{
|
|
215
|
-
* resolve: Resolver
|
|
216
|
-
* url: string
|
|
217
|
-
* load: (specifier: string) => Promise<Record<string, any
|
|
224
|
+
* resolve: Resolver;
|
|
225
|
+
* url: string;
|
|
226
|
+
* load: (specifier: string) => Promise<Record<string, any>>;
|
|
218
227
|
* }} io.meta
|
|
219
228
|
*
|
|
220
229
|
* @typedef {(specifier: string, parent: string) => Promise<string>} Resolver
|
package/tools/bank-utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeFakeBankKit(issuerKits:
|
|
1
|
+
export function makeFakeBankKit(issuerKits: Pick<IssuerKit, 'brand' | 'issuer'>[]): {
|
|
2
2
|
addAsset: (denom: string, issuerName: string, proposedName: string, kit: import('../src/vat-bank.js').AssetIssuerKit) => void;
|
|
3
3
|
assetPublication: IterationObserver<import("../src/vat-bank.js").AssetDescriptor>;
|
|
4
4
|
bank: import("../src/vat-bank.js").Bank;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-utils.d.ts","sourceRoot":"","sources":["bank-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bank-utils.d.ts","sourceRoot":"","sources":["bank-utils.js"],"names":[],"mappings":"AAOO,4CADK,KAAK,SAAS,EAAE,OAAO,GAAG,QAAQ,CAAC,EAAE;sBA2BpC,MAAM,cACN,MAAM,gBACN,MAAM,OACN,OAAO,oBAAoB,EAAE,cAAc;;;EAqBvD"}
|