@agoric/network 0.1.1-upgrade-16-dev-8879538.0 → 0.1.1-upgrade-16-dev-24665a9.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 +12 -11
- package/src/bytes.d.ts +14 -1
- package/src/bytes.d.ts.map +1 -1
- package/src/bytes.js +30 -3
- package/src/network.d.ts +49 -21
- package/src/network.d.ts.map +1 -1
- package/src/network.js +11 -6
- package/src/router.d.ts +4 -4
- package/src/router.d.ts.map +1 -1
- package/src/types.d.ts +0 -1
- package/src/types.d.ts.map +1 -1
- package/src/types.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/network",
|
|
3
|
-
"version": "0.1.1-upgrade-16-dev-
|
|
3
|
+
"version": "0.1.1-upgrade-16-dev-24665a9.0+24665a9",
|
|
4
4
|
"description": "Agoric's network protocol API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -21,20 +21,21 @@
|
|
|
21
21
|
"author": "Agoric",
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@agoric/assert": "0.6.1-upgrade-16-dev-
|
|
25
|
-
"@agoric/internal": "0.3.3-upgrade-16-dev-
|
|
26
|
-
"@agoric/store": "0.9.3-upgrade-16-dev-
|
|
27
|
-
"@agoric/vat-data": "0.5.3-upgrade-16-dev-
|
|
24
|
+
"@agoric/assert": "0.6.1-upgrade-16-dev-24665a9.0+24665a9",
|
|
25
|
+
"@agoric/internal": "0.3.3-upgrade-16-dev-24665a9.0+24665a9",
|
|
26
|
+
"@agoric/store": "0.9.3-upgrade-16-dev-24665a9.0+24665a9",
|
|
27
|
+
"@agoric/vat-data": "0.5.3-upgrade-16-dev-24665a9.0+24665a9",
|
|
28
28
|
"@endo/base64": "^1.0.5",
|
|
29
29
|
"@endo/far": "^1.1.2",
|
|
30
|
+
"@endo/pass-style": "^1.4.0",
|
|
30
31
|
"@endo/patterns": "^1.4.0",
|
|
31
32
|
"@endo/promise-kit": "^1.1.2"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"@agoric/swingset-liveslots": "0.10.3-upgrade-16-dev-
|
|
35
|
-
"@agoric/swingset-vat": "0.32.3-upgrade-16-dev-
|
|
36
|
-
"@agoric/vow": "0.1.1-upgrade-16-dev-
|
|
37
|
-
"@agoric/zone": "0.2.3-upgrade-16-dev-
|
|
35
|
+
"@agoric/swingset-liveslots": "0.10.3-upgrade-16-dev-24665a9.0+24665a9",
|
|
36
|
+
"@agoric/swingset-vat": "0.32.3-upgrade-16-dev-24665a9.0+24665a9",
|
|
37
|
+
"@agoric/vow": "0.1.1-upgrade-16-dev-24665a9.0+24665a9",
|
|
38
|
+
"@agoric/zone": "0.2.3-upgrade-16-dev-24665a9.0+24665a9",
|
|
38
39
|
"@endo/bundle-source": "^3.2.3",
|
|
39
40
|
"ava": "^5.3.0",
|
|
40
41
|
"c8": "^9.1.0"
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"workerThreads": false
|
|
66
67
|
},
|
|
67
68
|
"typeCoverage": {
|
|
68
|
-
"atLeast": 89.
|
|
69
|
+
"atLeast": 89.7
|
|
69
70
|
},
|
|
70
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "24665a97248b854fcb01185d360429301470ed57"
|
|
71
72
|
}
|
package/src/bytes.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {Bytes} from './types.js';
|
|
3
|
+
*/
|
|
4
|
+
/** @typedef {Bytes | Buffer | Uint8Array | Iterable<number>} ByteSource */
|
|
5
|
+
/**
|
|
6
|
+
* This function is a coercer instead of an asserter because in a future where
|
|
7
|
+
* binary data has better support across vats and potentially its own type, we
|
|
8
|
+
* might allow more `specimen`s than just `ByteSource`.
|
|
9
|
+
*
|
|
10
|
+
* @param {unknown} specimen
|
|
11
|
+
* @returns {ByteSource}
|
|
12
|
+
*/
|
|
13
|
+
export function coerceToByteSource(specimen: unknown): ByteSource;
|
|
1
14
|
/**
|
|
2
15
|
* Convert a Uint8Array or other sequence of octets to a string representation
|
|
3
16
|
* that `@endo/marshal` accepts as Passable.
|
|
@@ -19,7 +32,7 @@ export function bytesToString(bytes: string): string;
|
|
|
19
32
|
* @param {ByteSource} byteSource
|
|
20
33
|
* @returns {string} base64 encoding
|
|
21
34
|
*/
|
|
22
|
-
export function
|
|
35
|
+
export function byteSourceToBase64(byteSource: ByteSource): string;
|
|
23
36
|
/**
|
|
24
37
|
* Decodes a base64 string into bytes.
|
|
25
38
|
*
|
package/src/bytes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["bytes.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["bytes.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH,2EAA2E;AAE3E;;;;;;;GAOG;AACH,6CAHW,OAAO,GACL,UAAU,CAmBtB;AAuBD;;;;;;GAMG;AACH,oCAHW,UAAU,UAQpB;AAED;;;;;GAKG;AACH,8CAFa,MAAM,CAIlB;AAED;;;;;GAKG;AACH,+CAHW,UAAU,GACR,MAAM,CAKlB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,UAKhB"}
|
package/src/bytes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
|
|
3
|
-
import { Fail } from '@agoric/assert';
|
|
2
|
+
import { details, Fail } from '@agoric/assert';
|
|
4
3
|
import { encodeBase64, decodeBase64 } from '@endo/base64';
|
|
4
|
+
import { isObject } from '@endo/pass-style';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @import {Bytes} from './types.js';
|
|
@@ -9,6 +9,33 @@ import { encodeBase64, decodeBase64 } from '@endo/base64';
|
|
|
9
9
|
|
|
10
10
|
/** @typedef {Bytes | Buffer | Uint8Array | Iterable<number>} ByteSource */
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* This function is a coercer instead of an asserter because in a future where
|
|
14
|
+
* binary data has better support across vats and potentially its own type, we
|
|
15
|
+
* might allow more `specimen`s than just `ByteSource`.
|
|
16
|
+
*
|
|
17
|
+
* @param {unknown} specimen
|
|
18
|
+
* @returns {ByteSource}
|
|
19
|
+
*/
|
|
20
|
+
export function coerceToByteSource(specimen) {
|
|
21
|
+
if (typeof specimen === 'string') {
|
|
22
|
+
return specimen;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
isObject(specimen) ||
|
|
26
|
+
assert.fail(details`non-object ${specimen} is not a ByteSource`, TypeError);
|
|
27
|
+
|
|
28
|
+
const obj = /** @type {{}} */ (specimen);
|
|
29
|
+
typeof obj[Symbol.iterator] === 'function' ||
|
|
30
|
+
assert.fail(
|
|
31
|
+
details`non-iterable ${specimen} is not a ByteSource`,
|
|
32
|
+
TypeError,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
// Good enough... it's iterable and can be converted later.
|
|
36
|
+
return /** @type {ByteSource} */ (specimen);
|
|
37
|
+
}
|
|
38
|
+
|
|
12
39
|
/**
|
|
13
40
|
* @param {ByteSource} contents
|
|
14
41
|
*/
|
|
@@ -60,7 +87,7 @@ export function bytesToString(bytes) {
|
|
|
60
87
|
* @param {ByteSource} byteSource
|
|
61
88
|
* @returns {string} base64 encoding
|
|
62
89
|
*/
|
|
63
|
-
export function
|
|
90
|
+
export function byteSourceToBase64(byteSource) {
|
|
64
91
|
const bytes = coerceToByteArray(byteSource);
|
|
65
92
|
return encodeBase64(bytes);
|
|
66
93
|
}
|
package/src/network.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @param {string} addr
|
|
5
5
|
*/
|
|
6
6
|
export function getPrefixes(addr: string): string[];
|
|
7
|
+
/** @typedef {ReturnType<typeof prepareEchoConnectionKit>} MakeEchoConnectionKit */
|
|
7
8
|
/**
|
|
8
9
|
* Create a protocol handler that just connects to itself.
|
|
9
10
|
*
|
|
@@ -11,12 +12,12 @@ export function getPrefixes(addr: string): string[];
|
|
|
11
12
|
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
|
|
12
13
|
*/
|
|
13
14
|
export function prepareLoopbackProtocolHandler(zone: import("@agoric/base-zone").Zone, { watch, allVows }: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
|
|
14
|
-
isRetryableReason?: (
|
|
15
|
+
isRetryableReason?: import("@agoric/vow").IsRetryableReason | undefined;
|
|
15
16
|
} | undefined) => {
|
|
16
|
-
when: <T, TResult1 = import("@agoric/vow").
|
|
17
|
-
watch: <T_1 =
|
|
17
|
+
when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
|
|
18
|
+
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = never, C = any>(specimenP: import("@agoric/vow").ERef<T_1 | import("@agoric/vow").Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => import("@agoric/vow").Vow<Exclude<TResult1_1, void> | Exclude<TResult2_1, void> extends never ? TResult1_1 : Exclude<TResult1_1, void> | Exclude<TResult2_1, void>>;
|
|
18
19
|
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
|
|
19
|
-
allVows: (vows:
|
|
20
|
+
allVows: (vows: unknown[]) => import("@agoric/vow").Vow<any[]>;
|
|
20
21
|
}>): (instancePrefix?: string | undefined) => import("@endo/exo").Guarded<{
|
|
21
22
|
onCreate(_impl: any, _protocolHandler: any): Promise<void>;
|
|
22
23
|
generatePortID(_localAddr: any, _protocolHandler: any): Promise<string>;
|
|
@@ -36,7 +37,25 @@ export function prepareLoopbackProtocolHandler(zone: import("@agoric/base-zone")
|
|
|
36
37
|
* @param {import('@agoric/vow').Remote<ListenHandler>} listenHandler
|
|
37
38
|
* @param {*} _protocolHandler
|
|
38
39
|
*/
|
|
39
|
-
onListenRemove(port: import("@agoric/vow").Remote<Port,
|
|
40
|
+
onListenRemove(port: import("@agoric/vow").Remote<Port, {}>, localAddr: string, listenHandler: import("@agoric/vow").Remote<ListenHandler, {
|
|
41
|
+
/**
|
|
42
|
+
* The listener has been registered
|
|
43
|
+
*/
|
|
44
|
+
onListen?: undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The connection was rejected
|
|
47
|
+
*/
|
|
48
|
+
onReject?: undefined;
|
|
49
|
+
/**
|
|
50
|
+
* There was an error while listening
|
|
51
|
+
*/
|
|
52
|
+
onError?: undefined;
|
|
53
|
+
/**
|
|
54
|
+
* The
|
|
55
|
+
* listener has been removed
|
|
56
|
+
*/
|
|
57
|
+
onRemove?: undefined;
|
|
58
|
+
}>, _protocolHandler: any): Promise<void>;
|
|
40
59
|
onRevoke(_port: any, _localAddr: any, _protocolHandler: any): Promise<void>;
|
|
41
60
|
}>;
|
|
42
61
|
/**
|
|
@@ -48,15 +67,20 @@ export function prepareLoopbackProtocolHandler(zone: import("@agoric/base-zone")
|
|
|
48
67
|
*/
|
|
49
68
|
export const ENDPOINT_SEPARATOR: "/";
|
|
50
69
|
export function rethrowUnlessMissing(err: unknown): undefined;
|
|
51
|
-
export function crossoverConnection(zone: import("@agoric/zone").Zone, handler0: import("@agoric/vow").Remote<Required<ConnectionHandler>,
|
|
70
|
+
export function crossoverConnection(zone: import("@agoric/zone").Zone, handler0: import("@agoric/vow").Remote<Required<ConnectionHandler>, {}>, addr0: string, handler1: import("@agoric/vow").Remote<Required<ConnectionHandler>, {}>, addr1: string, makeConnection: (opts: ConnectionOpts) => Connection, current?: globalThis.WeakSetStore<Closable> | undefined): Connection[];
|
|
52
71
|
export function prepareNetworkProtocol(zone: import("@agoric/base-zone").Zone, powers: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
|
|
53
|
-
isRetryableReason?: (
|
|
72
|
+
isRetryableReason?: import("@agoric/vow").IsRetryableReason | undefined;
|
|
54
73
|
} | undefined) => {
|
|
55
|
-
when: <T, TResult1 = import("@agoric/vow").
|
|
56
|
-
watch: <T_1 =
|
|
74
|
+
when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
|
|
75
|
+
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = never, C = any>(specimenP: import("@agoric/vow").ERef<T_1 | import("@agoric/vow").Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => import("@agoric/vow").Vow<Exclude<TResult1_1, void> | Exclude<TResult2_1, void> extends never ? TResult1_1 : Exclude<TResult1_1, void> | Exclude<TResult2_1, void>>;
|
|
57
76
|
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
|
|
58
|
-
allVows: (vows:
|
|
59
|
-
}>): (protocolHandler: import("@agoric/vow").Remote<ProtocolHandler,
|
|
77
|
+
allVows: (vows: unknown[]) => import("@agoric/vow").Vow<any[]>;
|
|
78
|
+
}>): (protocolHandler: import("@agoric/vow").Remote<ProtocolHandler, {
|
|
79
|
+
/**
|
|
80
|
+
* Return unique suffix for local address
|
|
81
|
+
*/
|
|
82
|
+
onInstantiate?: undefined;
|
|
83
|
+
}>) => Protocol;
|
|
60
84
|
export function prepareEchoConnectionKit(zone: import("@agoric/base-zone").Zone): () => import("@endo/exo").GuardedKit<{
|
|
61
85
|
handler: {
|
|
62
86
|
/**
|
|
@@ -91,26 +115,30 @@ export function prepareEchoConnectionKit(zone: import("@agoric/base-zone").Zone)
|
|
|
91
115
|
};
|
|
92
116
|
}>;
|
|
93
117
|
export function preparePortAllocator(zone: import("@agoric/base-zone").Zone, { watch }: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
|
|
94
|
-
isRetryableReason?: (
|
|
118
|
+
isRetryableReason?: import("@agoric/vow").IsRetryableReason | undefined;
|
|
95
119
|
} | undefined) => {
|
|
96
|
-
when: <T, TResult1 = import("@agoric/vow").
|
|
97
|
-
watch: <T_1 =
|
|
120
|
+
when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
|
|
121
|
+
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = never, C = any>(specimenP: import("@agoric/vow").ERef<T_1 | import("@agoric/vow").Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => import("@agoric/vow").Vow<Exclude<TResult1_1, void> | Exclude<TResult2_1, void> extends never ? TResult1_1 : Exclude<TResult1_1, void> | Exclude<TResult2_1, void>>;
|
|
98
122
|
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
|
|
99
|
-
allVows: (vows:
|
|
100
|
-
}>): (args_0
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
allVows: (vows: unknown[]) => import("@agoric/vow").Vow<any[]>;
|
|
124
|
+
}>): (args_0: {
|
|
125
|
+
protocol: Protocol;
|
|
126
|
+
}) => import("@endo/exo").Guarded<{
|
|
127
|
+
allocateCustomIBCPort(specifiedName?: string): Promise<import("@agoric/vow").Vow<Port>>;
|
|
128
|
+
allocateICAControllerPort(): Promise<import("@agoric/vow").Vow<Port>>;
|
|
129
|
+
allocateICQControllerPort(): Promise<import("@agoric/vow").Vow<Port>>;
|
|
130
|
+
allocateCustomLocalPort(specifiedName?: string): Promise<import("@agoric/vow").Vow<Port>>;
|
|
105
131
|
}>;
|
|
132
|
+
export type MakeEchoConnectionKit = ReturnType<typeof prepareEchoConnectionKit>;
|
|
106
133
|
export type ConnectionOpts = {
|
|
107
134
|
addrs: string[];
|
|
108
|
-
handlers: import("@agoric/vow").Remote<Required<ConnectionHandler>,
|
|
135
|
+
handlers: import("@agoric/vow").Remote<Required<ConnectionHandler>, {}>[];
|
|
109
136
|
conns: globalThis.MapStore<number, Connection>;
|
|
110
137
|
current: globalThis.WeakSetStore<Closable>;
|
|
111
138
|
l: 0 | 1;
|
|
112
139
|
r: 0 | 1;
|
|
113
140
|
};
|
|
141
|
+
export type PortAllocator = ReturnType<ReturnType<typeof preparePortAllocator>>;
|
|
114
142
|
import type { AttemptDescription } from './types.js';
|
|
115
143
|
import type { Port } from './types.js';
|
|
116
144
|
import type { ListenHandler } from './types.js';
|
package/src/network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["network.js"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,kCAFW,MAAM,YAahB;
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["network.js"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,kCAFW,MAAM,YAahB;AAutCD,mFAAmF;AAEnF;;;;;GAKG;AACH,qDAHW,OAAO,mBAAmB,EAAE,IAAI,sBAChC,UAAU;;;wFAnwC0J,CAAC;;;oBAiB5K,SAAI;EAkvCoD;;;;IAmCpD;;;;;OAKG;;;;IAgEH;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;GA8CV;AA/5CD;;GAEG;AAEH;;;GAGG;AACH,qCAAsC;AAG/B,0CADK,OAAO,aAWlB;AAyJM,0CARI,OAAO,cAAc,EAAE,IAAI,yMAKpB,cAAc,wFAgD/B;AA+6BM,6CAHI,OAAO,mBAAmB,EAAE,IAAI,UAChC,UAAU;;;;;;;EAAuC;;;;;gBAkC3D;AAOM,+CAFI,OAAO,mBAAmB,EAAE,IAAI;;QAsCnC;;;;WAIG;;QASH;;;;WAIG;;;;;YAjBH;;;;eAIG;;YASH;;;;eAIG;;;;;GAuBV;AAyKM,2CAHI,OAAO,mBAAmB,EAAE,IAAI,aAChC,UAAU;;;;;;;EAAuC;;;;;;;GAoEzD;oCA1OW,UAAU,CAAC,OAAO,wBAAwB,CAAC;;;;;;OAjsC3C,CAAC,GAAC,CAAC;OACH,CAAC,GAAC,CAAC;;4BA26CH,UAAU,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;wCAx+CyG,YAAY;0BAAZ,YAAY;mCAAZ,YAAY;uCAAZ,YAAY;gCAAZ,YAAY;8BAAZ,YAAY;qCAAZ,YAAY;8BAAZ,YAAY"}
|
package/src/network.js
CHANGED
|
@@ -584,9 +584,7 @@ const preparePort = (zone, powers) => {
|
|
|
584
584
|
// Clean up everything we did.
|
|
585
585
|
const values = [...currentConnections.get(port).values()];
|
|
586
586
|
|
|
587
|
-
/** @type {import('@agoric/vow').Specimen[]} */
|
|
588
587
|
const ps = [];
|
|
589
|
-
|
|
590
588
|
ps.push(
|
|
591
589
|
...values.map(conn =>
|
|
592
590
|
watch(E(conn).close(), this.facets.sinkWatcher),
|
|
@@ -1289,6 +1287,7 @@ export const prepareEchoConnectionKit = zone => {
|
|
|
1289
1287
|
|
|
1290
1288
|
return makeEchoConnectionKit;
|
|
1291
1289
|
};
|
|
1290
|
+
/** @typedef {ReturnType<typeof prepareEchoConnectionKit>} MakeEchoConnectionKit */
|
|
1292
1291
|
|
|
1293
1292
|
/**
|
|
1294
1293
|
* Create a protocol handler that just connects to itself.
|
|
@@ -1469,9 +1468,14 @@ export const preparePortAllocator = (zone, { watch }) =>
|
|
|
1469
1468
|
.optional(M.string())
|
|
1470
1469
|
.returns(Shape.Vow$(Shape.Port)),
|
|
1471
1470
|
}),
|
|
1471
|
+
/**
|
|
1472
|
+
*
|
|
1473
|
+
* @param {object} opts
|
|
1474
|
+
* @param {Protocol} opts.protocol
|
|
1475
|
+
*/
|
|
1472
1476
|
({ protocol }) => ({ protocol, lastICAPortNum: 0n, lastICQPortNum: 0n }),
|
|
1473
1477
|
{
|
|
1474
|
-
allocateCustomIBCPort(specifiedName = '') {
|
|
1478
|
+
async allocateCustomIBCPort(specifiedName = '') {
|
|
1475
1479
|
const { state } = this;
|
|
1476
1480
|
let localAddr = `/ibc-port/`;
|
|
1477
1481
|
|
|
@@ -1484,7 +1488,7 @@ export const preparePortAllocator = (zone, { watch }) =>
|
|
|
1484
1488
|
// Allocate an IBC port with a unique generated name.
|
|
1485
1489
|
return watch(E(state.protocol).bindPort(localAddr));
|
|
1486
1490
|
},
|
|
1487
|
-
allocateICAControllerPort() {
|
|
1491
|
+
async allocateICAControllerPort() {
|
|
1488
1492
|
const { state } = this;
|
|
1489
1493
|
state.lastICAPortNum += 1n;
|
|
1490
1494
|
return watch(
|
|
@@ -1493,7 +1497,7 @@ export const preparePortAllocator = (zone, { watch }) =>
|
|
|
1493
1497
|
),
|
|
1494
1498
|
);
|
|
1495
1499
|
},
|
|
1496
|
-
allocateICQControllerPort() {
|
|
1500
|
+
async allocateICQControllerPort() {
|
|
1497
1501
|
const { state } = this;
|
|
1498
1502
|
state.lastICQPortNum += 1n;
|
|
1499
1503
|
return watch(
|
|
@@ -1502,7 +1506,7 @@ export const preparePortAllocator = (zone, { watch }) =>
|
|
|
1502
1506
|
),
|
|
1503
1507
|
);
|
|
1504
1508
|
},
|
|
1505
|
-
allocateCustomLocalPort(specifiedName = '') {
|
|
1509
|
+
async allocateCustomLocalPort(specifiedName = '') {
|
|
1506
1510
|
const { state } = this;
|
|
1507
1511
|
|
|
1508
1512
|
let localAddr = `/local/`;
|
|
@@ -1518,3 +1522,4 @@ export const preparePortAllocator = (zone, { watch }) =>
|
|
|
1518
1522
|
},
|
|
1519
1523
|
},
|
|
1520
1524
|
);
|
|
1525
|
+
/** @typedef {ReturnType<ReturnType<typeof preparePortAllocator>>} PortAllocator */
|
package/src/router.d.ts
CHANGED
|
@@ -32,12 +32,12 @@ export function prepareRouter<T>(zone: import("@agoric/base-zone").Zone): () =>
|
|
|
32
32
|
unregister(prefix: string, route: T): void;
|
|
33
33
|
}>;
|
|
34
34
|
export function prepareRouterProtocol(zone: import("@agoric/base-zone").Zone, powers: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
|
|
35
|
-
isRetryableReason?: (
|
|
35
|
+
isRetryableReason?: import("@agoric/vow").IsRetryableReason | undefined;
|
|
36
36
|
} | undefined) => {
|
|
37
|
-
when: <T, TResult1 = import("@agoric/vow").
|
|
38
|
-
watch: <T_1 =
|
|
37
|
+
when: <T, TResult1 = import("@agoric/vow").EUnwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").EUnwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
|
|
38
|
+
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = never, C = any>(specimenP: import("@agoric/vow").ERef<T_1 | import("@agoric/vow").Vow<T_1>>, watcher?: import("@agoric/vow").Watcher<T_1, TResult1_1, TResult2_1> | undefined, watcherContext?: C | undefined) => import("@agoric/vow").Vow<Exclude<TResult1_1, void> | Exclude<TResult2_1, void> extends never ? TResult1_1 : Exclude<TResult1_1, void> | Exclude<TResult2_1, void>>;
|
|
39
39
|
makeVowKit: <T_2>() => VowKit<T_2>;
|
|
40
|
-
allVows: (vows:
|
|
40
|
+
allVows: (vows: unknown[]) => import("@agoric/vow").Vow<any[]>;
|
|
41
41
|
}>, E?: ((<T_3>(x: T_3) => import("../../../node_modules/@endo/eventual-send/src/E.js").ECallableOrMethods<import("@endo/eventual-send").RemoteFunctions<T_3>>) & {
|
|
42
42
|
readonly get: <T_1_1>(x: T_1_1) => import("../../../node_modules/@endo/eventual-send/src/E.js").EGetters<import("@endo/eventual-send").LocalRecord<T_1_1>>;
|
|
43
43
|
readonly resolve: {
|
package/src/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["router.js"],"names":[],"mappings":"AAWA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH;;;;GAIG;AAMI,8BAiDU,CAAC,QAnDP,OAAO,mBAAmB,EAAE,IAAI;IAiBrC,6BAA6B;;IAyB7B;;;OAGG;qBAFQ,MAAM,SAQN,CAAC,AAPA;IAKZ;;;OAGG;uBAFQ,MAAM,SACN,CAAC;GAWjB;AAgBM,4CAJI,OAAO,mBAAmB,EAAE,IAAI,UAChC,UAAU;;;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["router.js"],"names":[],"mappings":"AAWA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH;;;;GAIG;AAMI,8BAiDU,CAAC,QAnDP,OAAO,mBAAmB,EAAE,IAAI;IAiBrC,6BAA6B;;IAyB7B;;;OAGG;qBAFQ,MAAM,SAQN,CAAC,AAPA;IAKZ;;;OAGG;uBAFQ,MAAM,SACN,CAAC;GAWjB;AAgBM,4CAJI,OAAO,mBAAmB,EAAE,IAAI,UAChC,UAAU;;;wFAlGyG,CAAC;;;oBAU1H,SAAM;EAwFiD,iBA5GnD,GAAE;6BAGoB,KAAI;;;uBAGoB,KAAI;uBAC7B,KAAI;QAElC;;;WAGG;QAEH;;;;;;;;;WASG;QAEH,YAfO,KAAG,CAAC;;gCAAgE,GAAI;qCAC3D,GAAI,GAAE,YAAc,GAAE,CAAC,gBAAe,CAAE,CAAC,OAAO,GAAG,KAAI,OAC1E,oDAEE,EACF,IAAI,CAAC,CAAC,CAAC,CAAC,YACH,eAAe,CAAC,CAAC,WAAW,KAAI,OAAS,oDAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,YACzD;;IA+HD;;;OAGG;mCAFQ,MAAM,EAAE;IAanB;;;OAGG;sCAFQ,MAAM;IAejB,kCAAkC;;GAUvC;;;;mBAnKqC,CAAC;;;;;eAJzB,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,MAAM,EAID,CAAC,AAJG,CAAC,EAAE;;;;;cAE/B,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAEE,CAAC,AAFA,KAAK,IAAI;;;;;gBAElC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI;;;uBA8EzB,MAAM;qCACP,MAAM,EAAE,uCAAuC,IAAI;wCAClD,MAAM,uCAAuC,IAAI;;4BA1FJ,aAAa;qCADyF,YAAY;4BAClH,aAAa;0BADyF,YAAY;gCAClH,aAAa"}
|
package/src/types.d.ts
CHANGED
|
@@ -212,7 +212,6 @@ export type ProtocolImpl = {
|
|
|
212
212
|
*/
|
|
213
213
|
outbound: (port: Remote<Port>, remoteAddr: Endpoint, connectionHandler: Remote<ConnectionHandler>) => PromiseVow<Connection>;
|
|
214
214
|
};
|
|
215
|
-
export type PortAllocator = ReturnType<ReturnType<typeof import("@agoric/network").preparePortAllocator>>;
|
|
216
215
|
import type { PromiseVow } from '@agoric/vow';
|
|
217
216
|
import type { RemotableObject } from '@endo/pass-style';
|
|
218
217
|
import type { Remote } from '@agoric/vow';
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;4BAa8D,CAAC,sCAAqB,CAAC,mBAD7D,GAAG,EAAE,KAAK,GAAG,IACyB,CAAC,AAAjD,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;;;;oBAK5E,MAAM;;;;;uBAIN,MAAM;;;;;;;;;;;;;;;;;;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