@agoric/vats 0.15.2-dev-7ffae88.0 → 0.15.2-dev-c5284e4.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 +24 -24
- package/src/core/chain-behaviors.d.ts.map +1 -1
- package/src/core/chain-behaviors.js +1 -7
- package/src/core/client-behaviors.d.ts +1 -0
- package/src/core/client-behaviors.d.ts.map +1 -1
- package/src/core/client-behaviors.js +1 -0
- package/src/core/startWalletFactory.d.ts +4 -4
- package/src/core/types-ambient.d.ts +1 -0
- package/src/core/utils.d.ts +2 -2
- package/src/core/utils.d.ts.map +1 -1
- package/src/core/utils.js +13 -13
- package/src/ibc.d.ts +63 -25
- package/src/ibc.d.ts.map +1 -1
- package/src/ibc.js +671 -457
- package/src/localchain.d.ts +22 -0
- package/src/localchain.d.ts.map +1 -0
- package/src/localchain.js +106 -0
- package/src/proposals/localchain-proposal.d.ts +405 -0
- package/src/proposals/localchain-proposal.d.ts.map +1 -0
- package/src/proposals/localchain-proposal.js +114 -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 +81 -0
- package/src/proposals/network-proposal.d.ts +42 -1
- package/src/proposals/network-proposal.d.ts.map +1 -1
- package/src/proposals/network-proposal.js +58 -42
- 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 +2 -0
- package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
- package/src/proposals/restart-vats-proposal.js +13 -1
- package/src/proposals/zcf-proposal.d.ts.map +1 -1
- package/src/proposals/zcf-proposal.js +1 -0
- package/src/vat-bridge.d.ts +16 -2
- package/src/vat-bridge.d.ts.map +1 -1
- package/src/vat-ibc.d.ts +43 -3
- package/src/vat-ibc.d.ts.map +1 -1
- package/src/vat-ibc.js +20 -9
- package/src/vat-localchain.d.ts +33 -0
- package/src/vat-localchain.d.ts.map +1 -0
- package/src/vat-localchain.js +24 -0
- package/src/vat-network.d.ts +67 -1
- package/src/vat-network.d.ts.map +1 -1
- package/src/vat-network.js +39 -3
- package/tools/boot-test-utils.d.ts +8 -2
- package/tools/boot-test-utils.d.ts.map +1 -1
- package/tools/boot-test-utils.js +2 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
2
|
+
/**
|
|
3
|
+
* Create a local chain that allows permissionlessly making fresh local
|
|
4
|
+
* chain accounts, then using them to send chain queries and transactions.
|
|
5
|
+
*
|
|
6
|
+
* @param {import('./types').ScopedBridgeManager} system
|
|
7
|
+
*/
|
|
8
|
+
makeLocalChain(system: import('./types').ScopedBridgeManager): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
9
|
+
createAccount(): Promise<import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
10
|
+
getAddress(): Promise<string>;
|
|
11
|
+
allBalances(): Promise<any>;
|
|
12
|
+
executeTx(messages: any): Promise<any>;
|
|
13
|
+
}>>;
|
|
14
|
+
query(messages: any): Promise<any>;
|
|
15
|
+
}>;
|
|
16
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
17
|
+
/**
|
|
18
|
+
* Create a local chain that allows permissionlessly making fresh local
|
|
19
|
+
* chain accounts, then using them to send chain queries and transactions.
|
|
20
|
+
*
|
|
21
|
+
* @param {import('./types').ScopedBridgeManager} system
|
|
22
|
+
*/
|
|
23
|
+
makeLocalChain(system: import('./types').ScopedBridgeManager): import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
24
|
+
createAccount(): Promise<import("@endo/exo/src/exo-makers.js").Guarded<{
|
|
25
|
+
getAddress(): Promise<string>;
|
|
26
|
+
allBalances(): Promise<any>;
|
|
27
|
+
executeTx(messages: any): Promise<any>;
|
|
28
|
+
}>>;
|
|
29
|
+
query(messages: any): Promise<any>;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
export type LocalChainVat = ReturnType<typeof buildRootObject>;
|
|
33
|
+
//# sourceMappingURL=vat-localchain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vat-localchain.d.ts","sourceRoot":"","sources":["vat-localchain.js"],"names":[],"mappings":"AAMO;IAKH;;;;;OAKG;2BADQ,OAAO,SAAS,EAAE,mBAAmB;;;;;;;;;IAJhD;;;;;OAKG;2BADQ,OAAO,SAAS,EAAE,mBAAmB;;;;;;;;GAMnD;4BAEa,WAAW,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { Far } from '@endo/far';
|
|
3
|
+
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
4
|
+
|
|
5
|
+
import { prepareLocalChainTools } from './localchain.js';
|
|
6
|
+
|
|
7
|
+
export const buildRootObject = (_vatPowers, _args, baggage) => {
|
|
8
|
+
const zone = makeDurableZone(baggage);
|
|
9
|
+
const { makeLocalChain } = prepareLocalChainTools(zone.subZone('localchain'));
|
|
10
|
+
|
|
11
|
+
return Far('LocalChainVat', {
|
|
12
|
+
/**
|
|
13
|
+
* Create a local chain that allows permissionlessly making fresh local
|
|
14
|
+
* chain accounts, then using them to send chain queries and transactions.
|
|
15
|
+
*
|
|
16
|
+
* @param {import('./types').ScopedBridgeManager} system
|
|
17
|
+
*/
|
|
18
|
+
makeLocalChain(system) {
|
|
19
|
+
return makeLocalChain(system);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @typedef {ReturnType<typeof buildRootObject>} LocalChainVat */
|
package/src/vat-network.d.ts
CHANGED
|
@@ -1,2 +1,68 @@
|
|
|
1
|
-
export function buildRootObject():
|
|
1
|
+
export function buildRootObject(_vatPowers: any, _args: any, baggage: any): {
|
|
2
|
+
makeLoopbackProtocolHandler: (instancePrefix?: string | undefined) => import("@endo/exo/src/exo-makers").Guarded<{
|
|
3
|
+
onCreate(_impl: any, _protocolHandler: any): Promise<void>;
|
|
4
|
+
generatePortID(_localAddr: any, _protocolHandler: any): Promise<string>;
|
|
5
|
+
onBind(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
|
|
6
|
+
onConnect(_port: any, localAddr: any, remoteAddr: any, _chandler: any, protocolHandler: any): Promise<{
|
|
7
|
+
remoteInstance: any;
|
|
8
|
+
handler: ConnectionHandler;
|
|
9
|
+
}>;
|
|
10
|
+
onInstantiate(_port: any, _localAddr: any, _remote: any, _protocol: any): Promise<string>;
|
|
11
|
+
onListen(port: any, localAddr: any, listenHandler: any, _protocolHandler: any): Promise<void>;
|
|
12
|
+
onListenRemove(port: Port, localAddr: string, listenHandler: ListenHandler, _protocolHandler: any): Promise<void>;
|
|
13
|
+
onRevoke(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
|
|
14
|
+
}>;
|
|
15
|
+
makeEchoConnectionKit: () => import("@endo/exo/src/exo-makers").GuardedKit<{
|
|
16
|
+
handler: {
|
|
17
|
+
onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
|
|
18
|
+
onClose(_connection: Connection, _reason?: any, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
listener: {
|
|
21
|
+
onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<import("@endo/exo/src/exo-makers").Guarded<{
|
|
22
|
+
onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
|
|
23
|
+
onClose(_connection: Connection, _reason?: any, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
|
|
24
|
+
}>>;
|
|
25
|
+
onListen(port: any, _listenHandler: any): Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
/** @param {Parameters<typeof protocol.registerProtocolHandler>} args */
|
|
29
|
+
registerProtocolHandler: (paths: string[], protocolHandler: ProtocolHandler) => void;
|
|
30
|
+
/** @param {Parameters<typeof protocol.unregisterProtocolHandler>} args */
|
|
31
|
+
unregisterProtocolHandler: (prefix: string, protocolHandler: ProtocolHandler) => void;
|
|
32
|
+
/** @param {Parameters<typeof protocol.bind>} args */
|
|
33
|
+
bind: (localAddr: string) => Promise<Port | import("@agoric/vow").Vow<Port>>;
|
|
34
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
35
|
+
makeLoopbackProtocolHandler: (instancePrefix?: string | undefined) => import("@endo/exo/src/exo-makers").Guarded<{
|
|
36
|
+
onCreate(_impl: any, _protocolHandler: any): Promise<void>;
|
|
37
|
+
generatePortID(_localAddr: any, _protocolHandler: any): Promise<string>;
|
|
38
|
+
onBind(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
|
|
39
|
+
onConnect(_port: any, localAddr: any, remoteAddr: any, _chandler: any, protocolHandler: any): Promise<{
|
|
40
|
+
remoteInstance: any;
|
|
41
|
+
handler: ConnectionHandler;
|
|
42
|
+
}>;
|
|
43
|
+
onInstantiate(_port: any, _localAddr: any, _remote: any, _protocol: any): Promise<string>;
|
|
44
|
+
onListen(port: any, localAddr: any, listenHandler: any, _protocolHandler: any): Promise<void>;
|
|
45
|
+
onListenRemove(port: Port, localAddr: string, listenHandler: ListenHandler, _protocolHandler: any): Promise<void>;
|
|
46
|
+
onRevoke(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
|
|
47
|
+
}>;
|
|
48
|
+
makeEchoConnectionKit: () => import("@endo/exo/src/exo-makers").GuardedKit<{
|
|
49
|
+
handler: {
|
|
50
|
+
onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
|
|
51
|
+
onClose(_connection: Connection, _reason?: any, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
|
|
52
|
+
};
|
|
53
|
+
listener: {
|
|
54
|
+
onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<import("@endo/exo/src/exo-makers").Guarded<{
|
|
55
|
+
onReceive(_connection: Connection, bytes: string, _connectionHandler: ConnectionHandler): Promise<string>;
|
|
56
|
+
onClose(_connection: Connection, _reason?: any, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
|
|
57
|
+
}>>;
|
|
58
|
+
onListen(port: any, _listenHandler: any): Promise<void>;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
/** @param {Parameters<typeof protocol.registerProtocolHandler>} args */
|
|
62
|
+
registerProtocolHandler: (paths: string[], protocolHandler: ProtocolHandler) => void;
|
|
63
|
+
/** @param {Parameters<typeof protocol.unregisterProtocolHandler>} args */
|
|
64
|
+
unregisterProtocolHandler: (prefix: string, protocolHandler: ProtocolHandler) => void;
|
|
65
|
+
/** @param {Parameters<typeof protocol.bind>} args */
|
|
66
|
+
bind: (localAddr: string) => Promise<Port | import("@agoric/vow").Vow<Port>>;
|
|
67
|
+
}>;
|
|
2
68
|
//# sourceMappingURL=vat-network.d.ts.map
|
package/src/vat-network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat-network.d.ts","sourceRoot":"","sources":["vat-network.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vat-network.d.ts","sourceRoot":"","sources":["vat-network.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqBI,wEAAwE;;IAGxE,0EAA0E;;IAG1E,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IANrD,wEAAwE;;IAGxE,0EAA0E;;IAG1E,qDAAqD;;GAGxD"}
|
package/src/vat-network.js
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
3
|
+
import {
|
|
4
|
+
prepareEchoConnectionKit,
|
|
5
|
+
prepareLoopbackProtocolHandler,
|
|
6
|
+
prepareRouterProtocol,
|
|
7
|
+
} from '@agoric/network';
|
|
8
|
+
import { prepareVowTools } from '@agoric/vat-data/vow.js';
|
|
9
|
+
import { Far } from '@endo/far';
|
|
2
10
|
|
|
3
|
-
export function buildRootObject() {
|
|
4
|
-
|
|
11
|
+
export function buildRootObject(_vatPowers, _args, baggage) {
|
|
12
|
+
const zone = makeDurableZone(baggage);
|
|
13
|
+
const powers = prepareVowTools(zone.subZone('vow'));
|
|
14
|
+
|
|
15
|
+
const makeRouterProtocol = prepareRouterProtocol(
|
|
16
|
+
zone.subZone('network'),
|
|
17
|
+
powers,
|
|
18
|
+
);
|
|
19
|
+
const protocol = zone.makeOnce('RouterProtocol', _key =>
|
|
20
|
+
makeRouterProtocol(),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const makeLoopbackProtocolHandler = prepareLoopbackProtocolHandler(
|
|
24
|
+
zone,
|
|
25
|
+
powers,
|
|
26
|
+
);
|
|
27
|
+
const makeEchoConnectionKit = prepareEchoConnectionKit(zone);
|
|
28
|
+
|
|
29
|
+
return Far('RouterProtocol', {
|
|
30
|
+
makeLoopbackProtocolHandler,
|
|
31
|
+
makeEchoConnectionKit,
|
|
32
|
+
/** @param {Parameters<typeof protocol.registerProtocolHandler>} args */
|
|
33
|
+
registerProtocolHandler: (...args) =>
|
|
34
|
+
protocol.registerProtocolHandler(...args),
|
|
35
|
+
/** @param {Parameters<typeof protocol.unregisterProtocolHandler>} args */
|
|
36
|
+
unregisterProtocolHandler: (...args) =>
|
|
37
|
+
protocol.unregisterProtocolHandler(...args),
|
|
38
|
+
/** @param {Parameters<typeof protocol.bind>} args */
|
|
39
|
+
bind: (...args) => protocol.bind(...args),
|
|
40
|
+
});
|
|
5
41
|
}
|
|
@@ -64,14 +64,20 @@ export function makeMock(log: any): {
|
|
|
64
64
|
};
|
|
65
65
|
network: {
|
|
66
66
|
registerProtocolHandler: () => void;
|
|
67
|
+
makeLoopbackProtocolHandler: () => void;
|
|
67
68
|
bind: () => {
|
|
68
69
|
addListener: () => void;
|
|
69
|
-
}
|
|
70
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
71
|
+
addListener: () => void;
|
|
72
|
+
}>;
|
|
70
73
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
71
74
|
registerProtocolHandler: () => void;
|
|
75
|
+
makeLoopbackProtocolHandler: () => void;
|
|
72
76
|
bind: () => {
|
|
73
77
|
addListener: () => void;
|
|
74
|
-
}
|
|
78
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
79
|
+
addListener: () => void;
|
|
80
|
+
}>;
|
|
75
81
|
}>;
|
|
76
82
|
};
|
|
77
83
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot-test-utils.d.ts","sourceRoot":"","sources":["boot-test-utils.js"],"names":[],"mappings":";;;;;;;;;;;AAiCO,6BAAqB;AAE5B,qBAAqB;AACrB,yBADW,MAAM,CACgB;AAE1B
|
|
1
|
+
{"version":3,"file":"boot-test-utils.d.ts","sourceRoot":"","sources":["boot-test-utils.js"],"names":[],"mappings":";;;;;;;;;;;AAiCO,6BAAqB;AAE5B,qBAAqB;AACrB,yBADW,MAAM,CACgB;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCH;AAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEN;AAEM,iDAON;mDAlJkD,2BAA2B;4CAClC,oBAAoB;6CACnB,qBAAqB;2CACvB,mBAAmB;6CACjB,qBAAqB;+CACnB,uBAAuB;sDAChB,8BAA8B;oDAChC,4BAA4B;2CACrC,mBAAmB"}
|
package/tools/boot-test-utils.js
CHANGED
|
@@ -73,7 +73,8 @@ export const makeMock = log =>
|
|
|
73
73
|
|
|
74
74
|
network: Far('network', {
|
|
75
75
|
registerProtocolHandler: noop,
|
|
76
|
-
|
|
76
|
+
makeLoopbackProtocolHandler: noop,
|
|
77
|
+
bind: () => Far('network - listener', { addListener: noop }),
|
|
77
78
|
}),
|
|
78
79
|
},
|
|
79
80
|
});
|