@agoric/vats 0.15.2-dev-b5a2ed1.0 → 0.15.2-dev-3da32ff.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/exported.js +1 -1
- package/index.js +1 -1
- package/package.json +15 -15
- package/src/bridge.js +1 -1
- package/src/core/chain-behaviors.d.ts.map +1 -1
- package/src/core/chain-behaviors.js +1 -0
- package/src/core/startWalletFactory.d.ts +1 -1
- package/src/core/types-ambient.d.ts +475 -0
- package/src/core/types-ambient.js +1 -0
- package/src/nameHub.js +2 -2
- package/src/types.d.ts +87 -107
- package/src/types.js +1 -100
- package/src/vat-provisioning.js +1 -1
- package/tools/boot-test-utils.d.ts.map +1 -1
- package/tools/boot-test-utils.js +0 -1
- package/tsconfig.json +1 -0
- package/src/core/types.d.ts +0 -505
- package/src/core/types.d.ts.map +0 -1
- package/src/core/types.js +0 -522
- package/src/types.d.ts.map +0 -1
package/src/types.d.ts
CHANGED
|
@@ -1,129 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint-disable no-use-before-define */
|
|
2
|
+
|
|
3
|
+
export type Board = ReturnType<
|
|
4
|
+
ReturnType<typeof import('./lib-board.js').prepareBoardKit>
|
|
5
|
+
>['board'];
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
* read-only access to a node in a name hierarchy
|
|
5
9
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
10
|
+
* NOTE: We need to return arrays, not iterables, because even if marshal could
|
|
11
|
+
* allow passing a remote iterable, there would be an inordinate number of round
|
|
12
|
+
* trips for the contents of even the simplest nameHub.
|
|
9
13
|
*/
|
|
10
14
|
export type NameHub = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* get all names available in the current
|
|
24
|
-
* NameHub
|
|
25
|
-
*/
|
|
26
|
-
keys: () => string[];
|
|
27
|
-
/**
|
|
28
|
-
* get all values available in the current
|
|
29
|
-
* NameHub
|
|
30
|
-
*/
|
|
31
|
-
values: () => unknown[];
|
|
15
|
+
has: (key: string) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Look up a path of keys starting from the current NameHub. Wait on any
|
|
18
|
+
* reserved promises.
|
|
19
|
+
*/
|
|
20
|
+
lookup: (...path: string[]) => Promise<any>;
|
|
21
|
+
/** get all the entries available in the current NameHub */
|
|
22
|
+
entries: (includeReserved?: boolean) => [string, unknown][];
|
|
23
|
+
/** get all names available in the current NameHub */
|
|
24
|
+
keys: () => string[];
|
|
25
|
+
/** get all values available in the current NameHub */
|
|
26
|
+
values: () => unknown[];
|
|
32
27
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*/
|
|
28
|
+
|
|
29
|
+
/** write access to a node in a name hierarchy */
|
|
36
30
|
export type NameAdmin = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* outstanding reserved promise (if any).
|
|
68
|
-
*/
|
|
69
|
-
delete: (key: string) => void;
|
|
70
|
-
/**
|
|
71
|
-
* get the NameHub corresponding to the
|
|
72
|
-
* current NameAdmin
|
|
73
|
-
*/
|
|
74
|
-
readonly: () => NameHub;
|
|
75
|
-
onUpdate: (fn: undefined | NameHubUpdateHandler) => void;
|
|
31
|
+
provideChild: (key: string, reserved?: string[]) => Promise<NameHubKit>;
|
|
32
|
+
/**
|
|
33
|
+
* Mark a key as reserved; will return a promise that is fulfilled when the
|
|
34
|
+
* key is updated (or rejected when deleted). If the key was already set it
|
|
35
|
+
* does nothing.
|
|
36
|
+
*/
|
|
37
|
+
reserve: (key: string) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Update if not already updated. Return existing value, or newValue if not
|
|
40
|
+
* existing.
|
|
41
|
+
*/
|
|
42
|
+
default: <T>(key: string, newValue: T, newAdmin?: NameAdmin) => T;
|
|
43
|
+
/** Update only if already initialized. Reject if not. */
|
|
44
|
+
set: (key: string, newValue: unknown, newAdmin?: NameAdmin) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Fulfill an outstanding reserved promise (if any) to the newValue and set
|
|
47
|
+
* the key to the newValue. If newAdmin is provided, set that to return via
|
|
48
|
+
* lookupAdmin.
|
|
49
|
+
*/
|
|
50
|
+
update: (key: string, newValue: unknown, newAdmin?: NameAdmin) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Look up the `newAdmin` from the path of keys starting from the current
|
|
53
|
+
* NameAdmin. Wait on any reserved promises.
|
|
54
|
+
*/
|
|
55
|
+
lookupAdmin: (...path: string[]) => Promise<NameAdmin>;
|
|
56
|
+
/** Delete a value and reject an outstanding reserved promise (if any). */
|
|
57
|
+
delete: (key: string) => void;
|
|
58
|
+
/** get the NameHub corresponding to the current NameAdmin */
|
|
59
|
+
readonly: () => NameHub;
|
|
60
|
+
onUpdate: (fn: undefined | NameHubUpdateHandler) => void;
|
|
76
61
|
};
|
|
62
|
+
|
|
77
63
|
export type NameHubUpdateHandler = {
|
|
78
|
-
|
|
64
|
+
write: (entries: [string, unknown][]) => void;
|
|
79
65
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
*/
|
|
66
|
+
|
|
67
|
+
/** a node in a name hierarchy */
|
|
83
68
|
export type NameHubKit = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* write access
|
|
90
|
-
*/
|
|
91
|
-
nameAdmin: NameAdmin;
|
|
69
|
+
/** read access */
|
|
70
|
+
nameHub: NameHub;
|
|
71
|
+
/** write access */
|
|
72
|
+
nameAdmin: NameAdmin;
|
|
92
73
|
};
|
|
74
|
+
|
|
93
75
|
export type MyAddressNameAdmin = NameAdmin & {
|
|
94
|
-
|
|
76
|
+
getMyAddress(): string;
|
|
95
77
|
};
|
|
96
78
|
export type NamesByAddressAdmin = NameAdmin & {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
provideChild(
|
|
80
|
+
addr: string,
|
|
81
|
+
reserved?: string[],
|
|
82
|
+
): Promise<{
|
|
83
|
+
nameHub: NameHub;
|
|
84
|
+
nameAdmin: MyAddressNameAdmin;
|
|
85
|
+
}>;
|
|
86
|
+
lookupAdmin(addr: string): Promise<MyAddressNameAdmin>;
|
|
102
87
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* bridge device
|
|
106
|
-
*/
|
|
88
|
+
|
|
89
|
+
/** An object that can receive messages from the bridge device */
|
|
107
90
|
export type BridgeHandler = {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
*/
|
|
111
|
-
fromBridge: (obj: any) => Promise<void>;
|
|
91
|
+
/** Handle an inbound message */
|
|
92
|
+
fromBridge: (obj: any) => Promise<void>;
|
|
112
93
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
* specific bridge
|
|
116
|
-
*/
|
|
94
|
+
|
|
95
|
+
/** An object which handles messages for a specific bridge */
|
|
117
96
|
export type ScopedBridgeManager = {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
97
|
+
toBridge: (obj: any) => Promise<any>;
|
|
98
|
+
fromBridge: (obj: any) => Promise<void>;
|
|
99
|
+
initHandler: (handler: ERef<BridgeHandler>) => void;
|
|
100
|
+
setHandler: (handler: ERef<BridgeHandler>) => void;
|
|
122
101
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*/
|
|
102
|
+
|
|
103
|
+
/** The object to manage this bridge */
|
|
126
104
|
export type BridgeManager = {
|
|
127
|
-
|
|
105
|
+
register: (
|
|
106
|
+
bridgeId: string,
|
|
107
|
+
handler?: ERef<BridgeHandler | undefined>,
|
|
108
|
+
) => ScopedBridgeManager;
|
|
128
109
|
};
|
|
129
|
-
//# sourceMappingURL=types.d.ts.map
|
package/src/types.js
CHANGED
|
@@ -1,101 +1,2 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
// Empty JS file to correspond with types.d.ts
|
|
3
2
|
export {};
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @template T
|
|
7
|
-
* @typedef {import('@endo/far').EOnly<T>} EOnly
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {ReturnType<
|
|
12
|
-
* ReturnType<typeof import('./lib-board.js').prepareBoardKit>
|
|
13
|
-
* >['board']} Board
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @typedef {object} NameHub read-only access to a node in a name hierarchy
|
|
18
|
-
*
|
|
19
|
-
* NOTE: We need to return arrays, not iterables, because even if marshal could
|
|
20
|
-
* allow passing a remote iterable, there would be an inordinate number of
|
|
21
|
-
* round trips for the contents of even the simplest nameHub.
|
|
22
|
-
* @property {(key: string) => boolean} has
|
|
23
|
-
* @property {(...path: string[]) => Promise<any>} lookup Look up a path of keys
|
|
24
|
-
* starting from the current NameHub. Wait on any reserved promises.
|
|
25
|
-
* @property {(includeReserved?: boolean) => [string, unknown][]} entries get
|
|
26
|
-
* all the entries available in the current NameHub
|
|
27
|
-
* @property {() => string[]} keys get all names available in the current
|
|
28
|
-
* NameHub
|
|
29
|
-
* @property {() => unknown[]} values get all values available in the current
|
|
30
|
-
* NameHub
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @typedef {object} NameAdmin write access to a node in a name hierarchy
|
|
35
|
-
* @property {(key: string, reserved?: string[]) => Promise<NameHubKit>} provideChild
|
|
36
|
-
* @property {(key: string) => Promise<void>} reserve Mark a key as reserved;
|
|
37
|
-
* will return a promise that is fulfilled when the key is updated (or
|
|
38
|
-
* rejected when deleted). If the key was already set it does nothing.
|
|
39
|
-
* @property {<T>(key: string, newValue: T, newAdmin?: NameAdmin) => T} default
|
|
40
|
-
* Update if not already updated. Return existing value, or newValue if not
|
|
41
|
-
* existing.
|
|
42
|
-
* @property {(key: string, newValue: unknown, newAdmin?: NameAdmin) => void} set
|
|
43
|
-
* Update only if already initialized. Reject if not.
|
|
44
|
-
* @property {(key: string, newValue: unknown, newAdmin?: NameAdmin) => void} update
|
|
45
|
-
* Fulfill an outstanding reserved promise (if any) to the newValue and set the
|
|
46
|
-
* key to the newValue. If newAdmin is provided, set that to return via
|
|
47
|
-
* lookupAdmin.
|
|
48
|
-
* @property {(...path: string[]) => Promise<NameAdmin>} lookupAdmin Look up the
|
|
49
|
-
* `newAdmin` from the path of keys starting from the current NameAdmin. Wait
|
|
50
|
-
* on any reserved promises.
|
|
51
|
-
* @property {(key: string) => void} delete Delete a value and reject an
|
|
52
|
-
* outstanding reserved promise (if any).
|
|
53
|
-
* @property {() => NameHub} readonly get the NameHub corresponding to the
|
|
54
|
-
* current NameAdmin
|
|
55
|
-
* @property {(fn: undefined | NameHubUpdateHandler) => void} onUpdate
|
|
56
|
-
*
|
|
57
|
-
* @typedef {{ write: (entries: [string, unknown][]) => void }} NameHubUpdateHandler
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @typedef {object} NameHubKit a node in a name hierarchy
|
|
62
|
-
* @property {NameHub} nameHub read access
|
|
63
|
-
* @property {NameAdmin} nameAdmin write access
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
/** @typedef {NameAdmin & { getMyAddress(): string }} MyAddressNameAdmin */
|
|
67
|
-
/**
|
|
68
|
-
* @typedef {NameAdmin & {
|
|
69
|
-
* provideChild(
|
|
70
|
-
* addr: string,
|
|
71
|
-
* reserved?: string[],
|
|
72
|
-
* ): Promise<{
|
|
73
|
-
* nameHub: NameHub;
|
|
74
|
-
* nameAdmin: MyAddressNameAdmin;
|
|
75
|
-
* }>;
|
|
76
|
-
* lookupAdmin(addr: string): Promise<MyAddressNameAdmin>;
|
|
77
|
-
* }} NamesByAddressAdmin
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @typedef {object} BridgeHandler An object that can receive messages from the
|
|
82
|
-
* bridge device
|
|
83
|
-
* @property {(obj: any) => Promise<void>} fromBridge Handle an inbound message
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @typedef {object} ScopedBridgeManager An object which handles messages for a
|
|
88
|
-
* specific bridge
|
|
89
|
-
* @property {(obj: any) => Promise<any>} toBridge
|
|
90
|
-
* @property {(obj: any) => Promise<void>} fromBridge
|
|
91
|
-
* @property {(handler: ERef<BridgeHandler>) => void} initHandler
|
|
92
|
-
* @property {(handler: ERef<BridgeHandler>) => void} setHandler
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @typedef {object} BridgeManager The object to manage this bridge
|
|
97
|
-
* @property {(
|
|
98
|
-
* bridgeId: string,
|
|
99
|
-
* handler?: ERef<BridgeHandler | undefined>,
|
|
100
|
-
* ) => ScopedBridgeManager} register
|
|
101
|
-
*/
|
package/src/vat-provisioning.js
CHANGED
|
@@ -39,7 +39,7 @@ const prepareSpecializedNameAdmin = zone => {
|
|
|
39
39
|
* @param {string} address
|
|
40
40
|
* @param {string[]} [reserved]
|
|
41
41
|
* @returns {Promise<{
|
|
42
|
-
* nameHub: NameHub;
|
|
42
|
+
* nameHub: import('./types.js').NameHub;
|
|
43
43
|
* nameAdmin: import('./types.js').MyAddressNameAdmin;
|
|
44
44
|
* }>}
|
|
45
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot-test-utils.d.ts","sourceRoot":"","sources":["boot-test-utils.js"],"names":[],"mappings":";;;;;;;;;;;AAkCO,6BAAqB;AAE5B,qBAAqB;
|
|
1
|
+
{"version":3,"file":"boot-test-utils.d.ts","sourceRoot":"","sources":["boot-test-utils.js"],"names":[],"mappings":";;;;;;;;;;;AAkCO,6BAAqB;AAE5B,qBAAqB;AACrB,yBADW,MAAM,CACgB;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCH;AAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEN;AAEM,iDAON;mDAjJkD,2BAA2B;4CAClC,oBAAoB;6CACnB,qBAAqB;2CACvB,mBAAmB;6CACjB,qBAAqB;+CACnB,uBAAuB;sDAChB,8BAA8B;oDAChC,4BAA4B;2CACrC,mBAAmB"}
|
package/tools/boot-test-utils.js
CHANGED