@agoric/vats 0.15.1 → 0.15.2-calypso-dev-84eb287.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/README.md +3 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +9 -0
- package/package.json +43 -48
- package/scripts/build-bundles.js +19 -0
- package/src/bridge-target.d.ts +193 -0
- package/src/bridge-target.d.ts.map +1 -0
- package/src/bridge-target.js +316 -0
- package/src/bridge.d.ts +14 -4
- package/src/bridge.d.ts.map +1 -1
- package/src/bridge.js +45 -16
- package/src/centralSupply.d.ts +3 -3
- package/src/centralSupply.d.ts.map +1 -1
- package/src/centralSupply.js +3 -5
- package/src/core/README.md +1 -1
- package/src/core/basic-behaviors.d.ts +24 -39
- package/src/core/basic-behaviors.d.ts.map +1 -1
- package/src/core/basic-behaviors.js +63 -63
- package/src/core/boot-chain.d.ts +178 -44
- package/src/core/boot-chain.d.ts.map +1 -1
- package/src/core/boot-chain.js +5 -5
- package/src/core/boot-sim.d.ts +5 -43
- package/src/core/boot-sim.d.ts.map +1 -1
- package/src/core/boot-sim.js +3 -4
- package/src/core/boot-solo.d.ts +5 -43
- package/src/core/boot-solo.d.ts.map +1 -1
- package/src/core/boot-solo.js +4 -5
- package/src/core/chain-behaviors.d.ts +10 -26
- package/src/core/chain-behaviors.d.ts.map +1 -1
- package/src/core/chain-behaviors.js +38 -42
- package/src/core/client-behaviors.d.ts +2 -1
- package/src/core/client-behaviors.d.ts.map +1 -1
- package/src/core/client-behaviors.js +6 -5
- package/src/core/core-eval-env.d.ts +40 -0
- package/src/core/demoIssuers.d.ts +24 -26
- package/src/core/demoIssuers.d.ts.map +1 -1
- package/src/core/demoIssuers.js +37 -37
- package/src/core/lib-boot.d.ts +17 -53
- package/src/core/lib-boot.d.ts.map +1 -1
- package/src/core/lib-boot.js +52 -60
- package/src/core/promise-space.d.ts +4 -7
- package/src/core/promise-space.d.ts.map +1 -1
- package/src/core/promise-space.js +15 -16
- package/src/core/sim-behaviors.d.ts +3 -3
- package/src/core/sim-behaviors.d.ts.map +1 -1
- package/src/core/sim-behaviors.js +1 -1
- package/src/core/startWalletFactory.d.ts +23 -27
- package/src/core/startWalletFactory.d.ts.map +1 -1
- package/src/core/startWalletFactory.js +32 -18
- package/src/core/types-ambient.d.ts +538 -0
- package/src/core/types-ambient.js +1 -0
- package/src/core/utils.d.ts +47 -92
- package/src/core/utils.d.ts.map +1 -1
- package/src/core/utils.js +58 -50
- package/src/crc.d.ts +2 -6
- package/src/crc.d.ts.map +1 -1
- package/src/crc.js +5 -16
- package/src/ibc.d.ts +30 -35
- package/src/ibc.d.ts.map +1 -1
- package/src/ibc.js +740 -491
- package/src/lib-board.d.ts +49 -121
- package/src/lib-board.d.ts.map +1 -1
- package/src/lib-board.js +49 -50
- package/src/localchain.d.ts +195 -0
- package/src/localchain.d.ts.map +1 -0
- package/src/localchain.js +324 -0
- package/src/mintHolder.d.ts +6 -4
- package/src/mintHolder.d.ts.map +1 -1
- package/src/mintHolder.js +19 -21
- package/src/nameHub.d.ts +27 -5
- package/src/nameHub.d.ts.map +1 -1
- package/src/nameHub.js +33 -26
- package/src/priceAuthorityRegistry.d.ts +21 -0
- package/src/priceAuthorityRegistry.d.ts.map +1 -0
- package/src/priceAuthorityRegistry.js +220 -0
- package/src/proposals/kread-proposal.d.ts +15 -0
- package/src/proposals/kread-proposal.d.ts.map +1 -0
- package/src/proposals/kread-proposal.js +24 -0
- package/src/proposals/localchain-proposal.d.ts +62 -0
- package/src/proposals/localchain-proposal.d.ts.map +1 -0
- package/src/proposals/localchain-proposal.js +128 -0
- package/src/proposals/localchain-test.d.ts +25 -0
- package/src/proposals/localchain-test.d.ts.map +1 -0
- package/src/proposals/localchain-test.js +89 -0
- package/src/proposals/namesByAddress-fix-proposal.d.ts +22 -0
- package/src/proposals/namesByAddress-fix-proposal.d.ts.map +1 -0
- package/src/proposals/namesByAddress-fix-proposal.js +55 -0
- package/src/proposals/network-proposal.d.ts +23 -8
- package/src/proposals/network-proposal.d.ts.map +1 -1
- package/src/proposals/network-proposal.js +90 -65
- package/src/proposals/probeZcfBundle.d.ts +26 -0
- package/src/proposals/probeZcfBundle.d.ts.map +1 -0
- package/src/proposals/probeZcfBundle.js +72 -0
- package/src/proposals/restart-vats-proposal.d.ts +4 -2
- package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
- package/src/proposals/restart-vats-proposal.js +20 -8
- package/src/proposals/transfer-proposal.d.ts +37 -0
- package/src/proposals/transfer-proposal.d.ts.map +1 -0
- package/src/proposals/transfer-proposal.js +115 -0
- package/src/proposals/upgrade-bank-proposal.d.ts +27 -0
- package/src/proposals/upgrade-bank-proposal.d.ts.map +1 -0
- package/src/proposals/upgrade-bank-proposal.js +42 -0
- package/src/proposals/upgrade-provisionPool-proposal.d.ts +27 -0
- package/src/proposals/upgrade-provisionPool-proposal.d.ts.map +1 -0
- package/src/proposals/upgrade-provisionPool-proposal.js +67 -0
- package/src/proposals/upgrade-zoe-proposal.d.ts +27 -0
- package/src/proposals/upgrade-zoe-proposal.d.ts.map +1 -0
- package/src/proposals/upgrade-zoe-proposal.js +42 -0
- package/src/proposals/vtransfer-echoer.d.ts +24 -0
- package/src/proposals/vtransfer-echoer.d.ts.map +1 -0
- package/src/proposals/vtransfer-echoer.js +42 -0
- package/src/proposals/zcf-only-proposal.d.ts +33 -0
- package/src/proposals/zcf-only-proposal.d.ts.map +1 -0
- package/src/proposals/zcf-only-proposal.js +36 -0
- package/src/proposals/zcf-proposal.d.ts +30 -0
- package/src/proposals/zcf-proposal.d.ts.map +1 -0
- package/src/proposals/zcf-proposal.js +50 -0
- package/src/repl.d.ts +3 -3
- package/src/repl.d.ts.map +1 -1
- package/src/repl.js +11 -5
- package/src/transfer.d.ts +111 -0
- package/src/transfer.d.ts.map +1 -0
- package/src/transfer.js +260 -0
- package/src/types.d.ts +237 -105
- package/src/types.js +1 -97
- package/src/vat-agoricNames.d.ts +4 -4
- package/src/vat-agoricNames.d.ts.map +1 -1
- package/src/vat-agoricNames.js +2 -4
- package/src/vat-bank.d.ts +217 -149
- package/src/vat-bank.d.ts.map +1 -1
- package/src/vat-bank.js +96 -68
- package/src/vat-board.d.ts +24 -24
- package/src/vat-board.d.ts.map +1 -1
- package/src/vat-board.js +0 -1
- package/src/vat-bridge.d.ts +9 -23
- package/src/vat-bridge.d.ts.map +1 -1
- package/src/vat-bridge.js +1 -2
- package/src/vat-ibc.d.ts +16 -4
- package/src/vat-ibc.d.ts.map +1 -1
- package/src/vat-ibc.js +20 -9
- package/src/vat-localchain.d.ts +37 -0
- package/src/vat-localchain.d.ts.map +1 -0
- package/src/vat-localchain.js +29 -0
- package/src/vat-mints.d.ts +31 -31
- package/src/vat-mints.d.ts.map +1 -1
- package/src/vat-mints.js +6 -7
- package/src/vat-network.d.ts +69 -1
- package/src/vat-network.d.ts.map +1 -1
- package/src/vat-network.js +45 -3
- package/src/vat-priceAuthority.d.ts +4 -4
- package/src/vat-priceAuthority.d.ts.map +1 -1
- package/src/vat-priceAuthority.js +1 -1
- package/src/vat-provisioning.d.ts +6 -6
- package/src/vat-provisioning.d.ts.map +1 -1
- package/src/vat-provisioning.js +15 -12
- package/src/vat-transfer.d.ts +81 -0
- package/src/vat-transfer.d.ts.map +1 -0
- package/src/vat-transfer.js +63 -0
- package/src/vat-zoe.d.ts +4 -1
- package/src/vat-zoe.d.ts.map +1 -1
- package/src/vat-zoe.js +10 -2
- package/src/virtual-purse.d.ts +46 -21
- package/src/virtual-purse.d.ts.map +1 -1
- package/src/virtual-purse.js +57 -46
- package/src/walletFlags.d.ts +2 -2
- package/src/walletFlags.js +1 -2
- package/tools/bank-utils.d.ts +20 -0
- package/tools/bank-utils.d.ts.map +1 -0
- package/tools/bank-utils.js +92 -0
- package/tools/board-utils.d.ts +39 -0
- package/tools/board-utils.d.ts.map +1 -0
- package/tools/board-utils.js +92 -0
- package/tools/boot-test-utils.d.ts +88 -0
- package/tools/boot-test-utils.d.ts.map +1 -0
- package/tools/boot-test-utils.js +157 -0
- package/tools/fake-bridge.d.ts +18 -0
- package/tools/fake-bridge.d.ts.map +1 -0
- package/tools/fake-bridge.js +289 -0
- package/tools/ibc-utils.d.ts +29 -0
- package/tools/ibc-utils.d.ts.map +1 -0
- package/tools/ibc-utils.js +115 -0
- package/decentral-core-config.json +0 -66
- package/decentral-demo-config.json +0 -155
- package/decentral-devnet-config.json +0 -216
- package/decentral-itest-vaults-config.json +0 -210
- package/decentral-main-vaults-config.json +0 -229
- package/decentral-test-vaults-config.json +0 -195
- package/demo-proposals.json +0 -5
- package/exported.js +0 -1
- package/jsconfig.build.json +0 -12
- package/jsconfig.json +0 -13
- package/src/core/types.d.ts +0 -764
- package/src/core/types.d.ts.map +0 -1
- package/src/core/types.js +0 -347
- package/src/provisionPool.d.ts +0 -164
- package/src/provisionPool.d.ts.map +0 -1
- package/src/provisionPool.js +0 -113
- package/src/provisionPoolKit.d.ts +0 -392
- package/src/provisionPoolKit.d.ts.map +0 -1
- package/src/provisionPoolKit.js +0 -464
- package/src/tokens.d.ts +0 -36
- package/src/tokens.d.ts.map +0 -1
- package/src/tokens.js +0 -37
- package/src/types.d.ts.map +0 -1
- package/src/vat-sharing.d.ts +0 -54
- package/src/vat-sharing.d.ts.map +0 -1
- package/src/vat-sharing.js +0 -14
package/src/core/demoIssuers.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @jessie.js/no-nested-await -- demo file */
|
|
2
1
|
import { AmountMath, AssetKind } from '@agoric/ertp';
|
|
3
2
|
import { split, splitMany } from '@agoric/ertp/src/legacy-payment-helpers.js';
|
|
4
3
|
import {
|
|
@@ -8,7 +7,7 @@ import {
|
|
|
8
7
|
import { E, Far } from '@endo/far';
|
|
9
8
|
import { Nat } from '@endo/nat';
|
|
10
9
|
import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only.js';
|
|
11
|
-
import { Stake, Stable } from '
|
|
10
|
+
import { Stake, Stable } from '@agoric/internal/src/tokens.js';
|
|
12
11
|
|
|
13
12
|
const { Fail, quote: q } = assert;
|
|
14
13
|
const { multiply, floorDivide } = natSafeMath;
|
|
@@ -26,7 +25,7 @@ export const DecimalPlaces = {
|
|
|
26
25
|
simolean: 0,
|
|
27
26
|
};
|
|
28
27
|
|
|
29
|
-
/** @type {Record<string, { proposedName: string
|
|
28
|
+
/** @type {Record<string, { proposedName: string; balance: bigint }>} */
|
|
30
29
|
const FaucetPurseDetail = {
|
|
31
30
|
[Stake.symbol]: {
|
|
32
31
|
proposedName: Stake.proposedName,
|
|
@@ -93,19 +92,21 @@ const defaultConfig = /** @type {const} */ ({
|
|
|
93
92
|
|
|
94
93
|
/**
|
|
95
94
|
* @typedef {readonly [bigint, bigint]} Rational
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* }
|
|
95
|
+
* @type {Record<
|
|
96
|
+
* string,
|
|
97
|
+
* {
|
|
98
|
+
* config?: {
|
|
99
|
+
* collateralValue: bigint;
|
|
100
|
+
* initialMargin: Rational;
|
|
101
|
+
* liquidationMargin: Rational;
|
|
102
|
+
* liquidationPenalty: Rational;
|
|
103
|
+
* interestRate: Rational;
|
|
104
|
+
* mintFee: Rational;
|
|
105
|
+
* liquidationPadding?: Rational;
|
|
106
|
+
* };
|
|
107
|
+
* trades: { central: number; collateral: bigint }[];
|
|
108
|
+
* }
|
|
109
|
+
* >}
|
|
109
110
|
*/
|
|
110
111
|
export const AMMDemoState = {
|
|
111
112
|
// TODO: getRUN makes BLD obsolete here
|
|
@@ -183,9 +184,9 @@ const run2places = f =>
|
|
|
183
184
|
/**
|
|
184
185
|
* @param {bigint} value
|
|
185
186
|
* @param {{
|
|
186
|
-
* centralSupplyInstall: ERef<Installation
|
|
187
|
-
* feeMintAccess: ERef<FeeMintAccess
|
|
188
|
-
* zoe: ERef<ZoeService
|
|
187
|
+
* centralSupplyInstall: ERef<Installation>;
|
|
188
|
+
* feeMintAccess: ERef<FeeMintAccess>;
|
|
189
|
+
* zoe: ERef<ZoeService>;
|
|
189
190
|
* }} powers
|
|
190
191
|
* @returns {Promise<Payment<'nat'>>}
|
|
191
192
|
*/
|
|
@@ -208,7 +209,7 @@ const mintRunPayment = async (
|
|
|
208
209
|
|
|
209
210
|
/**
|
|
210
211
|
* @param {string} name
|
|
211
|
-
* @param {MintsVat} mints
|
|
212
|
+
* @param {ERef<MintsVat>} mints
|
|
212
213
|
*/
|
|
213
214
|
const provideCoin = async (name, mints) => {
|
|
214
215
|
return E(mints).provideIssuerKit(name, AssetKind.NAT, {
|
|
@@ -217,17 +218,14 @@ const provideCoin = async (name, mints) => {
|
|
|
217
218
|
};
|
|
218
219
|
|
|
219
220
|
/**
|
|
220
|
-
* @param {
|
|
221
|
-
* { consume: {loadVat: VatLoader<MintsVat>} }
|
|
222
|
-
* } powers
|
|
221
|
+
* @param {BootstrapSpace} powers TODO: sync this type with end-user docs?
|
|
223
222
|
*
|
|
224
|
-
* TODO: sync this type with end-user docs?
|
|
225
223
|
* @typedef {{
|
|
226
|
-
* issuer: ERef<Issuer
|
|
227
|
-
* issuerPetname: string
|
|
228
|
-
* payment: Payment
|
|
229
|
-
* brand: Brand
|
|
230
|
-
* pursePetname: string
|
|
224
|
+
* issuer: ERef<Issuer>;
|
|
225
|
+
* issuerPetname: string;
|
|
226
|
+
* payment: Payment;
|
|
227
|
+
* brand: Brand;
|
|
228
|
+
* pursePetname: string;
|
|
231
229
|
* }} UserPaymentRecord
|
|
232
230
|
*/
|
|
233
231
|
export const connectFaucet = async ({
|
|
@@ -244,6 +242,7 @@ export const connectFaucet = async ({
|
|
|
244
242
|
},
|
|
245
243
|
produce: { mints },
|
|
246
244
|
}) => {
|
|
245
|
+
assert(mints);
|
|
247
246
|
const vats = {
|
|
248
247
|
mints: E(loadVat)('mints'),
|
|
249
248
|
};
|
|
@@ -284,6 +283,7 @@ export const connectFaucet = async ({
|
|
|
284
283
|
entries(FaucetPurseDetail).map(async ([issuerName, record]) => {
|
|
285
284
|
/** @param {string} name */
|
|
286
285
|
const provideIssuerKit = async name => {
|
|
286
|
+
await null;
|
|
287
287
|
switch (name) {
|
|
288
288
|
case Stable.symbol:
|
|
289
289
|
return stableIssuerKit;
|
|
@@ -334,7 +334,7 @@ export const connectFaucet = async ({
|
|
|
334
334
|
/**
|
|
335
335
|
* reap the spoils of our on-chain provisioning.
|
|
336
336
|
*
|
|
337
|
-
* @returns {Promise<
|
|
337
|
+
* @returns {Promise<UserPaymentRecord[]>}
|
|
338
338
|
*/
|
|
339
339
|
tapFaucet: async () => faucetPaymentInfo,
|
|
340
340
|
getFeePurse() {
|
|
@@ -389,7 +389,7 @@ export const ammPoolRunDeposits = issuers => {
|
|
|
389
389
|
/**
|
|
390
390
|
* @param {Payment} bootstrapPayment
|
|
391
391
|
* @param {Record<string, bigint>} balances
|
|
392
|
-
* @param {{ issuer: ERef<Issuer
|
|
392
|
+
* @param {{ issuer: ERef<Issuer>; brand: Brand }} central
|
|
393
393
|
*/
|
|
394
394
|
export const splitAllCentralPayments = async (
|
|
395
395
|
bootstrapPayment,
|
|
@@ -421,9 +421,9 @@ export const splitAllCentralPayments = async (
|
|
|
421
421
|
|
|
422
422
|
/**
|
|
423
423
|
* @param {string} issuerName
|
|
424
|
-
* @param {typeof AMMDemoState['ATOM']} record
|
|
425
|
-
* @param {Record<string, { issuer: ERef<Issuer
|
|
426
|
-
* @param {{ issuer: ERef<Issuer<'nat'
|
|
424
|
+
* @param {(typeof AMMDemoState)['ATOM']} record
|
|
425
|
+
* @param {Record<string, { issuer: ERef<Issuer>; brand: Brand }>} kits
|
|
426
|
+
* @param {{ issuer: ERef<Issuer<'nat'>>; brand: Brand<'nat'> }} central
|
|
427
427
|
*/
|
|
428
428
|
export const poolRates = (issuerName, record, kits, central) => {
|
|
429
429
|
/** @param {bigint} n */
|
|
@@ -462,7 +462,7 @@ export const poolRates = (issuerName, record, kits, central) => {
|
|
|
462
462
|
};
|
|
463
463
|
|
|
464
464
|
/**
|
|
465
|
-
* @param {
|
|
466
|
-
*
|
|
467
|
-
*
|
|
465
|
+
* @param {import('@agoric/inter-protocol/src/proposals/econ-behaviors.js').EconomyBootstrapPowers & {
|
|
466
|
+
* consume: { mints };
|
|
467
|
+
* }} powers
|
|
468
468
|
*/
|
package/src/core/lib-boot.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeBootstrap(vatPowers: import("@agoric/swingset-vat").
|
|
1
|
+
export function makeBootstrap(vatPowers: import("@agoric/swingset-vat").VatPowers & {
|
|
2
2
|
D: DProxy;
|
|
3
3
|
logger: (msg: any) => void;
|
|
4
4
|
}, vatParameters: Record<string, unknown>, bootManifest: BootstrapManifest, behaviors: Record<string, BootBehavior>, modules: BootModules, zone?: import("@agoric/zone").Zone | undefined): {
|
|
@@ -12,32 +12,13 @@ export function makeBootstrap(vatPowers: import("@agoric/swingset-vat").Terminat
|
|
|
12
12
|
consumeItem: (name: any) => Promise<unknown>;
|
|
13
13
|
produceItem: (name: any, resolution: any) => void;
|
|
14
14
|
resetItem: (name: any) => void;
|
|
15
|
-
|
|
16
|
-
name: any;
|
|
17
|
-
methodName: any;
|
|
18
|
-
args?: any[] | undefined;
|
|
19
|
-
}) => Promise<any>;
|
|
20
|
-
messageVatObject: ({ presence, methodName, args }: {
|
|
21
|
-
presence: any;
|
|
22
|
-
methodName: any;
|
|
23
|
-
args?: any[] | undefined;
|
|
24
|
-
}) => Promise<any>;
|
|
25
|
-
messageVatObjectSendOnly: ({ presence, methodName, args }: {
|
|
26
|
-
presence: any;
|
|
27
|
-
methodName: any;
|
|
28
|
-
args?: any[] | undefined;
|
|
29
|
-
}) => void;
|
|
30
|
-
awaitVatObject: ({ presence, path, rawOutput }: {
|
|
31
|
-
presence: any;
|
|
32
|
-
path?: any[] | undefined;
|
|
33
|
-
rawOutput?: boolean | undefined;
|
|
34
|
-
}) => Promise<any>;
|
|
15
|
+
awaitVatObject: (presence: any, path?: any[]) => Promise<any>;
|
|
35
16
|
/**
|
|
36
17
|
* @template K, V
|
|
37
18
|
* @param {MapStore<K, V>} store
|
|
38
19
|
*/
|
|
39
20
|
snapshotStore: <K, V>(store: MapStore<K, V>) => [K, V][];
|
|
40
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
21
|
+
} & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
41
22
|
/**
|
|
42
23
|
* Bootstrap vats and devices.
|
|
43
24
|
*
|
|
@@ -48,51 +29,34 @@ export function makeBootstrap(vatPowers: import("@agoric/swingset-vat").Terminat
|
|
|
48
29
|
consumeItem: (name: any) => Promise<unknown>;
|
|
49
30
|
produceItem: (name: any, resolution: any) => void;
|
|
50
31
|
resetItem: (name: any) => void;
|
|
51
|
-
|
|
52
|
-
name: any;
|
|
53
|
-
methodName: any;
|
|
54
|
-
args?: any[] | undefined;
|
|
55
|
-
}) => Promise<any>;
|
|
56
|
-
messageVatObject: ({ presence, methodName, args }: {
|
|
57
|
-
presence: any;
|
|
58
|
-
methodName: any;
|
|
59
|
-
args?: any[] | undefined;
|
|
60
|
-
}) => Promise<any>;
|
|
61
|
-
messageVatObjectSendOnly: ({ presence, methodName, args }: {
|
|
62
|
-
presence: any;
|
|
63
|
-
methodName: any;
|
|
64
|
-
args?: any[] | undefined;
|
|
65
|
-
}) => void;
|
|
66
|
-
awaitVatObject: ({ presence, path, rawOutput }: {
|
|
67
|
-
presence: any;
|
|
68
|
-
path?: any[] | undefined;
|
|
69
|
-
rawOutput?: boolean | undefined;
|
|
70
|
-
}) => Promise<any>;
|
|
32
|
+
awaitVatObject: (presence: any, path?: any[]) => Promise<any>;
|
|
71
33
|
/**
|
|
72
34
|
* @template K, V
|
|
73
35
|
* @param {MapStore<K, V>} store
|
|
74
36
|
*/
|
|
75
37
|
snapshotStore: <K, V>(store: MapStore<K, V>) => [K, V][];
|
|
76
38
|
}>;
|
|
77
|
-
export type BootstrapManifestPermit =
|
|
78
|
-
[key: string]: BootstrapManifestPermit;
|
|
39
|
+
export type BootstrapManifestPermit = true | string | {
|
|
40
|
+
[key: string]: BootstrapManifestPermit | undefined;
|
|
79
41
|
};
|
|
80
42
|
/**
|
|
81
|
-
* A manifest is an object in which each key is the name of a function to run
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
43
|
+
* A manifest is an object in which each key is the name of a function to run at
|
|
44
|
+
* bootstrap and the corresponding value is a "permit" describing an attenuation
|
|
45
|
+
* of allPowers that should be provided as its first argument (cf.
|
|
46
|
+
* packages/vats/src/core/boot.js).
|
|
85
47
|
*
|
|
86
48
|
* A permit is either
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
49
|
+
*
|
|
50
|
+
* - `true` or a string (both meaning no attenuation, with a string serving as a
|
|
51
|
+
* grouping label for convenience and diagram generation), or
|
|
52
|
+
* - an object whose keys identify properties to preserve and whose values are
|
|
53
|
+
* themselves (recursive) permits.
|
|
91
54
|
*/
|
|
92
55
|
export type BootstrapManifest = Record<string, BootstrapManifestPermit>;
|
|
93
56
|
export type BootBehavior = (powers: any, config?: any) => Promise<void>;
|
|
94
57
|
export type ModuleNamespace = Record<string, unknown>;
|
|
95
58
|
export type BootModules = {
|
|
96
|
-
utils: typeof import(
|
|
59
|
+
utils: typeof import("./utils.js");
|
|
97
60
|
} & Record<string, Record<string, any>>;
|
|
61
|
+
export type BootstrapRootObject = Awaited<ReturnType<typeof makeBootstrap>>;
|
|
98
62
|
//# sourceMappingURL=lib-boot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-boot.d.ts","sourceRoot":"","sources":["lib-boot.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib-boot.d.ts","sourceRoot":"","sources":["lib-boot.js"],"names":[],"mappings":"AA0DO,yCAVI,OAAO,sBAAsB,EAAE,SAAS,GAAG;IACrD,CAAK,EAAE,MAAM,CAAC;IACd,MAAU,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACvB,iBACO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,gBACvB,iBAAiB,aACjB,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,WAC5B,WAAW;IAoHlB;;;;;OAKG;sBAFQ,YAAY,WACZ,WAAW,GAAG,YAAY;;;;;IAoCrC;;;OAGG;oBAFU,CAAC,EAAE,CAAC,SACN,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;;IA1CzB;;;;;OAKG;sBAFQ,YAAY,WACZ,WAAW,GAAG,YAAY;;;;;IAoCrC;;;OAGG;oBAFU,CAAC,EAAE,CAAC,SACN,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;GAK5B;sCA9MY,IAAI,GACV,MAAM,GACN;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS,CAAA;CAAE;;;;;;;;;;;;;;gCAgBhD,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;2BAIvC,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC;8BAE5C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;0BAEvB;IAAE,KAAK,EAAE,cAAc,YAAY,CAAC,CAAA;CAAE,GAAG,MAAM,CAC3D,MAAU,EACV,MAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CACpB;kCAkLU,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/src/core/lib-boot.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
// @ts-check
|
|
2
1
|
import { E, Far } from '@endo/far';
|
|
3
|
-
import {
|
|
4
|
-
import { heapZone } from '@agoric/zone';
|
|
2
|
+
import { makeHeapZone } from '@agoric/zone';
|
|
5
3
|
import {
|
|
6
4
|
makeVatSpace,
|
|
7
5
|
makeWellKnownSpaces,
|
|
@@ -12,38 +10,45 @@ import { makePromiseSpace } from './promise-space.js';
|
|
|
12
10
|
const { Fail, quote: q } = assert;
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
|
-
* @typedef {true
|
|
13
|
+
* @typedef {true
|
|
14
|
+
* | string
|
|
15
|
+
* | { [key: string]: BootstrapManifestPermit | undefined }} BootstrapManifestPermit
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* A manifest is an object in which each key is the name of a function to run
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* A manifest is an object in which each key is the name of a function to run at
|
|
20
|
+
* bootstrap and the corresponding value is a "permit" describing an attenuation
|
|
21
|
+
* of allPowers that should be provided as its first argument (cf.
|
|
22
|
+
* packages/vats/src/core/boot.js).
|
|
23
23
|
*
|
|
24
24
|
* A permit is either
|
|
25
|
-
* - `true` or a string (both meaning no attenuation, with a string serving
|
|
26
|
-
* as a grouping label for convenience and diagram generation), or
|
|
27
|
-
* - an object whose keys identify properties to preserve and whose values
|
|
28
|
-
* are themselves (recursive) permits.
|
|
29
25
|
*
|
|
30
|
-
*
|
|
26
|
+
* - `true` or a string (both meaning no attenuation, with a string serving as a
|
|
27
|
+
* grouping label for convenience and diagram generation), or
|
|
28
|
+
* - an object whose keys identify properties to preserve and whose values are
|
|
29
|
+
* themselves (recursive) permits.
|
|
31
30
|
*
|
|
31
|
+
* @typedef {Record<string, BootstrapManifestPermit>} BootstrapManifest
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* @typedef {(powers:
|
|
35
|
+
* @typedef {(powers: any, config?: any) => Promise<void>} BootBehavior
|
|
36
|
+
*
|
|
36
37
|
* @typedef {Record<string, unknown>} ModuleNamespace
|
|
37
|
-
*
|
|
38
|
+
*
|
|
39
|
+
* @typedef {{ utils: typeof import('./utils.js') } & Record<
|
|
40
|
+
* string,
|
|
41
|
+
* Record<string, any>
|
|
42
|
+
* >} BootModules
|
|
38
43
|
*/
|
|
39
44
|
|
|
40
45
|
/** @type {<X>(a: X[], b: X[]) => X[]} */
|
|
41
46
|
const setDiff = (a, b) => a.filter(x => !b.includes(x));
|
|
42
47
|
|
|
43
48
|
/**
|
|
44
|
-
* @param {VatPowers & {
|
|
45
|
-
* D: DProxy
|
|
46
|
-
* logger: (msg) => void
|
|
49
|
+
* @param {import('@agoric/swingset-vat').VatPowers & {
|
|
50
|
+
* D: DProxy;
|
|
51
|
+
* logger: (msg) => void;
|
|
47
52
|
* }} vatPowers
|
|
48
53
|
* @param {Record<string, unknown>} vatParameters
|
|
49
54
|
* @param {BootstrapManifest} bootManifest
|
|
@@ -57,7 +62,7 @@ export const makeBootstrap = (
|
|
|
57
62
|
bootManifest,
|
|
58
63
|
behaviors,
|
|
59
64
|
modules,
|
|
60
|
-
zone =
|
|
65
|
+
zone = makeHeapZone(),
|
|
61
66
|
) => {
|
|
62
67
|
const { keys } = Object;
|
|
63
68
|
const extra = setDiff(keys(bootManifest), keys(behaviors));
|
|
@@ -93,9 +98,8 @@ export const makeBootstrap = (
|
|
|
93
98
|
);
|
|
94
99
|
|
|
95
100
|
const namesVat = namedVat.consume.agoricNames;
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
).getNameHubKit();
|
|
101
|
+
const nameHubKit = await E(namesVat).getNameHubKit();
|
|
102
|
+
const { nameHub: agoricNames, nameAdmin: agoricNamesAdmin } = nameHubKit;
|
|
99
103
|
const spaces = await makeWellKnownSpaces(agoricNamesAdmin, log);
|
|
100
104
|
produce.agoricNames.resolve(agoricNames);
|
|
101
105
|
produce.agoricNamesAdmin.resolve(agoricNamesAdmin);
|
|
@@ -132,30 +136,37 @@ export const makeBootstrap = (
|
|
|
132
136
|
|
|
133
137
|
await runBehaviors(bootManifest);
|
|
134
138
|
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
/** @type {{ coreProposalCodeSteps?: string[] }} */
|
|
140
|
+
const { coreProposalCodeSteps } = vatParameters;
|
|
141
|
+
if (!coreProposalCodeSteps) {
|
|
137
142
|
return;
|
|
138
143
|
}
|
|
139
144
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
json_permits: 'true',
|
|
146
|
-
js_code: coreProposalCode,
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
};
|
|
150
|
-
/** @type {{coreEvalBridgeHandler: Promise<import('../types.js').BridgeHandler>}} */
|
|
145
|
+
/**
|
|
146
|
+
* @type {{
|
|
147
|
+
* coreEvalBridgeHandler: Promise<import('../types.js').BridgeHandler>;
|
|
148
|
+
* }}
|
|
149
|
+
*/
|
|
151
150
|
// @ts-expect-error cast
|
|
152
151
|
const { coreEvalBridgeHandler } = consume;
|
|
153
|
-
|
|
152
|
+
|
|
153
|
+
// Start the governance from the core proposals.
|
|
154
|
+
for await (const coreProposalCode of coreProposalCodeSteps) {
|
|
155
|
+
const coreEvalMessage = {
|
|
156
|
+
type: 'CORE_EVAL',
|
|
157
|
+
evals: [
|
|
158
|
+
{
|
|
159
|
+
json_permits: 'true',
|
|
160
|
+
js_code: coreProposalCode,
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
};
|
|
164
|
+
await E(coreEvalBridgeHandler).fromBridge(coreEvalMessage);
|
|
165
|
+
}
|
|
154
166
|
};
|
|
155
167
|
|
|
156
168
|
// For testing supports
|
|
157
169
|
const vatData = new Map();
|
|
158
|
-
const { encodePassable, decodePassable } = makePassableEncoding();
|
|
159
170
|
|
|
160
171
|
return Far('bootstrap', {
|
|
161
172
|
/**
|
|
@@ -191,32 +202,12 @@ export const makeBootstrap = (
|
|
|
191
202
|
},
|
|
192
203
|
|
|
193
204
|
//#region testing supports
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const { root } = vat;
|
|
197
|
-
const decodedArgs = args.map(decodePassable);
|
|
198
|
-
const result = await E(root)[methodName](...decodedArgs);
|
|
199
|
-
return encodePassable(result);
|
|
200
|
-
},
|
|
201
|
-
messageVatObject: async ({ presence, methodName, args = [] }) => {
|
|
202
|
-
const object = decodePassable(presence);
|
|
203
|
-
const decodedArgs = args.map(decodePassable);
|
|
204
|
-
const result = await E(object)[methodName](...decodedArgs);
|
|
205
|
-
return encodePassable(result);
|
|
206
|
-
},
|
|
207
|
-
/* Like `messageVatObject` but does not await return value */
|
|
208
|
-
messageVatObjectSendOnly: ({ presence, methodName, args = [] }) => {
|
|
209
|
-
const object = decodePassable(presence);
|
|
210
|
-
const decodedArgs = args.map(decodePassable);
|
|
211
|
-
void E(object)[methodName](...decodedArgs);
|
|
212
|
-
},
|
|
213
|
-
awaitVatObject: async ({ presence, path = [], rawOutput = false }) => {
|
|
214
|
-
let value = await decodePassable(presence);
|
|
205
|
+
awaitVatObject: async (presence, path = []) => {
|
|
206
|
+
let value = await presence;
|
|
215
207
|
for (const key of path) {
|
|
216
|
-
// eslint-disable-next-line no-await-in-loop
|
|
217
208
|
value = await value[key];
|
|
218
209
|
}
|
|
219
|
-
return
|
|
210
|
+
return value;
|
|
220
211
|
},
|
|
221
212
|
/**
|
|
222
213
|
* @template K, V
|
|
@@ -226,3 +217,4 @@ export const makeBootstrap = (
|
|
|
226
217
|
//#endregion
|
|
227
218
|
});
|
|
228
219
|
};
|
|
220
|
+
/** @typedef {Awaited<ReturnType<typeof makeBootstrap>>} BootstrapRootObject */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function makeLogHooks(log: typeof console.log): PromiseSpaceHooks;
|
|
2
|
-
export function makeStoreHooks(store: MapStore<string, Passable>, log?: {
|
|
2
|
+
export function makeStoreHooks(store: MapStore<string, import("@endo/marshal").Passable>, log?: {
|
|
3
3
|
(...data: any[]): void;
|
|
4
4
|
(message?: any, ...optionalParams: any[]): void;
|
|
5
5
|
} | undefined): PromiseSpaceHooks;
|
|
@@ -7,15 +7,12 @@ export function makePromiseSpace<T extends Record<string, unknown> = Record<stri
|
|
|
7
7
|
(...data: any[]): void;
|
|
8
8
|
(message?: any, ...optionalParams: any[]): void;
|
|
9
9
|
} | ({
|
|
10
|
-
log?:
|
|
11
|
-
(...data: any[]): void;
|
|
12
|
-
(message?: any, ...optionalParams: any[]): void;
|
|
13
|
-
} | undefined;
|
|
10
|
+
log?: typeof console.log;
|
|
14
11
|
} & ({
|
|
15
|
-
hooks?: PromiseSpaceHooks
|
|
12
|
+
hooks?: PromiseSpaceHooks;
|
|
16
13
|
} | {
|
|
17
14
|
store: MapStore<string, any>;
|
|
18
|
-
})) | undefined): PromiseSpaceOf<T
|
|
15
|
+
})) | undefined): PromiseSpaceOf<T>;
|
|
19
16
|
export type PromiseSpaceHooks = {
|
|
20
17
|
onAddKey: (key: string) => void;
|
|
21
18
|
onResolve: (key: string, value: ERef<unknown>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise-space.d.ts","sourceRoot":"","sources":["promise-space.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"promise-space.d.ts","sourceRoot":"","sources":["promise-space.js"],"names":[],"mappings":"AAoBO,kCAHI,OAAO,OAAO,CAAC,GAAG,GAChB,iBAAiB,CAS1B;AAUG,sCAJI,QAAQ,CAAC,MAAM,EAAE,OAAO,eAAe,EAAE,QAAQ,CAAC;;;gBAEhD,iBAAiB,CAkC7B;AAgBM,iCARiC,CAAC,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE;;;;UAClB,OAAO,OAAO,CAAC,GAAG;;YACjB,iBAAiB;;WAClB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;kBAG5B,cAAc,CAAC,CAAC,CAAC,CAuG7B;gCApLY;IACZ,QAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3D,SAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAC7D,OAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-check
|
|
2
1
|
import { E } from '@endo/far';
|
|
3
2
|
import { assertKey } from '@agoric/store';
|
|
4
3
|
import { canBeDurable } from '@agoric/vat-data';
|
|
@@ -6,17 +5,17 @@ import { makePromiseKit } from '@endo/promise-kit';
|
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* @typedef {{
|
|
9
|
-
* onAddKey: (key: string) => void
|
|
10
|
-
* onResolve: (key: string, value: ERef<unknown>) => void
|
|
11
|
-
* onSettled: (key: string, remaining: Set<string>) => void
|
|
12
|
-
* onReset: (key: string) => void
|
|
8
|
+
* onAddKey: (key: string) => void;
|
|
9
|
+
* onResolve: (key: string, value: ERef<unknown>) => void;
|
|
10
|
+
* onSettled: (key: string, remaining: Set<string>) => void;
|
|
11
|
+
* onReset: (key: string) => void;
|
|
13
12
|
* }} PromiseSpaceHooks
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
15
|
const noop = harden(() => {});
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
|
-
* @param {
|
|
18
|
+
* @param {typeof console.log} log
|
|
20
19
|
* @returns {PromiseSpaceHooks}
|
|
21
20
|
*/
|
|
22
21
|
export const makeLogHooks = log =>
|
|
@@ -29,11 +28,11 @@ export const makeLogHooks = log =>
|
|
|
29
28
|
});
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
|
-
* Note: caller is responsible for synchronization
|
|
33
|
-
*
|
|
31
|
+
* Note: caller is responsible for synchronization in case of onResolve() called
|
|
32
|
+
* with a promise.
|
|
34
33
|
*
|
|
35
|
-
* @param {MapStore<string, Passable>} store
|
|
36
|
-
* @param {
|
|
34
|
+
* @param {MapStore<string, import('@endo/marshal').Passable>} store
|
|
35
|
+
* @param {typeof console.log} [log]
|
|
37
36
|
* @returns {PromiseSpaceHooks}
|
|
38
37
|
*/
|
|
39
38
|
export const makeStoreHooks = (store, log = noop) => {
|
|
@@ -77,9 +76,11 @@ export const makeStoreHooks = (store, log = noop) => {
|
|
|
77
76
|
* Note: repeated resolve()s without an intervening reset() are noops.
|
|
78
77
|
*
|
|
79
78
|
* @template {Record<string, unknown>} [T=Record<string, unknown>]
|
|
80
|
-
* @param {{ log?: typeof console.log } & (
|
|
81
|
-
*
|
|
82
|
-
*
|
|
79
|
+
* @param {({ log?: typeof console.log } & (
|
|
80
|
+
* | { hooks?: PromiseSpaceHooks }
|
|
81
|
+
* | { store: MapStore<string, any> }
|
|
82
|
+
* ))
|
|
83
|
+
* | typeof console.log} [optsOrLog]
|
|
83
84
|
* @returns {PromiseSpaceOf<T>}
|
|
84
85
|
*/
|
|
85
86
|
export const makePromiseSpace = (optsOrLog = {}) => {
|
|
@@ -91,9 +92,7 @@ export const makePromiseSpace = (optsOrLog = {}) => {
|
|
|
91
92
|
: opts.hooks || makeLogHooks(log);
|
|
92
93
|
const { onAddKey, onSettled, onResolve, onReset } = hooks;
|
|
93
94
|
|
|
94
|
-
/**
|
|
95
|
-
* @typedef {{ pk: PromiseRecord<any>, isSettling: boolean }} PromiseState
|
|
96
|
-
*/
|
|
95
|
+
/** @typedef {{ pk: PromiseRecord<any>; isSettling: boolean }} PromiseState */
|
|
97
96
|
/** @type {Map<string, PromiseState>} */
|
|
98
97
|
const nameToState = new Map();
|
|
99
98
|
/** @type {Set<string>} */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { connectFaucet };
|
|
2
2
|
export function installSimEgress({ vatParameters: { argv }, vats: { vattp, comms }, consume: { clientCreator }, }: BootstrapPowers): Promise<void>;
|
|
3
3
|
export function grantRunBehaviors({ runBehaviors, consume: { client }, }: BootstrapPowers): Promise<void>;
|
|
4
|
-
/** @type {import('./lib-boot').BootstrapManifest} */
|
|
5
|
-
export const SIM_CHAIN_BOOTSTRAP_PERMITS: import(
|
|
6
|
-
import { connectFaucet } from
|
|
4
|
+
/** @type {import('./lib-boot.js').BootstrapManifest} */
|
|
5
|
+
export const SIM_CHAIN_BOOTSTRAP_PERMITS: import("./lib-boot.js").BootstrapManifest;
|
|
6
|
+
import { connectFaucet } from './demoIssuers.js';
|
|
7
7
|
//# sourceMappingURL=sim-behaviors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-behaviors.d.ts","sourceRoot":"","sources":["sim-behaviors.js"],"names":[],"mappings":";AAOO,mHADK,eAAe,iBAoB1B;AAIM,0EADK,eAAe,iBAS1B;AAGD,
|
|
1
|
+
{"version":3,"file":"sim-behaviors.d.ts","sourceRoot":"","sources":["sim-behaviors.js"],"names":[],"mappings":";AAOO,mHADK,eAAe,iBAoB1B;AAIM,0EADK,eAAe,iBAS1B;AAGD,wDAAwD;AACxD,0CADW,OAAO,eAAe,EAAE,iBAAiB,CA8BlD;8BAtE4B,kBAAkB"}
|
|
@@ -39,7 +39,7 @@ export const grantRunBehaviors = async ({
|
|
|
39
39
|
};
|
|
40
40
|
harden(grantRunBehaviors);
|
|
41
41
|
|
|
42
|
-
/** @type {import('./lib-boot').BootstrapManifest} */
|
|
42
|
+
/** @type {import('./lib-boot.js').BootstrapManifest} */
|
|
43
43
|
export const SIM_CHAIN_BOOTSTRAP_PERMITS = {
|
|
44
44
|
[installSimEgress.name]: {
|
|
45
45
|
vatParameters: { argv: { hardcodedClientAddresses: true } },
|
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
export function startWalletFactory({ vatParameters: { chainStorageEntries }, consume: { agoricNames, bankManager, board, walletBridgeManager: walletBridgeManagerP, provisionWalletBridgeManager: provisionWalletBridgeManagerP, chainStorage, namesByAddressAdmin: namesByAddressAdminP, econCharterKit, startUpgradable, startGovernedUpgradable, }, produce: { client, walletFactoryStartResult, provisionPoolStartResult }, installation: { consume: { walletFactory, provisionPool }, }, instance: { produce: instanceProduce }, brand: { consume: { [Stable.symbol]: feeBrandP }, }, issuer: { consume: { [Stable.symbol]: feeIssuerP }, }, }:
|
|
2
|
-
|
|
3
|
-
}, {}, {
|
|
4
|
-
loadVat: VatLoader<unknown>;
|
|
5
|
-
loadCriticalVat: VatLoader<unknown>;
|
|
6
|
-
}> & {
|
|
7
|
-
zone: import("@agoric/zone").Zone;
|
|
8
|
-
devices: SoloDevices | ChainDevices;
|
|
9
|
-
vats: SwingsetVats;
|
|
10
|
-
vatPowers: {
|
|
11
|
-
[prop: string]: any;
|
|
12
|
-
D: DProxy;
|
|
13
|
-
};
|
|
14
|
-
vatParameters: BootstrapVatParams;
|
|
15
|
-
runBehaviors: (manifest: unknown) => Promise<unknown>;
|
|
16
|
-
modules: Record<string, Record<string, any>>;
|
|
17
|
-
} & ChainStorageVatParams & PromiseSpaceOf<{
|
|
18
|
-
economicCommitteeCreatorFacet: import('@agoric/governance/src/committee.js').CommitteeElectorateCreatorFacet;
|
|
1
|
+
export function startWalletFactory({ vatParameters: { chainStorageEntries }, consume: { agoricNames, bankManager, board, walletBridgeManager: walletBridgeManagerP, provisionWalletBridgeManager: provisionWalletBridgeManagerP, chainStorage, namesByAddressAdmin: namesByAddressAdminP, econCharterKit, startUpgradable, startGovernedUpgradable, }, produce: { client, walletFactoryStartResult, provisionPoolStartResult }, installation: { consume: { walletFactory, provisionPool }, }, instance: { produce: instanceProduce }, brand: { consume: { [Stable.symbol]: feeBrandP }, }, issuer: { consume: { [Stable.symbol]: feeIssuerP }, }, }: BootstrapPowers & ChainStorageVatParams & PromiseSpaceOf<{
|
|
2
|
+
economicCommitteeCreatorFacet: import("@agoric/governance/src/committee.js").CommitteeElectorateCreatorFacet;
|
|
19
3
|
econCharterKit: {
|
|
20
|
-
creatorFacet: Awaited<ReturnType<typeof import("@agoric/inter-protocol/src/econCommitteeCharter.js")[
|
|
4
|
+
creatorFacet: Awaited<ReturnType<typeof import("@agoric/inter-protocol/src/econCommitteeCharter.js")["start"]>>["creatorFacet"];
|
|
21
5
|
adminFacet: AdminFacet;
|
|
22
6
|
};
|
|
23
|
-
walletBridgeManager: import(
|
|
24
|
-
provisionWalletBridgeManager: import(
|
|
25
|
-
}
|
|
7
|
+
walletBridgeManager: import("../types.js").ScopedBridgeManager<"wallet">;
|
|
8
|
+
provisionWalletBridgeManager: import("../types.js").ScopedBridgeManager<"provisionWallet">;
|
|
9
|
+
}>, { options: { perAccountInitialValue } }?: {
|
|
26
10
|
options?: {
|
|
27
|
-
perAccountInitialValue?: bigint
|
|
28
|
-
}
|
|
11
|
+
perAccountInitialValue?: bigint;
|
|
12
|
+
};
|
|
29
13
|
} | undefined): Promise<void>;
|
|
30
14
|
export const WALLET_FACTORY_MANIFEST: {
|
|
31
15
|
[x: string]: {
|
|
@@ -130,12 +114,24 @@ export function getManifestForWalletFactory({ restoreRef }: {
|
|
|
130
114
|
};
|
|
131
115
|
};
|
|
132
116
|
export type WalletFactoryStartResult = Awaited<ReturnType<typeof startFactoryInstance>>;
|
|
133
|
-
import { Stable } from
|
|
117
|
+
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
134
118
|
/**
|
|
135
119
|
* @param {ERef<ZoeService>} zoe
|
|
136
|
-
* @param {Installation<
|
|
120
|
+
* @param {Installation<
|
|
121
|
+
* import('@agoric/smart-wallet/src/walletFactory.js').start
|
|
122
|
+
* >} inst
|
|
123
|
+
*
|
|
124
|
+
*
|
|
137
125
|
* @typedef {Awaited<ReturnType<typeof startFactoryInstance>>} WalletFactoryStartResult
|
|
138
126
|
*/
|
|
139
|
-
declare function startFactoryInstance(zoe: ERef<ZoeService>, inst: Installation<
|
|
127
|
+
declare function startFactoryInstance(zoe: ERef<ZoeService>, inst: Installation<import("@agoric/smart-wallet/src/walletFactory.js").start>): Promise<import("@agoric/zoe/src/zoeService/utils.js").StartedInstanceKit<(zcf: ZCF<SmartWalletContractTerms>, privateArgs: {
|
|
128
|
+
storageNode: ERef<StorageNode>;
|
|
129
|
+
walletBridgeManager?: ERef<import("../types.js").ScopedBridgeManager<"wallet">>;
|
|
130
|
+
walletReviver?: ERef<WalletReviver>;
|
|
131
|
+
}, baggage: import("@agoric/vat-data").Baggage) => Promise<{
|
|
132
|
+
creatorFacet: import("@endo/exo").Guarded<{
|
|
133
|
+
provideSmartWallet(address: string, bank: ERef<import("../vat-bank.js").Bank>, namesByAddressAdmin: ERef<import("../types.js").NameAdmin>): Promise<[wallet: import("@agoric/smart-wallet/src/smartWallet.js").SmartWallet, isNew: boolean]>;
|
|
134
|
+
}>;
|
|
135
|
+
}>>>;
|
|
140
136
|
export {};
|
|
141
137
|
//# sourceMappingURL=startWalletFactory.d.ts.map
|