New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@agoric/network

Package Overview
Dependencies
Maintainers
0
Versions
1030
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/network - npm Package Compare versions

Comparing version 0.1.1-dev-2a16ddd.0 to 0.1.1-dev-2a71f04.0

2

./src/index.js

@@ -6,1 +6,3 @@ export * from './network.js';

export * from './bytes.js';
// eslint-disable-next-line import/export -- doesn't know types
export * from './types.js';

48

package.json
{
"name": "@agoric/network",
"version": "0.1.1-dev-2a16ddd.0+2a16ddd",
"version": "0.1.1-dev-2a71f04.0+2a71f04",
"description": "Agoric's network protocol API",

@@ -11,5 +11,5 @@ "type": "module",

"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
"test": "ava",
"test:c8": "c8 $C8_OPTIONS ava",
"test:c8": "c8 --all $C8_OPTIONS ava",
"test:xs": "exit 0",

@@ -25,22 +25,23 @@ "lint-fix": "yarn lint:eslint --fix",

"dependencies": {
"@agoric/assert": "0.6.1-dev-2a16ddd.0+2a16ddd",
"@agoric/internal": "0.3.3-dev-2a16ddd.0+2a16ddd",
"@agoric/store": "0.9.3-dev-2a16ddd.0+2a16ddd",
"@agoric/vat-data": "0.5.3-dev-2a16ddd.0+2a16ddd",
"@endo/base64": "^1.0.2",
"@endo/far": "^1.0.4",
"@endo/patterns": "^1.1.0",
"@endo/promise-kit": "^1.0.4"
"@agoric/internal": "0.3.3-dev-2a71f04.0+2a71f04",
"@agoric/store": "0.9.3-dev-2a71f04.0+2a71f04",
"@agoric/vat-data": "0.5.3-dev-2a71f04.0+2a71f04",
"@endo/base64": "^1.0.9",
"@endo/errors": "^1.2.9",
"@endo/far": "^1.1.10",
"@endo/pass-style": "^1.4.8",
"@endo/patterns": "^1.4.8",
"@endo/promise-kit": "^1.1.9"
},
"devDependencies": {
"@agoric/swingset-liveslots": "0.10.3-dev-2a16ddd.0+2a16ddd",
"@agoric/swingset-vat": "0.32.3-dev-2a16ddd.0+2a16ddd",
"@agoric/zone": "0.2.3-dev-2a16ddd.0+2a16ddd",
"@endo/bundle-source": "^3.1.0",
"@agoric/swingset-liveslots": "0.10.3-dev-2a71f04.0+2a71f04",
"@agoric/swingset-vat": "0.32.3-dev-2a71f04.0+2a71f04",
"@agoric/vow": "0.1.1-dev-2a71f04.0+2a71f04",
"@agoric/zone": "0.2.3-dev-2a71f04.0+2a71f04",
"@endo/bundle-source": "^3.5.1",
"ava": "^5.3.0",
"c8": "^9.1.0"
"c8": "^10.1.2"
},
"exports": {
".": "./src/index.js",
"./exported.js": "./exported.js"
".": "./src/index.js"
},

@@ -51,6 +52,3 @@ "files": [

"scripts/",
"tools/",
"*.json",
"globals.d.ts",
"exported.js"
"tools/"
],

@@ -65,3 +63,3 @@ "publishConfig": {

"files": [
"test/**/test-*.js"
"test/**/*.test.*"
],

@@ -75,5 +73,5 @@ "require": [

"typeCoverage": {
"atLeast": 91.68
"atLeast": 91.16
},
"gitHead": "2a16ddd09a7e81241548e7a29e13c41cae065709"
"gitHead": "2a71f04176f1a27be8e0356595d3dcd62f6d9186"
}

@@ -60,12 +60,9 @@ # Network API

To get a listening port, you need a `NetworkInterface` object (such as the one on your `ag-solo` under `home.network`) and ask it to `bind()` to an endpoint. You can either provide a specific port name, or allow the API to allocate a random one for you. The endpoint specifies the type of connection that this port will be able to accept (IBC, TCP, etc), and some properties of that connection. `bind()` uses a "multiaddress" to encode this information.
To get a listening port, you need a `NetworkInterface` object (such as the one on your `ag-solo` under `home.network`) and ask it for a port, via the `PortAllocator`.
```js
// ask for a random allocation - ends with a slash
E(home.network).bind('/ibc-port/')
E(home.network).getPortAllocator()
.then(portAllocator => E(portAllocator).allocateCustomIBCPort())
.then(port => usePort(port));
// or ask for a specific port name
E(home.network).bind('/ibc-port/my-cool-port-name')
.then(port => usePort(port));
```

@@ -151,3 +148,3 @@

Removing a listener doesn't release the port address to make it available for other `bind()` requests. You can call:
Removing a listener doesn't release the port address to make it available for other `PortAllocator` requests. You can call:

@@ -154,0 +151,0 @@ ```js

/**
* @import {Bytes} from './types.js';
*/
/** @typedef {Bytes | Buffer | Uint8Array | Iterable<number>} ByteSource */
/**
* This function is a coercer instead of an asserter because in a future where
* binary data has better support across vats and potentially its own type, we
* might allow more `specimen`s than just `ByteSource`.
*
* @param {unknown} specimen
* @returns {ByteSource}
*/
export function coerceToByteSource(specimen: unknown): ByteSource;
/**
* Convert a Uint8Array or other sequence of octets to a string representation

@@ -22,3 +35,3 @@ * that `@endo/marshal` accepts as Passable.

*/
export function dataToBase64(byteSource: ByteSource): string;
export function byteSourceToBase64(byteSource: ByteSource): string;
/**

@@ -32,2 +45,4 @@ * Decodes a base64 string into bytes.

export type ByteSource = Bytes | Buffer | Uint8Array | Iterable<number>;
import type { Bytes } from './types.js';
import type { Bytes as Bytes_1 } from './types.js';
//# sourceMappingURL=bytes.d.ts.map
// @ts-check
/// <reference path="./types.js" />
import { Fail } from '@agoric/assert';
import { X, Fail } from '@endo/errors';
import { encodeBase64, decodeBase64 } from '@endo/base64';
import { isObject } from '@endo/pass-style';
/**
* @import {Bytes} from './types.js';
*/
/** @typedef {Bytes | Buffer | Uint8Array | Iterable<number>} ByteSource */
/**
* This function is a coercer instead of an asserter because in a future where
* binary data has better support across vats and potentially its own type, we
* might allow more `specimen`s than just `ByteSource`.
*
* @param {unknown} specimen
* @returns {ByteSource}
*/
export function coerceToByteSource(specimen) {
if (typeof specimen === 'string') {
return specimen;
}
isObject(specimen) ||
assert.fail(X`non-object ${specimen} is not a ByteSource`, TypeError);
const obj = /** @type {{}} */ (specimen);
typeof obj[Symbol.iterator] === 'function' ||
assert.fail(X`non-iterable ${specimen} is not a ByteSource`, TypeError);
// Good enough... it's iterable and can be converted later.
return /** @type {ByteSource} */ (specimen);
}
/**
* @param {ByteSource} contents

@@ -59,3 +87,3 @@ */

*/
export function dataToBase64(byteSource) {
export function byteSourceToBase64(byteSource) {
const bytes = coerceToByteArray(byteSource);

@@ -62,0 +90,0 @@ return encodeBase64(bytes);

@@ -5,3 +5,4 @@ export * from "./network.js";

export * from "./bytes.js";
export * from "./types.js";
export { prepareRouter, prepareRouterProtocol } from "./router.js";
//# sourceMappingURL=index.d.ts.map

@@ -6,1 +6,3 @@ export * from './network.js';

export * from './bytes.js';
// eslint-disable-next-line import/export -- doesn't know types
export * from './types.js';

@@ -7,2 +7,3 @@ /**

export function getPrefixes(addr: string): string[];
/** @typedef {ReturnType<typeof prepareEchoConnectionKit>} MakeEchoConnectionKit */
/**

@@ -12,13 +13,5 @@ * Create a protocol handler that just connects to itself.

* @param {import('@agoric/base-zone').Zone} zone
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {VowTools} powers
*/
export function prepareLoopbackProtocolHandler(zone: import('@agoric/base-zone').Zone, { watch, allVows }: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
isRetryableReason?: ((reason: any) => boolean) | undefined;
watchPromise?: ((p: PromiseLike<any>, watcher: import("@agoric/vow/src/watch-promise.js").PromiseWatcher, ...args: unknown[]) => void) | undefined;
} | undefined) => {
when: <T, TResult1 = import("@agoric/vow").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = T_1>(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?: unknown) => import("@agoric/vow").Vow<TResult1_1 | TResult2_1>;
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
allVows: (vows: any) => import("@agoric/vow").Vow<any>;
}>): (instancePrefix: any) => import("@endo/exo/src/exo-makers.js").Guarded<{
export function prepareLoopbackProtocolHandler(zone: import("@agoric/base-zone").Zone, { watch, allVows }: VowTools): (instancePrefix?: string) => import("@endo/exo").Guarded<{
onCreate(_impl: any, _protocolHandler: any): Promise<void>;

@@ -31,5 +24,5 @@ generatePortID(_localAddr: any, _protocolHandler: any): Promise<string>;

* @param {Endpoint} remoteAddr
* @returns {PromiseVow<AttemptDescription>}}
* @returns {import('@agoric/vow').PromiseVow<AttemptDescription>}}
*/
onConnect(_port: any, localAddr: Endpoint, remoteAddr: Endpoint): PromiseVow<AttemptDescription>;
onConnect(_port: any, localAddr: Endpoint, remoteAddr: Endpoint): import("@agoric/vow").PromiseVow<AttemptDescription>;
onInstantiate(_port: any, _localAddr: any, _remote: any, _protocol: any): Promise<string>;

@@ -51,14 +44,7 @@ onListen(port: any, localAddr: any, listenHandler: any, _protocolHandler: any): Promise<void>;

export const ENDPOINT_SEPARATOR: "/";
export const CLOSE_REASON_FINALIZER: "closed-by-finalizer";
export function rethrowUnlessMissing(err: unknown): undefined;
export function crossoverConnection(zone: import('@agoric/zone').Zone, handler0: import('@agoric/vow').Remote<Required<ConnectionHandler>>, addr0: Endpoint, handler1: import('@agoric/vow').Remote<Required<ConnectionHandler>>, addr1: Endpoint, makeConnection: (opts: ConnectionOpts) => Connection, current?: WeakSetStore<Closable> | undefined): Connection[];
export function prepareNetworkProtocol(zone: import('@agoric/base-zone').Zone, powers: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
isRetryableReason?: ((reason: any) => boolean) | undefined;
watchPromise?: ((p: PromiseLike<any>, watcher: import("@agoric/vow/src/watch-promise.js").PromiseWatcher, ...args: unknown[]) => void) | undefined;
} | undefined) => {
when: <T, TResult1 = import("@agoric/vow").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = T_1>(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?: unknown) => import("@agoric/vow").Vow<TResult1_1 | TResult2_1>;
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
allVows: (vows: any) => import("@agoric/vow").Vow<any>;
}>): (protocolHandler: Remote<ProtocolHandler>) => Protocol;
export function prepareEchoConnectionKit(zone: import('@agoric/base-zone').Zone): () => import("@endo/exo/src/exo-makers.js").GuardedKit<{
export function crossoverConnection(zone: import("@agoric/zone").Zone, handler0: Remote<Required<ConnectionHandler>>, addr0: Endpoint, handler1: Remote<Required<ConnectionHandler>>, addr1: Endpoint, makeConnection: (opts: ConnectionOpts) => Connection, finalizer: Finalizer, current?: WeakSetStore<Closable>): Connection[];
export function prepareNetworkProtocol(zone: import("@agoric/base-zone").Zone, powers: Powers): (protocolHandler: Remote<ProtocolHandler>) => Protocol;
export function prepareEchoConnectionKit(zone: import("@agoric/base-zone").Zone): () => import("@endo/exo").GuardedKit<{
handler: {

@@ -73,9 +59,9 @@ /**

* @param {Connection} _connection
* @param {CloseReason} [_reason]
* @param {CloseReason} [reason]
* @param {ConnectionHandler} [_connectionHandler]
*/
onClose(_connection: Connection, _reason?: CloseReason, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
onClose(_connection: Connection, reason?: CloseReason, _connectionHandler?: ConnectionHandler): Promise<void>;
};
listener: {
onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<import("@endo/exo/src/exo-makers.js").Guarded<{
onAccept(_port: any, _localAddr: any, _remoteAddr: any, _listenHandler: any): Promise<import("@endo/exo").Guarded<{
/**

@@ -89,6 +75,6 @@ * @param {Connection} _connection

* @param {Connection} _connection
* @param {CloseReason} [_reason]
* @param {CloseReason} [reason]
* @param {ConnectionHandler} [_connectionHandler]
*/
onClose(_connection: Connection, _reason?: CloseReason, _connectionHandler?: ConnectionHandler | undefined): Promise<void>;
onClose(_connection: Connection, reason?: CloseReason, _connectionHandler?: ConnectionHandler): Promise<void>;
}>>;

@@ -98,5 +84,18 @@ onListen(port: any, _listenHandler: any): Promise<void>;

}>;
export function preparePortAllocator(zone: import("@agoric/base-zone").Zone, { watch }: Powers): (args_0: {
protocol: Protocol;
}) => import("@endo/exo").Guarded<{
allocateCustomIBCPort(specifiedName?: string): Promise<import("@agoric/vow").Vow<Port>>;
allocateICAControllerPort(): Promise<import("@agoric/vow").Vow<Port>>;
allocateICQControllerPort(): Promise<import("@agoric/vow").Vow<Port>>;
allocateCustomLocalPort(specifiedName?: string): Promise<import("@agoric/vow").Vow<Port>>;
}>;
export function prepareNetworkPowers(zone: import("@agoric/base-zone").Zone, vowTools: VowTools): Powers;
export type MakeEchoConnectionKit = ReturnType<typeof prepareEchoConnectionKit>;
export type Powers = VowTools & {
finalizer: Finalizer;
};
export type ConnectionOpts = {
addrs: Endpoint[];
handlers: import('@agoric/vow').Remote<Required<ConnectionHandler>>[];
handlers: Remote<Required<ConnectionHandler>>[];
conns: MapStore<number, Connection>;

@@ -107,2 +106,51 @@ current: WeakSetStore<Closable>;

};
export type PortAllocator = ReturnType<ReturnType<typeof preparePortAllocator>>;
export type Finalizer = ReturnType<typeof prepareFinalizer>;
import type { VowTools } from '@agoric/vow';
import type { Endpoint } from './types.js';
import type { AttemptDescription } from './types.js';
import type { Port } from './types.js';
import type { Remote } from '@agoric/vow';
import type { ListenHandler } from './types.js';
import type { ConnectionHandler } from './types.js';
import type { Connection } from './types.js';
import type { Closable } from './types.js';
import type { ProtocolHandler } from './types.js';
import type { Protocol } from './types.js';
import type { Bytes } from './types.js';
import type { CloseReason } from './types.js';
/** @typedef {ReturnType<ReturnType<typeof preparePortAllocator>>} PortAllocator */
/**
* Return a package-specific singleton that pins objects until they are
* explicitly unpinned or finalized. It needs to pin objects only because they
* are resources that need to be released.
*
* The reason this functionality wasn't just baked into the other network exos
* is to maintain upgrade-compatible with minimal additional changes.
*
* @param {import('@agoric/base-zone').Zone} zone
* @param {VowTools} vowTools
*/
declare function prepareFinalizer(zone: import("@agoric/base-zone").Zone, { watch }: VowTools): import("@endo/exo").Guarded<{
has(obj: any): boolean;
/**
* Add a connection and handler for an `onClose` method to be called upon
* finalization.
* @param {Remote<Connection>} conn
* @param {Remote<Required<ConnectionHandler>>} handler
*/
initConnection(conn: Remote<Connection>, handler: Remote<Required<ConnectionHandler>>): void;
/**
* Add an object with a `close` method to be called (such as an
* `inboundAttempt`) upon finalization.
* @param {Remote<{ close(): PromiseVow<any> }>} closer
*/
initCloser(closer: Remote<{
close(): PromiseVow<any>;
}>): void;
finalize(obj: any): import("@agoric/vow").Vow<any> | undefined;
unpin(obj: any): void;
}>;
import type { PromiseVow } from '@agoric/vow';
export {};
//# sourceMappingURL=network.d.ts.map
// @ts-check
/// <reference types="@agoric/store/exported.js" />
import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
import { Fail } from '@agoric/assert';
import { toBytes } from './bytes.js';
import { Shape } from './shapes.js';
import '@agoric/store/exported.js';
/// <reference path="./types.js" />
/**
* @import {AttemptDescription, Bytes, CloseReason, Closable, Connection, ConnectionHandler, Endpoint, ListenHandler, Port, Protocol, ProtocolHandler, ProtocolImpl} from './types.js';
* @import {PromiseVow, Remote, VowTools} from '@agoric/vow';
*/
/** @typedef {VowTools & { finalizer: Finalizer }} Powers */
const sink = () => {};
harden(sink);
/**

@@ -18,2 +28,5 @@ * Compatibility note: this must match what our peers use, so don't change it

// Mark the finalizer close reason.
export const CLOSE_REASON_FINALIZER = 'closed-by-finalizer';
/** @param {unknown} err */

@@ -51,5 +64,19 @@ export const rethrowUnlessMissing = err => {

/**
* Validate IBC port name
* @param {string} specifiedName
*/
function throwIfInvalidPortName(specifiedName) {
// Contains between 2 and 128 characters
// Can contain alphanumeric characters
// Valid symbols: ., ,, _, +, -, #, [, ], <, >
const portNameRegex = new RegExp('^[a-zA-Z0-9.,_+\\-#<>\\[\\]]{2,128}$');
if (!portNameRegex.test(specifiedName)) {
throw Error(`Invalid IBC port name: ${specifiedName}`);
}
}
/**
* @typedef {object} ConnectionOpts
* @property {Endpoint[]} addrs
* @property {import('@agoric/vow').Remote<Required<ConnectionHandler>>[]} handlers
* @property {Remote<Required<ConnectionHandler>>[]} handlers
* @property {MapStore<number, Connection>} conns

@@ -63,5 +90,5 @@ * @property {WeakSetStore<Closable>} current

* @param {import('@agoric/base-zone').Zone} zone
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {Powers} powers
*/
const prepareHalfConnection = (zone, { watch }) => {
const prepareHalfConnection = (zone, { watch, allVows, finalizer }) => {
const makeHalfConnectionKit = zone.exoClassKit(

@@ -111,3 +138,3 @@ 'Connection',

async close() {
const { closed, current, conns, l, handlers } = this.state;
const { closed, current, conns, l, r } = this.state;
if (closed) {

@@ -117,9 +144,11 @@ throw Error(closed);

this.state.closed = 'Connection closed';
current.delete(conns.get(l));
// Tear down both sides.
const lconn = conns.get(l);
const rconn = conns.get(r);
current.delete(lconn);
current.delete(rconn);
const innerVow = watch(
E(this.state.handlers[l]).onClose(
conns.get(l),
undefined,
handlers[l],
),
allVows([finalizer.finalize(lconn), finalizer.finalize(rconn)]),
this.facets.sinkWatcher,

@@ -166,7 +195,8 @@ );

* @param {import('@agoric/zone').Zone} zone
* @param {import('@agoric/vow').Remote<Required<ConnectionHandler>>} handler0
* @param {Remote<Required<ConnectionHandler>>} handler0
* @param {Endpoint} addr0
* @param {import('@agoric/vow').Remote<Required<ConnectionHandler>>} handler1
* @param {Remote<Required<ConnectionHandler>>} handler1
* @param {Endpoint} addr1
* @param {(opts: ConnectionOpts) => Connection} makeConnection
* @param {Finalizer} finalizer
* @param {WeakSetStore<Closable>} [current]

@@ -181,2 +211,3 @@ */

makeConnection,
finalizer,
current = zone.detached().weakSetStore('crossoverCurrentConnections'),

@@ -189,3 +220,3 @@ ) => {

/** @type {import('@agoric/vow').Remote<Required<ConnectionHandler>>[]} */
/** @type {Remote<Required<ConnectionHandler>>[]} */
const handlers = harden([handler0, handler1]);

@@ -208,5 +239,9 @@ /** @type {Endpoint[]} */

const openHalfConnection = (l, r) => {
current.add(conns.get(l));
const lconn = conns.get(l);
current.add(lconn);
if (!finalizer.has(lconn)) {
finalizer.initConnection(lconn, handlers[l]);
}
E(handlers[l])
.onOpen(conns.get(l), addrs[l], addrs[r], handlers[l])
.onOpen(lconn, addrs[l], addrs[r], handlers[l])
.catch(rethrowUnlessMissing);

@@ -227,5 +262,5 @@ };

* @param {(opts: ConnectionOpts) => Connection} makeConnection
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {Powers} powers
*/
const prepareInboundAttempt = (zone, makeConnection, { watch }) => {
const prepareInboundAttempt = (zone, makeConnection, { watch, finalizer }) => {
const makeInboundAttemptKit = zone.exoClassKit(

@@ -240,3 +275,3 @@ 'InboundAttempt',

* @param {string} opts.listenPrefix
* @param {MapStore<Endpoint, [Port, import('@agoric/vow').Remote<Required<ListenHandler>>]>} opts.listening
* @param {MapStore<Endpoint, [Port, Remote<Required<ListenHandler>>]>} opts.listening
*/

@@ -284,2 +319,3 @@ ({

current.delete(this.facets.inboundAttempt);
finalizer.unpin(this.facets.inboundAttempt);

@@ -297,3 +333,3 @@ const innerVow = watch(

* @param {string} [opts.remoteAddress]
* @param {import('@agoric/vow').Remote<ConnectionHandler>} opts.handler
* @param {Remote<ConnectionHandler>} opts.handler
*/

@@ -340,11 +376,8 @@ async accept({ localAddress, remoteAddress, handler: rchandler }) {

zone,
/** @type {import('@agoric/vow').Remote<Required<ConnectionHandler>>} */ (
lchandler
),
/** @type {Remote<Required<ConnectionHandler>>} */ (lchandler),
localAddress,
/** @type {import('@agoric/vow').Remote<Required<ConnectionHandler>>} */ (
rchandler
),
/** @type {Remote<Required<ConnectionHandler>>} */ (rchandler),
remoteAddress,
makeConnection,
finalizer,
current,

@@ -388,3 +421,3 @@ )[1];

/** @enum {number} */
/** @enum {typeof RevokeState[keyof typeof RevokeState]} */
const RevokeState = /** @type {const} */ ({

@@ -395,6 +428,7 @@ NOT_REVOKED: 0,

});
harden(RevokeState);
/**
* @param {import('@agoric/zone').Zone} zone
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {Powers} powers
*/

@@ -404,3 +438,3 @@ const preparePort = (zone, powers) => {

const { watch, allVows } = powers;
const { finalizer, watch, allVows } = powers;

@@ -410,7 +444,7 @@ /**

* @param {Endpoint} opts.localAddr
* @param {MapStore<Endpoint, [Port, import('@agoric/vow').Remote<Required<ListenHandler>>]>} opts.listening
* @param {SetStore<import('@agoric/vow').Remote<Connection>>} opts.openConnections
* @param {MapStore<Endpoint, [Port, Remote<Required<ListenHandler>>]>} opts.listening
* @param {SetStore<Remote<Connection>>} opts.openConnections
* @param {MapStore<Port, SetStore<Closable>>} opts.currentConnections
* @param {MapStore<string, Port>} opts.boundPorts
* @param {import('@agoric/vow').Remote<ProtocolHandler>} opts.protocolHandler
* @param {Remote<ProtocolHandler>} opts.protocolHandler
* @param {Remote<ProtocolImpl>} opts.protocolImpl

@@ -446,3 +480,3 @@ */

},
/** @param {import('@agoric/vow').Remote<ListenHandler>} listenHandler */
/** @param {Remote<ListenHandler>} listenHandler */
async addListener(listenHandler) {

@@ -527,3 +561,3 @@ const { revoked, listening, localAddr, protocolHandler } = this.state;

this.facets.portConnectWatcher,
{ revoked },
{ chandler: connectionHandler },
);

@@ -539,3 +573,2 @@ },

this.state.revoked = RevokeState.REVOKING;
const revokeVow = watch(

@@ -566,11 +599,12 @@ E(protocolHandler).onRevoke(

portConnectWatcher: {
onFulfilled(conn, watchContext) {
const { revoked } = watchContext;
const { openConnections } = this.state;
onFulfilled(conn, { chandler }) {
const { openConnections, revoked } = this.state;
if (!finalizer.has(conn)) {
finalizer.initConnection(conn, chandler);
}
if (revoked) {
void E(conn).close();
} else {
openConnections.add(conn);
return finalizer.finalize(conn);
}
openConnections.add(conn);
return conn;

@@ -587,8 +621,6 @@ },

/** @type {import('@agoric/vow').Specimen[]} */
const ps = [];
ps.push(
...values.map(conn =>
watch(E(conn).close(), this.facets.sinkWatcher),
...values.map(obj =>
watch(finalizer.finalize(obj), this.facets.sinkWatcher),
),

@@ -656,3 +688,3 @@ );

* @param {import('@agoric/base-zone').Zone} zone
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {Powers} powers
*/

@@ -662,3 +694,3 @@ const prepareBinder = (zone, powers) => {

const { watch } = powers;
const { watch, finalizer } = powers;

@@ -680,3 +712,3 @@ const makeInboundAttempt = prepareInboundAttempt(

binder: M.interface('Binder', {
bind: M.callWhen(Shape.Endpoint).returns(Shape.Vow$(Shape.Port)),
bindPort: M.callWhen(Shape.Endpoint).returns(Shape.Vow$(Shape.Port)),
}),

@@ -869,4 +901,4 @@ binderInboundInstantiateWatcher: M.interface(

},
async bind(localAddr) {
return this.facets.binder.bind(localAddr);
async bindPort(localAddr) {
return this.facets.binder.bindPort(localAddr);
},

@@ -876,3 +908,3 @@ },

/** @param {string} localAddr */
async bind(localAddr) {
async bindPort(localAddr) {
const { protocolHandler } = this.state;

@@ -915,2 +947,3 @@

current.add(inboundAttempt);
finalizer.initCloser(inboundAttempt);
return inboundAttempt;

@@ -994,5 +1027,17 @@ },

binderOutboundConnectWatcher: {
onFulfilled({ handler: rchandler }, watchContext) {
const { lastFailure, remoteAddr, localAddr, lchandler, port } =
watchContext;
onFulfilled(
{
handler: rchandler,
remoteAddress: negotiatedRemoteAddress,
localAddress: negotiatedLocalAddress,
},
watchContext,
) {
const {
lastFailure,
lchandler,
localAddr: requestedLocalAddress,
remoteAddr: requestedRemoteAddress,
port,
} = watchContext;

@@ -1009,11 +1054,8 @@ const { currentConnections } = this.state;

zone,
/** @type {import('@agoric/vow').Remote<Required<ConnectionHandler>>} */ (
lchandler
),
localAddr,
/** @type {import('@agoric/vow').Remote<Required<ConnectionHandler>>} */ (
rchandler
),
remoteAddr,
/** @type {Remote<Required<ConnectionHandler>>} */ (lchandler),
negotiatedLocalAddress || requestedLocalAddress,
/** @type {Remote<Required<ConnectionHandler>>} */ (rchandler),
negotiatedRemoteAddress || requestedRemoteAddress,
makeConnection,
finalizer,
current,

@@ -1171,3 +1213,3 @@ )[0];

* @param {import('@agoric/base-zone').Zone} zone
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {Powers} powers
*/

@@ -1264,6 +1306,6 @@ export const prepareNetworkProtocol = (zone, powers) => {

* @param {Connection} _connection
* @param {CloseReason} [_reason]
* @param {CloseReason} [reason]
* @param {ConnectionHandler} [_connectionHandler]
*/
async onClose(_connection, _reason, _connectionHandler) {
async onClose(_connection, reason, _connectionHandler) {
const { closed } = this.state;

@@ -1275,3 +1317,3 @@

this.state.closed = 'Connection closed';
this.state.closed = reason || 'Connection closed';
},

@@ -1292,2 +1334,3 @@ },

};
/** @typedef {ReturnType<typeof prepareEchoConnectionKit>} MakeEchoConnectionKit */

@@ -1298,3 +1341,3 @@ /**

* @param {import('@agoric/base-zone').Zone} zone
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {VowTools} powers
*/

@@ -1338,3 +1381,3 @@ export function prepareLoopbackProtocolHandler(zone, { watch, allVows }) {

* @param {Endpoint} remoteAddr
* @returns {PromiseVow<AttemptDescription>}}
* @returns {import('@agoric/vow').PromiseVow<AttemptDescription>}}
*/

@@ -1446,2 +1489,3 @@ async onConnect(_port, localAddr, remoteAddr) {

/** @param {string} [instancePrefix] */
const makeLoopbackProtocolHandler = instancePrefix => {

@@ -1454,1 +1498,151 @@ const { protocolHandler } = makeLoopbackProtocolHandlerKit(instancePrefix);

}
/**
*
* @param {import('@agoric/base-zone').Zone} zone
* @param {Powers} powers
*/
export const preparePortAllocator = (zone, { watch }) =>
zone.exoClass(
'PortAllocator',
M.interface('PortAllocator', {
allocateCustomIBCPort: M.callWhen()
.optional(M.string())
.returns(Shape.Vow$(Shape.Port)),
allocateICAControllerPort: M.callWhen().returns(Shape.Vow$(Shape.Port)),
allocateICQControllerPort: M.callWhen().returns(Shape.Vow$(Shape.Port)),
allocateCustomLocalPort: M.callWhen()
.optional(M.string())
.returns(Shape.Vow$(Shape.Port)),
}),
/**
*
* @param {object} opts
* @param {Protocol} opts.protocol
*/
({ protocol }) => ({ protocol, lastICAPortNum: 0n, lastICQPortNum: 0n }),
{
async allocateCustomIBCPort(specifiedName = '') {
const { state } = this;
let localAddr = `/ibc-port/`;
if (specifiedName) {
throwIfInvalidPortName(specifiedName);
localAddr = `/ibc-port/custom-${specifiedName}`;
}
// Allocate an IBC port with a unique generated name.
return watch(E(state.protocol).bindPort(localAddr));
},
async allocateICAControllerPort() {
const { state } = this;
state.lastICAPortNum += 1n;
return watch(
E(state.protocol).bindPort(
`/ibc-port/icacontroller-${state.lastICAPortNum}`,
),
);
},
async allocateICQControllerPort() {
const { state } = this;
state.lastICQPortNum += 1n;
return watch(
E(state.protocol).bindPort(
`/ibc-port/icqcontroller-${state.lastICQPortNum}`,
),
);
},
async allocateCustomLocalPort(specifiedName = '') {
const { state } = this;
let localAddr = `/local/`;
if (specifiedName) {
throwIfInvalidPortName(specifiedName);
localAddr = `/local/custom-${specifiedName}`;
}
// Allocate a local port with a unique generated name.
return watch(E(state.protocol).bindPort(localAddr));
},
},
);
/** @typedef {ReturnType<ReturnType<typeof preparePortAllocator>>} PortAllocator */
/**
* Return a package-specific singleton that pins objects until they are
* explicitly unpinned or finalized. It needs to pin objects only because they
* are resources that need to be released.
*
* The reason this functionality wasn't just baked into the other network exos
* is to maintain upgrade-compatible with minimal additional changes.
*
* @param {import('@agoric/base-zone').Zone} zone
* @param {VowTools} vowTools
*/
const prepareFinalizer = (zone, { watch }) => {
/**
* @type {MapStore<{},
* { conn: Remote<Connection>, handler: Remote<Required<ConnectionHandler>>} |
* { closer: Remote<{ close(): PromiseVow<any> }> }
* >}
*/
const objToFinalizerInfo = zone.mapStore('objToFinalizerInfo');
return zone.exo('NetworkFinalizer', undefined, {
has(obj) {
return objToFinalizerInfo.has(obj);
},
/**
* Add a connection and handler for an `onClose` method to be called upon
* finalization.
* @param {Remote<Connection>} conn
* @param {Remote<Required<ConnectionHandler>>} handler
*/
initConnection(conn, handler) {
objToFinalizerInfo.init(conn, harden({ conn, handler }));
},
/**
* Add an object with a `close` method to be called (such as an
* `inboundAttempt`) upon finalization.
* @param {Remote<{ close(): PromiseVow<any> }>} closer
*/
initCloser(closer) {
objToFinalizerInfo.init(closer, harden({ closer }));
},
finalize(obj) {
if (!objToFinalizerInfo.has(obj)) {
return;
}
const disposeInfo = objToFinalizerInfo.get(obj);
if ('conn' in disposeInfo) {
// A connection+handler.
const { conn, handler } = disposeInfo;
objToFinalizerInfo.delete(obj);
return watch(E(handler).onClose(conn, CLOSE_REASON_FINALIZER, handler));
} else if ('closer' in disposeInfo) {
// Just something with a `close` method.
const { closer } = disposeInfo;
objToFinalizerInfo.delete(obj);
return watch(E(closer).close());
}
},
unpin(obj) {
objToFinalizerInfo.delete(obj);
},
});
};
harden(prepareFinalizer);
/**
* @param {import('@agoric/base-zone').Zone} zone
* @param {VowTools} vowTools
* @returns {Powers}
*/
export const prepareNetworkPowers = (zone, vowTools) => {
const finalizer = prepareFinalizer(zone, vowTools);
return harden({ ...vowTools, finalizer });
};
/** @typedef {ReturnType<typeof prepareFinalizer>} Finalizer */
/**
* @import {Endpoint, Port, Protocol, ProtocolHandler} from './types.js';
* @import {PromiseVow, Remote, VowTools} from '@agoric/vow';
*/
/**
* @template T

@@ -16,3 +20,3 @@ * @typedef {object} Router A delimited string router implementation

}>;
export function prepareRouter<T>(zone: import('@agoric/base-zone').Zone): () => import("@endo/exo/src/exo-makers.js").Guarded<{
export function prepareRouter<T>(zone: import("@agoric/base-zone").Zone): () => import("@endo/exo").Guarded<{
/** @param {Endpoint} addr */

@@ -31,20 +35,3 @@ getRoutes(addr: Endpoint): [string, T][];

}>;
export function prepareRouterProtocol(zone: import('@agoric/base-zone').Zone, powers: ReturnType<(zone: import("@agoric/base-zone").Zone, powers?: {
isRetryableReason?: ((reason: any) => boolean) | undefined;
watchPromise?: ((p: PromiseLike<any>, watcher: import("@agoric/vow/src/watch-promise.js").PromiseWatcher, ...args: unknown[]) => void) | undefined;
} | undefined) => {
when: <T, TResult1 = import("@agoric/vow").Unwrap<T>, TResult2 = never>(specimenP: T, onFulfilled?: ((value: import("@agoric/vow").Unwrap<T>) => TResult1 | PromiseLike<TResult1>) | undefined, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined) => Promise<TResult1 | TResult2>;
watch: <T_1 = any, TResult1_1 = T_1, TResult2_1 = T_1>(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?: unknown) => import("@agoric/vow").Vow<TResult1_1 | TResult2_1>;
makeVowKit: <T_2>() => import("@agoric/vow").VowKit<T_2>;
allVows: (vows: any) => import("@agoric/vow").Vow<any>;
}>, E?: ((<T_3>(x: T_3) => import("@endo/eventual-send/src/E.js").ECallableOrMethods<import("@endo/eventual-send").RemoteFunctions<T_3>>) & {
readonly get: <T_1_1>(x: T_1_1) => import("@endo/eventual-send/src/E.js").EGetters<import("@endo/eventual-send").LocalRecord<T_1_1>>;
readonly resolve: {
(): Promise<void>;
<T_2_1>(value: T_2_1): Promise<Awaited<T_2_1>>;
<T_3_1>(value: T_3_1 | PromiseLike<T_3_1>): Promise<Awaited<T_3_1>>;
};
readonly sendOnly: <T_4>(x: T_4) => import("@endo/eventual-send/src/E.js").ESendOnlyCallableOrMethods<import("@endo/eventual-send").RemoteFunctions<T_4>>;
readonly when: <T_5, U = T_5>(x: T_5 | PromiseLike<T_5>, onfulfilled?: ((value: T_5) => import("@endo/eventual-send").ERef<U>) | undefined, onrejected?: ((reason: any) => import("@endo/eventual-send").ERef<U>) | undefined) => Promise<U>;
}) | undefined): () => import("@endo/exo/src/exo-makers.js").Guarded<{
export function prepareRouterProtocol(zone: import("@agoric/base-zone").Zone, powers: import("./network.js").Powers, E?: typeof defaultE): () => import("@endo/exo").Guarded<{
/**

@@ -61,3 +48,3 @@ * @param {string[]} paths

/** @param {Endpoint} localAddr */
bind(localAddr: Endpoint): Promise<Port | import("@agoric/vow").Vow<Port>>;
bindPort(localAddr: Endpoint): Promise<Port | import("@agoric/vow").Vow<Port>>;
}>;

@@ -85,6 +72,12 @@ /**

export type RouterProtocol = {
bind: (prefix: string) => PromiseVow<Port>;
bindPort: (prefix: string) => PromiseVow<Port>;
registerProtocolHandler: (paths: string[], protocolHandler: ProtocolHandler) => void;
unregisterProtocolHandler: (prefix: string, protocolHandler: ProtocolHandler) => void;
};
import type { Endpoint } from './types.js';
import { E as defaultE } from '@endo/far';
import type { ProtocolHandler } from './types.js';
import type { Remote } from '@agoric/vow';
import type { Port } from './types.js';
import type { PromiseVow } from '@agoric/vow';
//# sourceMappingURL=router.d.ts.map
// @ts-check
/// <reference types="@agoric/store/exported.js" />
/// <reference path="./types.js" />
import { Fail } from '@endo/errors';
import { E as defaultE } from '@endo/far';
import { M } from '@endo/patterns';
import { Fail } from '@agoric/assert';
import { ENDPOINT_SEPARATOR, prepareNetworkProtocol } from './network.js';
import { Shape } from './shapes.js';
import '@agoric/store/exported.js';
/// <reference path="./types.js" />
/**
* @import {Endpoint, Port, Protocol, ProtocolHandler} from './types.js';
* @import {PromiseVow, Remote, VowTools} from '@agoric/vow';
*/

@@ -96,3 +102,3 @@ /**

* @typedef {object} RouterProtocol
* @property {(prefix: string) => PromiseVow<Port>} bind
* @property {(prefix: string) => PromiseVow<Port>} bindPort
* @property {(paths: string[], protocolHandler: ProtocolHandler) => void} registerProtocolHandler

@@ -106,3 +112,3 @@ * @property {(prefix: string, protocolHandler: ProtocolHandler) => void} unregisterProtocolHandler

* @param {import('@agoric/base-zone').Zone} zone
* @param {ReturnType<import('@agoric/vow').prepareVowTools>} powers
* @param {import('./network.js').Powers} powers
* @param {typeof defaultE} [E] Eventual sender

@@ -124,3 +130,3 @@ */

unregisterProtocolHandler: M.call(M.string(), M.remotable()).returns(),
bind: M.callWhen(Shape.Endpoint).returns(Shape.Vow$(Shape.Port)),
bindPort: M.callWhen(Shape.Endpoint).returns(Shape.Vow$(Shape.Port)),
}),

@@ -175,6 +181,6 @@ () => {

/** @param {Endpoint} localAddr */
async bind(localAddr) {
async bindPort(localAddr) {
const [route] = this.state.router.getRoutes(localAddr);
route !== undefined || Fail`No registered router for ${localAddr}`;
return E(route[1]).bind(localAddr);
return E(route[1]).bindPort(localAddr);
},

@@ -181,0 +187,0 @@ },

@@ -97,3 +97,3 @@ export namespace Shape {

let ProtocolImplI: import("@endo/patterns").InterfaceGuard<{
bind: import("@endo/patterns").MethodGuard;
bindPort: import("@endo/patterns").MethodGuard;
inbound: import("@endo/patterns").MethodGuard;

@@ -100,0 +100,0 @@ outbound: import("@endo/patterns").MethodGuard;

@@ -161,3 +161,3 @@ // @ts-check

protocolHandlerAcceptWatcher: M.interface('ProtocolHandlerAcceptWatcher', {
onFulfilled: M.call(M.any()).rest(M.any()).returns(),
onFulfilled: M.call(M.any()).rest(M.any()).returns(M.any()),
}),

@@ -167,3 +167,3 @@ protocolHandlerInstantiateWatcher: M.interface(

{
onFulfilled: M.call(M.any()).rest(M.any()).returns(),
onFulfilled: M.call(M.any()).rest(M.any()).returns(M.any()),
},

@@ -174,3 +174,3 @@ ),

{
onFulfilled: M.call(M.any()).rest(M.any()).returns(),
onFulfilled: M.call(M.any()).rest(M.any()).returns(M.any()),
},

@@ -184,3 +184,3 @@ ),

ProtocolImplI: M.interface('ProtocolImpl', {
bind: M.callWhen(Shape2.Endpoint).returns(Shape2.Vow$(Shape2.Port)),
bindPort: M.callWhen(Shape2.Endpoint).returns(Shape2.Vow$(Shape2.Port)),
inbound: M.callWhen(Shape2.Endpoint, Shape2.Endpoint).returns(

@@ -187,0 +187,0 @@ Shape2.Vow$(Shape2.InboundAttempt),

@@ -1,8 +0,6 @@

type PromiseVow<T> = import('@agoric/vow').PromiseVow<T>;
type Remote<T> = import('@agoric/vow').Remote<T>;
/**
* Rearrange the exo types to make a cast of the methods (M) and init function (I) to a specific type.
*/
type ExoClassMethods<M extends import("@endo/exo/src/exo-tools").Methods, I extends (...args: any[]) => any> = M & ThisType<{
self: import('@endo/exo/src/exo-makers').Guarded<M>;
export type ExoClassMethods<M extends import("@endo/exo").Methods, I extends (...args: any[]) => any> = M & ThisType<{
self: import("@endo/exo").Guarded<M>;
state: ReturnType<I>;

@@ -13,3 +11,3 @@ }>;

*/
type Bytes = string;
export type Bytes = string;
/**

@@ -19,7 +17,7 @@ * A local or remote address See multiaddr.js for an

*/
type Endpoint = string;
export type Endpoint = string;
/**
* A closable object
*/
type Closable = {
export type ClosableI = {
/**

@@ -30,6 +28,7 @@ * Terminate the object

};
export type Closable = RemotableObject & ClosableI;
/**
* The network Protocol
*/
type Protocol = {
export type Protocol = {
/**

@@ -39,3 +38,3 @@ * Claim a port, or if

*/
bind: (prefix: Endpoint) => PromiseVow<Port>;
bindPort: (prefix: Endpoint) => PromiseVow<Port>;
};

@@ -45,3 +44,3 @@ /**

*/
type Port = {
export type Port = {
/**

@@ -73,3 +72,3 @@ * Get the locally bound name of this

*/
type ListenHandler = {
export type ListenHandler = {
/**

@@ -97,3 +96,3 @@ * The listener has been registered

};
type Connection = {
export type ConnectionI = {
/**

@@ -117,6 +116,7 @@ * Send a packet on the connection

};
export type Connection = RemotableObject & ConnectionI;
/**
* A handler for a given Connection
*/
type ConnectionHandler = {
export type ConnectionHandler = {
/**

@@ -138,4 +138,4 @@ * The connection has been opened

*/
type CloseReason = any | null;
type AttemptDescription = {
export type CloseReason = any | null;
export type AttemptDescription = {
handler: Remote<ConnectionHandler>;

@@ -149,3 +149,3 @@ remoteAddress?: string | undefined;

*/
type ProtocolHandler = {
export type ProtocolHandler = {
/**

@@ -187,3 +187,3 @@ * This protocol is created

*/
type InboundAttempt = {
export type InboundAttempt = {
/**

@@ -211,3 +211,3 @@ * Establish the connection

*/
type ProtocolImpl = {
export type ProtocolImpl = {
/**

@@ -217,3 +217,3 @@ * Claim a port, or if

*/
bind: (prefix: Endpoint) => PromiseVow<Remote<Port>>;
bindPort: (prefix: Endpoint) => PromiseVow<Remote<Port>>;
/**

@@ -228,2 +228,5 @@ * Make an attempt to connect into this protocol

};
import type { PromiseVow } from '@agoric/vow';
import type { RemotableObject } from '@endo/pass-style';
import type { Remote } from '@agoric/vow';
//# sourceMappingURL=types.d.ts.map
// @ts-check
/**
* @template T
* @typedef {import('@agoric/vow').PromiseVow<T>} PromiseVow
*/
// Ensure this is a module.
export {};
/**
* @template T
* @typedef {import('@agoric/vow').Remote<T>} Remote
* @import {Passable, RemotableObject} from '@endo/pass-style';
* @import {PromiseVow, Remote} from '@agoric/vow';
*/
/**
* @template {import('@endo/exo/src/exo-makers').Methods} M
* @template {import('@endo/exo').Methods} M
* @template {(...args: any[]) => any} I
* @typedef {M & ThisType<{ self: import('@endo/exo/src/exo-makers').Guarded<M>, state: ReturnType<I> }>} ExoClassMethods
* @typedef {M & ThisType<{ self: import('@endo/exo').Guarded<M>, state: ReturnType<I> }>} ExoClassMethods
* Rearrange the exo types to make a cast of the methods (M) and init function (I) to a specific type.

@@ -30,9 +28,12 @@ */

/**
* @typedef {object} Closable A closable object
* @typedef {object} ClosableI A closable object
* @property {() => PromiseVow<void>} close Terminate the object
*/
/**
* @typedef {RemotableObject & ClosableI} Closable
*/
/**
* @typedef {object} Protocol The network Protocol
* @property {(prefix: Endpoint) => PromiseVow<Port>} bind Claim a port, or if
* @property {(prefix: Endpoint) => PromiseVow<Port>} bindPort Claim a port, or if
* ending in ENDPOINT_SEPARATOR, a fresh name

@@ -82,3 +83,3 @@ */

/**
* @typedef {object} Connection
* @typedef {object} ConnectionI
* @property {(

@@ -94,2 +95,5 @@ * packetBytes: Bytes,

*/
/**
* @typedef {RemotableObject & ConnectionI} Connection
*/

@@ -188,3 +192,3 @@ /**

* @typedef {object} ProtocolImpl Things the protocol can do for us
* @property {(prefix: Endpoint) => PromiseVow<Remote<Port>>} bind Claim a port, or if
* @property {(prefix: Endpoint) => PromiseVow<Remote<Port>>} bindPort Claim a port, or if
* ending in ENDPOINT_SEPARATOR, a fresh name

@@ -191,0 +195,0 @@ * @property {(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc