diff --git a/packages/@tests/smoke_web/package.json b/packages/@tests/smoke_web/package.json index e1fffa13..b87760b4 100644 --- a/packages/@tests/smoke_web/package.json +++ b/packages/@tests/smoke_web/package.json @@ -19,6 +19,7 @@ "license": "Apache-2.0", "dependencies": { "@fluencelabs/js-client.api": "workspace:*", + "@fluencelabs/interface": "workspace:*", "@fluencelabs/fluence-network-environment": "1.0.13" }, "devDependencies": { diff --git a/packages/@tests/smoke_web/src/_aqua/smoke_test.ts b/packages/@tests/smoke_web/src/_aqua/smoke_test.ts index ea760fd8..84027887 100644 --- a/packages/@tests/smoke_web/src/_aqua/smoke_test.ts +++ b/packages/@tests/smoke_web/src/_aqua/smoke_test.ts @@ -6,8 +6,7 @@ * Aqua version: 0.7.2-314 * */ -import type { IFluencePeer } from '@fluencelabs/js-peer/dist/interfaces'; -import type { CallParams } from '@fluencelabs/js-peer/dist/interfaces/commonTypes'; +import type { IFluencePeer, CallParams } from '@fluencelabs/interface'; import { callFunction$$, registerService$$ } from '@fluencelabs/js-client.api/dist/compilerSupport/v4'; // Services diff --git a/packages/client/api/package.json b/packages/client/api/package.json index 21394f57..0d4db7d7 100644 --- a/packages/client/api/package.json +++ b/packages/client/api/package.json @@ -29,8 +29,8 @@ "repository": "https://github.com/fluencelabs/fluence-js", "author": "Fluence Labs", "license": "Apache-2.0", - "dependencies": {}, - "devDependencies": { - "@fluencelabs/js-peer": "workspace:*" - } + "dependencies": { + "@fluencelabs/interface": "workspace:*" + }, + "devDependencies": {} } diff --git a/packages/client/api/src/compilerSupport/v3.ts b/packages/client/api/src/compilerSupport/v3.ts index 81c09676..f7215f5e 100644 --- a/packages/client/api/src/compilerSupport/v3.ts +++ b/packages/client/api/src/compilerSupport/v3.ts @@ -14,15 +14,13 @@ * limitations under the License. */ -import { IFluencePeer, isFluencePeer } from '@fluencelabs/js-peer/dist/interfaces/index'; -import { FnConfig, FunctionCallDef, ServiceDef } from '@fluencelabs/js-peer/dist/js-peer/compilerSupport/interface'; -import { registerServiceImpl } from '@fluencelabs/js-peer/dist/js-peer/compilerSupport/registerService'; -import { callFunctionImpl, getArgumentTypes } from '@fluencelabs/js-peer/dist/js-peer/compilerSupport/callFunction'; +import type { IFluencePeer, CallParams, FnConfig, FunctionCallDef, ServiceDef } from '@fluencelabs/interface'; +import { getArgumentTypes } from '@fluencelabs/interface'; +import { isFluencePeer } from '@fluencelabs/interface'; import { getDefaultPeer } from '../index.js'; -export type { IFluencePeer } from '@fluencelabs/js-peer/dist/interfaces/index'; -export type { CallParams } from '@fluencelabs/js-peer/dist/interfaces/commonTypes'; +export type { IFluencePeer, CallParams } from '@fluencelabs/interface'; export { ArrayType, @@ -44,9 +42,7 @@ export { StructType, TopType, UnlabeledProductType, -} from '@fluencelabs/js-peer/dist/js-peer/compilerSupport/interface'; -export { callFunctionImpl } from '@fluencelabs/js-peer/dist/js-peer/compilerSupport/callFunction'; -export { registerServiceImpl } from '@fluencelabs/js-peer/dist/js-peer/compilerSupport/registerService'; +} from '@fluencelabs/interface'; /** * Convenience function to support Aqua `func` generation backend @@ -58,7 +54,12 @@ export { registerServiceImpl } from '@fluencelabs/js-peer/dist/js-peer/compilerS */ export const callFunction = async (rawFnArgs: Array, def: FunctionCallDef, script: string): Promise => { const { args, peer, config } = await extractFunctionArgs(rawFnArgs, def); - return callFunctionImpl(def, script, config || {}, peer, args); + return peer.compilerSupport.callFunction({ + args, + def, + script, + config: config || {}, + }); }; /** @@ -70,8 +71,11 @@ export const callFunction = async (rawFnArgs: Array, def: FunctionCallDef, */ export const registerService = async (args: any[], def: ServiceDef): Promise => { const { peer, service, serviceId } = await extractServiceArgs(args, def.defaultServiceId); - - return registerServiceImpl(peer, def, serviceId, service); + return peer.compilerSupport.registerService({ + def, + service, + serviceId, + }); }; /** diff --git a/packages/client/api/src/compilerSupport/v4.ts b/packages/client/api/src/compilerSupport/v4.ts index 840f2b32..aeb42242 100644 --- a/packages/client/api/src/compilerSupport/v4.ts +++ b/packages/client/api/src/compilerSupport/v4.ts @@ -38,6 +38,4 @@ export { UnlabeledProductType as UnlabeledProductType$$, callFunction as callFunction$$, registerService as registerService$$, - registerServiceImpl as registerServiceImpl$$, - callFunctionImpl as callFunctionImpl$$, } from './v3'; diff --git a/packages/client/api/src/index.ts b/packages/client/api/src/index.ts index d840b4ca..d9fe9b86 100644 --- a/packages/client/api/src/index.ts +++ b/packages/client/api/src/index.ts @@ -1,5 +1,4 @@ -import type { IFluencePeer } from '@fluencelabs/js-peer/dist/interfaces/index.js'; -import type { PeerConfig } from '@fluencelabs/js-peer/dist/interfaces/peerConfig'; +import type { IFluencePeer, PeerConfig } from '@fluencelabs/interface'; const getPeerFromGlobalThis = (): IFluencePeer | undefined => { // @ts-ignore diff --git a/packages/core/interface/package.json b/packages/core/interface/package.json new file mode 100644 index 00000000..52dc2a07 --- /dev/null +++ b/packages/core/interface/package.json @@ -0,0 +1,29 @@ +{ + "name": "@fluencelabs/interface", + "version": "0.1.0", + "description": "Interfaces", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, + "engines": { + "node": ">=10", + "pnpm": ">=3" + }, + "type": "module", + "scripts": { + "build": "tsc" + }, + "repository": "https://github.com/fluencelabs/fluence-js", + "author": "Fluence Labs", + "license": "Apache-2.0", + "dependencies": {}, + "devDependencies": { + "@multiformats/multiaddr": "11.3.0", + "@fluencelabs/avm": "0.35.3" + } +} diff --git a/packages/core/src/js-peer/compilerSupport/interface.ts b/packages/core/interface/src/compilerSupport.ts similarity index 91% rename from packages/core/src/js-peer/compilerSupport/interface.ts rename to packages/core/interface/src/compilerSupport.ts index ce14fe71..01b8361a 100644 --- a/packages/core/src/js-peer/compilerSupport/interface.ts +++ b/packages/core/interface/src/compilerSupport.ts @@ -236,3 +236,23 @@ export interface FnConfig { */ ttl?: number; } + +export const getArgumentTypes = ( + def: FunctionCallDef, +): { + [key: string]: NonArrowType | ArrowWithoutCallbacks; +} => { + if (def.arrow.domain.tag !== 'labeledProduct') { + throw new Error('Should be impossible'); + } + + return def.arrow.domain.fields; +}; + +export const isReturnTypeVoid = (def: FunctionCallDef): boolean => { + if (def.arrow.codomain.tag === 'nil') { + return true; + } + + return def.arrow.codomain.items.length == 0; +}; diff --git a/packages/core/src/interfaces/peerConfig.ts b/packages/core/interface/src/index.ts similarity index 51% rename from packages/core/src/interfaces/peerConfig.ts rename to packages/core/interface/src/index.ts index 5948e2eb..9a5ed25e 100644 --- a/packages/core/src/interfaces/peerConfig.ts +++ b/packages/core/interface/src/index.ts @@ -1,6 +1,48 @@ +import { SecurityTetraplet } from '@fluencelabs/avm'; import type { MultiaddrInput } from '@multiformats/multiaddr'; -import type { PeerIdB58 } from './commonTypes'; -// import { KeyPair } from '../keypair'; +import { FnConfig, FunctionCallDef, ServiceDef } from './compilerSupport'; +export * from './compilerSupport'; + +/** + * Peer ID's id as a base58 string (multihash/CIDv0). + */ +export type PeerIdB58 = string; + +/** + * Additional information about a service call + * @typeparam ArgName + */ +export interface CallParams { + /** + * The identifier of particle which triggered the call + */ + particleId: string; + + /** + * The peer id which created the particle + */ + initPeerId: PeerIdB58; + + /** + * Particle's timestamp when it was created + */ + timestamp: number; + + /** + * Time to live in milliseconds. The time after the particle should be expired + */ + ttl: number; + + /** + * Particle's signature + */ + signature?: string; + + /** + * Security tetraplets + */ + tetraplets: ArgName extends string ? Record : Record; +} /** * Node of the Fluence network specified as a pair of node's multiaddr and it's peer id @@ -104,3 +146,84 @@ export interface PeerConfig { // marineLogLevel?: LogLevel; // }; } + +/** + * Information about Fluence Peer connection. + * Represented as object with the following keys: + * - `isInitialized`: Is the peer initialized or not. + * - `peerId`: Peer Id of the peer. Null if the peer is not initialized + * - `isConnected`: Is the peer connected to network or not + * - `relayPeerId`: Peer Id of the relay the peer is connected to. If the connection is direct relayPeerId is null + * - `isDirect`: True if the peer is connected to the network directly (not through relay) + */ +export type PeerStatus = + | { + isInitialized: false; + peerId: null; + isConnected: false; + relayPeerId: null; + } + | { + isInitialized: true; + peerId: PeerIdB58; + isConnected: false; + relayPeerId: null; + } + | { + isInitialized: true; + peerId: PeerIdB58; + isConnected: true; + relayPeerId: PeerIdB58; + } + | { + isInitialized: true; + peerId: PeerIdB58; + isConnected: true; + isDirect: true; + relayPeerId: null; + }; + +export interface IFluencePeer { + start(config?: PeerConfig): Promise; + stop(): Promise; + getStatus(): PeerStatus; + + // TODO: come up with a working interface for + // - particle creation + // - particle initialization + // - service registration + internals: any; + compilerSupport: { + callFunction: (args: CallFunctionArgs) => Promise; + registerService: (args: RegisterServiceArgs) => void; + }; +} + +export interface CallFunctionArgs { + def: FunctionCallDef; + script: string; + config: FnConfig; + args: { [key: string]: any }; +} + +export interface RegisterServiceArgs { + def: ServiceDef; + serviceId: string | undefined; + service: any; +} + +export const asFluencePeer = (fluencePeerCandidate: unknown): IFluencePeer => { + if (isFluencePeer(fluencePeerCandidate)) { + return fluencePeerCandidate; + } + + throw new Error(''); +}; + +export const isFluencePeer = (fluencePeerCandidate: unknown): fluencePeerCandidate is IFluencePeer => { + if (fluencePeerCandidate && (fluencePeerCandidate as any).__isFluenceAwesome) { + return true; + } + + return false; +}; diff --git a/packages/core/tsconfig.json b/packages/core/interface/tsconfig.json similarity index 80% rename from packages/core/tsconfig.json rename to packages/core/interface/tsconfig.json index 515a1819..eb76f9fe 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/interface/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "./dist", "moduleResolution": "node" diff --git a/packages/core/.gitignore b/packages/core/js-peer/.gitignore similarity index 100% rename from packages/core/.gitignore rename to packages/core/js-peer/.gitignore diff --git a/packages/core/.npmignore b/packages/core/js-peer/.npmignore similarity index 100% rename from packages/core/.npmignore rename to packages/core/js-peer/.npmignore diff --git a/packages/core/.prettierignore b/packages/core/js-peer/.prettierignore similarity index 100% rename from packages/core/.prettierignore rename to packages/core/js-peer/.prettierignore diff --git a/packages/core/CONTRIBUTING.md b/packages/core/js-peer/CONTRIBUTING.md similarity index 100% rename from packages/core/CONTRIBUTING.md rename to packages/core/js-peer/CONTRIBUTING.md diff --git a/packages/core/README.md b/packages/core/js-peer/README.md similarity index 100% rename from packages/core/README.md rename to packages/core/js-peer/README.md diff --git a/packages/core/aqua/node-utils.aqua b/packages/core/js-peer/aqua/node-utils.aqua similarity index 100% rename from packages/core/aqua/node-utils.aqua rename to packages/core/js-peer/aqua/node-utils.aqua diff --git a/packages/core/aqua/services.aqua b/packages/core/js-peer/aqua/services.aqua similarity index 100% rename from packages/core/aqua/services.aqua rename to packages/core/js-peer/aqua/services.aqua diff --git a/packages/core/aqua/single-module-srv.aqua b/packages/core/js-peer/aqua/single-module-srv.aqua similarity index 100% rename from packages/core/aqua/single-module-srv.aqua rename to packages/core/js-peer/aqua/single-module-srv.aqua diff --git a/packages/core/jest.config.cjs b/packages/core/js-peer/jest.config.cjs similarity index 100% rename from packages/core/jest.config.cjs rename to packages/core/js-peer/jest.config.cjs diff --git a/packages/core/package.json b/packages/core/js-peer/package.json similarity index 98% rename from packages/core/package.json rename to packages/core/js-peer/package.json index d97429d7..8ccaed64 100644 --- a/packages/core/package.json +++ b/packages/core/js-peer/package.json @@ -21,6 +21,7 @@ "author": "Fluence Labs", "license": "Apache-2.0", "dependencies": { + "@fluencelabs/interface": "workspace:*", "@fluencelabs/avm": "0.31.10", "@fluencelabs/marine-js": "0.3.44", "multiformats": "11.0.1", @@ -58,7 +59,6 @@ "@fluencelabs/aqua-api": "0.9.1-373", "@fluencelabs/aqua-lib": "0.6.0", "@fluencelabs/fluence-network-environment": "1.0.13", - "@multiformats/multiaddr": "11.3.0", "@types/bs58": "4.0.1", "@types/platform": "1.3.4", "@types/uuid": "8.3.2", diff --git a/packages/core/src/js-peer/__test__/unit/compiler/v3.spec.ts b/packages/core/js-peer/src/compilerSupport/__test__/v3.spec.ts similarity index 98% rename from packages/core/src/js-peer/__test__/unit/compiler/v3.spec.ts rename to packages/core/js-peer/src/compilerSupport/__test__/v3.spec.ts index c21ec1eb..67f42c2a 100644 --- a/packages/core/src/js-peer/__test__/unit/compiler/v3.spec.ts +++ b/packages/core/js-peer/src/compilerSupport/__test__/v3.spec.ts @@ -1,4 +1,4 @@ -import { aqua2ts, ts2aqua } from '../../../compilerSupport/conversions.js'; +import { aqua2ts, ts2aqua } from '../conversions'; const i32 = { tag: 'scalar', name: 'i32' } as const; diff --git a/packages/core/src/js-peer/compilerSupport/callFunction.ts b/packages/core/js-peer/src/compilerSupport/callFunction.ts similarity index 83% rename from packages/core/src/js-peer/compilerSupport/callFunction.ts rename to packages/core/js-peer/src/compilerSupport/callFunction.ts index fac12f90..35d1082e 100644 --- a/packages/core/src/js-peer/compilerSupport/callFunction.ts +++ b/packages/core/js-peer/src/compilerSupport/callFunction.ts @@ -1,5 +1,12 @@ -import { ArrowWithoutCallbacks, FnConfig, FunctionCallDef, NonArrowType } from './interface.js'; -import { IFluencePeer } from '../../interfaces/index'; +import { + ArrowWithoutCallbacks, + FnConfig, + FunctionCallDef, + NonArrowType, + getArgumentTypes, + isReturnTypeVoid, +} from '@fluencelabs/interface'; +import { IFluencePeer } from '@fluencelabs/interface'; import { injectRelayService, @@ -81,23 +88,3 @@ export function callFunctionImpl( return promise; } - -const isReturnTypeVoid = (def: FunctionCallDef): boolean => { - if (def.arrow.codomain.tag === 'nil') { - return true; - } - - return def.arrow.codomain.items.length == 0; -}; - -export const getArgumentTypes = ( - def: FunctionCallDef, -): { - [key: string]: NonArrowType | ArrowWithoutCallbacks; -} => { - if (def.arrow.domain.tag !== 'labeledProduct') { - throw new Error('Should be impossible'); - } - - return def.arrow.domain.fields; -}; diff --git a/packages/core/src/js-peer/compilerSupport/conversions.ts b/packages/core/js-peer/src/compilerSupport/conversions.ts similarity index 97% rename from packages/core/src/js-peer/compilerSupport/conversions.ts rename to packages/core/js-peer/src/compilerSupport/conversions.ts index af296311..d1ddda82 100644 --- a/packages/core/src/js-peer/compilerSupport/conversions.ts +++ b/packages/core/js-peer/src/compilerSupport/conversions.ts @@ -1,7 +1,7 @@ -import { jsonify } from '../utils.js'; +import { jsonify } from '../js-peer/utils.js'; import { match } from 'ts-pattern'; -import { ArrowType, ArrowWithoutCallbacks, NonArrowType } from './interface.js'; -import { CallServiceData } from '../../interfaces/commonTypes.js'; +import { ArrowType, ArrowWithoutCallbacks, NonArrowType } from '@fluencelabs/interface'; +import { CallServiceData } from '../interfaces/commonTypes.js'; /** * Convert value from its representation in aqua language to representation in typescript diff --git a/packages/core/src/js-peer/compilerSupport/registerService.ts b/packages/core/js-peer/src/compilerSupport/registerService.ts similarity index 94% rename from packages/core/src/js-peer/compilerSupport/registerService.ts rename to packages/core/js-peer/src/compilerSupport/registerService.ts index 5a3b9434..75f895af 100644 --- a/packages/core/src/js-peer/compilerSupport/registerService.ts +++ b/packages/core/js-peer/src/compilerSupport/registerService.ts @@ -1,5 +1,5 @@ -import type { IFluencePeer } from '../../interfaces/index'; -import { ServiceDef } from './interface.js'; +import { IFluencePeer } from '@fluencelabs/interface'; +import { ServiceDef } from '@fluencelabs/interface'; import { registerGlobalService, userHandlerService } from './services.js'; export const registerServiceImpl = ( diff --git a/packages/core/src/js-peer/compilerSupport/services.ts b/packages/core/js-peer/src/compilerSupport/services.ts similarity index 94% rename from packages/core/src/js-peer/compilerSupport/services.ts rename to packages/core/js-peer/src/compilerSupport/services.ts index d9490bf0..31a3878a 100644 --- a/packages/core/src/js-peer/compilerSupport/services.ts +++ b/packages/core/js-peer/src/compilerSupport/services.ts @@ -1,12 +1,12 @@ import { SecurityTetraplet } from '@fluencelabs/avm'; import { match } from 'ts-pattern'; -import { Particle } from '../Particle.js'; -import { CallParams, CallServiceData, GenericCallServiceHandler, ResultCodes } from '../../interfaces/commonTypes.js'; -import { IFluencePeer } from '../../interfaces/index'; +import { Particle } from '../js-peer/Particle.js'; +import { CallServiceData, GenericCallServiceHandler, ResultCodes } from '../interfaces/commonTypes.js'; +import { IFluencePeer, CallParams } from '@fluencelabs/interface'; import { aquaArgs2Ts, responseServiceValue2ts, returnType2Aqua, ts2aqua } from './conversions.js'; -import { ArrowWithoutCallbacks, FunctionCallConstants, FunctionCallDef, NonArrowType } from './interface.js'; +import { ArrowWithoutCallbacks, FunctionCallConstants, FunctionCallDef, NonArrowType } from '@fluencelabs/interface'; export interface ServiceDescription { serviceId: string; diff --git a/packages/core/src/connection/index.ts b/packages/core/js-peer/src/connection/index.ts similarity index 97% rename from packages/core/src/connection/index.ts rename to packages/core/js-peer/src/connection/index.ts index cb2f523b..f6eea9a1 100644 --- a/packages/core/src/connection/index.ts +++ b/packages/core/js-peer/src/connection/index.ts @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { FluenceConnection, ParticleHandler, PeerIdB58 } from '../interfaces/index.js'; +import { PeerIdB58 } from '@fluencelabs/interface'; +import { FluenceConnection, ParticleHandler } from '../interfaces/index.js'; import { pipe } from 'it-pipe'; import { encode, decode } from 'it-length-prefixed'; import type { PeerId } from '@libp2p/interface-peer-id'; @@ -82,7 +83,6 @@ export class RelayConnection extends FluenceConnection { connectionEncryption: [noise()], }); - const relayMultiaddr = multiaddr(options.relayAddress); const relayPeerId = relayMultiaddr.getPeerId(); if (relayPeerId === null) { @@ -158,7 +158,6 @@ export class RelayConnection extends FluenceConnection { ); }); - log.debug(`dialing to the node with client's address: ` + this._lib2p2Peer.peerId.toString()); try { diff --git a/packages/core/src/interfaces/commonTypes.ts b/packages/core/js-peer/src/interfaces/commonTypes.ts similarity index 75% rename from packages/core/src/interfaces/commonTypes.ts rename to packages/core/js-peer/src/interfaces/commonTypes.ts index 7857b032..eaf75b16 100644 --- a/packages/core/src/interfaces/commonTypes.ts +++ b/packages/core/js-peer/src/interfaces/commonTypes.ts @@ -14,48 +14,8 @@ * limitations under the License. */ -import { SecurityTetraplet } from '@fluencelabs/avm'; - -/** - * Peer ID's id as a base58 string (multihash/CIDv0). - */ -export type PeerIdB58 = string; - -/** - * Additional information about a service call - * @typeparam ArgName - */ -export interface CallParams { - /** - * The identifier of particle which triggered the call - */ - particleId: string; - - /** - * The peer id which created the particle - */ - initPeerId: PeerIdB58; - - /** - * Particle's timestamp when it was created - */ - timestamp: number; - - /** - * Time to live in milliseconds. The time after the particle should be expired - */ - ttl: number; - - /** - * Particle's signature - */ - signature?: string; - - /** - * Security tetraplets - */ - tetraplets: ArgName extends string ? Record : Record; -} +import type { PeerIdB58 } from '@fluencelabs/interface'; +import type { SecurityTetraplet } from '@fluencelabs/avm'; export enum ResultCodes { success = 0, diff --git a/packages/core/src/interfaces/index.ts b/packages/core/js-peer/src/interfaces/index.ts similarity index 58% rename from packages/core/src/interfaces/index.ts rename to packages/core/js-peer/src/interfaces/index.ts index f23d8a1d..3c8f2d6e 100644 --- a/packages/core/src/interfaces/index.ts +++ b/packages/core/js-peer/src/interfaces/index.ts @@ -14,79 +14,13 @@ * limitations under the License. */ +import type { PeerIdB58 } from '@fluencelabs/interface'; import type { JSONArray, JSONObject, LogLevel } from '@fluencelabs/marine-js/dist/types'; import type { RunParameters, CallResultsArray, InterpreterResult } from '@fluencelabs/avm'; import type { WorkerImplementation } from 'threads/dist/types/master'; -import { PeerConfig } from './peerConfig'; - -export type PeerIdB58 = string; export type ParticleHandler = (particle: string) => void; -/** - * Information about Fluence Peer connection. - * Represented as object with the following keys: - * - `isInitialized`: Is the peer initialized or not. - * - `peerId`: Peer Id of the peer. Null if the peer is not initialized - * - `isConnected`: Is the peer connected to network or not - * - `relayPeerId`: Peer Id of the relay the peer is connected to. If the connection is direct relayPeerId is null - * - `isDirect`: True if the peer is connected to the network directly (not through relay) - */ -export type PeerStatus = - | { - isInitialized: false; - peerId: null; - isConnected: false; - relayPeerId: null; - } - | { - isInitialized: true; - peerId: PeerIdB58; - isConnected: false; - relayPeerId: null; - } - | { - isInitialized: true; - peerId: PeerIdB58; - isConnected: true; - relayPeerId: PeerIdB58; - } - | { - isInitialized: true; - peerId: PeerIdB58; - isConnected: true; - isDirect: true; - relayPeerId: null; - }; - -export interface IFluencePeer { - start(config?: PeerConfig): Promise; - stop(): Promise; - getStatus(): PeerStatus; - - // TODO: come up with a working interface for - // - particle creation - // - particle initialization - // - service registration - internals: any; -} - -export const asFluencePeer = (fluencePeerCandidate: unknown): IFluencePeer => { - if (isFluencePeer(fluencePeerCandidate)) { - return fluencePeerCandidate; - } - - throw new Error(''); -}; - -export const isFluencePeer = (fluencePeerCandidate: unknown): fluencePeerCandidate is IFluencePeer => { - if (fluencePeerCandidate && (fluencePeerCandidate as any).__isFluenceAwesome) { - return true; - } - - return false; -}; - /** * Base class for connectivity layer to Fluence Network */ diff --git a/packages/core/src/js-peer/FluencePeer.ts b/packages/core/js-peer/src/js-peer/FluencePeer.ts similarity index 96% rename from packages/core/src/js-peer/FluencePeer.ts rename to packages/core/js-peer/src/js-peer/FluencePeer.ts index 5dae29b0..b0a7aefa 100644 --- a/packages/core/src/js-peer/FluencePeer.ts +++ b/packages/core/js-peer/src/js-peer/FluencePeer.ts @@ -16,7 +16,7 @@ import 'buffer'; import { RelayConnection } from '../connection/index.js'; -import { FluenceConnection, IAvmRunner, IFluencePeer, IMarine, PeerStatus } from '../interfaces/index.js'; +import { FluenceConnection, IAvmRunner, IMarine } from '../interfaces/index.js'; import { KeyPair } from '../keypair/index.js'; import { CallServiceData, @@ -24,7 +24,16 @@ import { GenericCallServiceHandler, ResultCodes, } from '../interfaces/commonTypes.js'; -import { PeerIdB58 } from '../interfaces/commonTypes.js'; +import { + PeerIdB58, + CallParams, + PeerConfig, + ConnectionOption, + IFluencePeer, + PeerStatus, + CallFunctionArgs, + RegisterServiceArgs, +} from '@fluencelabs/interface'; import { Particle, ParticleExecutionStage, ParticleQueueItem } from './Particle.js'; import { throwIfNotSupported, dataToString, jsonify, isString, ServiceError } from './utils.js'; import { concatMap, filter, pipe, Subject, tap } from 'rxjs'; @@ -39,8 +48,9 @@ import { JSONValue } from '@fluencelabs/avm'; import { LogLevel } from '@fluencelabs/marine-js/dist/types'; import { NodeUtils, Srv } from './builtins/SingleModuleSrv.js'; import { registerNodeUtils } from './_aqua/node-utils.js'; -import { ConnectionOption, PeerConfig } from '../interfaces/peerConfig.js'; import type { MultiaddrInput } from '@multiformats/multiaddr'; +import { callFunctionImpl } from '../compilerSupport/callFunction.js'; +import { registerServiceImpl } from '../compilerSupport/registerService.js'; const DEFAULT_TTL = 7000; @@ -222,6 +232,16 @@ export class FluencePeer implements IFluencePeer { } // internal api + get compilerSupport() { + return { + callFunction: (args: CallFunctionArgs): Promise => { + return callFunctionImpl(args.def, args.script, args.config, this, args.args); + }, + registerService: (args: RegisterServiceArgs): void => { + return registerServiceImpl(this, args.def, args.serviceId, args.service); + }, + }; + } /** * @private Is not intended to be used manually. Subject to change diff --git a/packages/core/src/js-peer/Particle.ts b/packages/core/js-peer/src/js-peer/Particle.ts similarity index 100% rename from packages/core/src/js-peer/Particle.ts rename to packages/core/js-peer/src/js-peer/Particle.ts diff --git a/packages/core/src/js-peer/__test__/connection.ts b/packages/core/js-peer/src/js-peer/__test__/connection.ts similarity index 100% rename from packages/core/src/js-peer/__test__/connection.ts rename to packages/core/js-peer/src/js-peer/__test__/connection.ts diff --git a/packages/core/src/js-peer/__test__/data/greeting-record.wasm b/packages/core/js-peer/src/js-peer/__test__/data/greeting-record.wasm similarity index 100% rename from packages/core/src/js-peer/__test__/data/greeting-record.wasm rename to packages/core/js-peer/src/js-peer/__test__/data/greeting-record.wasm diff --git a/packages/core/src/js-peer/__test__/data/greeting.wasm b/packages/core/js-peer/src/js-peer/__test__/data/greeting.wasm similarity index 100% rename from packages/core/src/js-peer/__test__/data/greeting.wasm rename to packages/core/js-peer/src/js-peer/__test__/data/greeting.wasm diff --git a/packages/core/src/js-peer/__test__/data/marine-js.aqua b/packages/core/js-peer/src/js-peer/__test__/data/marine-js.aqua similarity index 100% rename from packages/core/src/js-peer/__test__/data/marine-js.aqua rename to packages/core/js-peer/src/js-peer/__test__/data/marine-js.aqua diff --git a/packages/core/src/js-peer/__test__/data/sigService.aqua b/packages/core/js-peer/src/js-peer/__test__/data/sigService.aqua similarity index 100% rename from packages/core/src/js-peer/__test__/data/sigService.aqua rename to packages/core/js-peer/src/js-peer/__test__/data/sigService.aqua diff --git a/packages/core/src/js-peer/__test__/data/srv.aqua b/packages/core/js-peer/src/js-peer/__test__/data/srv.aqua similarity index 100% rename from packages/core/src/js-peer/__test__/data/srv.aqua rename to packages/core/js-peer/src/js-peer/__test__/data/srv.aqua diff --git a/packages/core/src/js-peer/__test__/integration/avm.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/integration/avm.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/integration/avm.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/integration/avm.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/integration/jsonBuiltin.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/integration/jsonBuiltin.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/integration/jsonBuiltin.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/integration/jsonBuiltin.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/integration/marine-js.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/integration/marine-js.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/integration/marine-js.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/integration/marine-js.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/integration/peer.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/integration/peer.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/integration/peer.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/integration/peer.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/integration/sigService.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/integration/sigService.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/integration/sigService.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/integration/sigService.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/integration/smokeTest.ts b/packages/core/js-peer/src/js-peer/__test__/integration/smokeTest.ts similarity index 100% rename from packages/core/src/js-peer/__test__/integration/smokeTest.ts rename to packages/core/js-peer/src/js-peer/__test__/integration/smokeTest.ts diff --git a/packages/core/src/js-peer/__test__/integration/srv.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/integration/srv.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/integration/srv.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/integration/srv.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/unit/ast.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/unit/ast.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/unit/ast.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/unit/ast.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/unit/builtInHandler.spec.ts b/packages/core/js-peer/src/js-peer/__test__/unit/builtInHandler.spec.ts similarity index 99% rename from packages/core/src/js-peer/__test__/unit/builtInHandler.spec.ts rename to packages/core/js-peer/src/js-peer/__test__/unit/builtInHandler.spec.ts index da5d5b02..b20a4f11 100644 --- a/packages/core/src/js-peer/__test__/unit/builtInHandler.spec.ts +++ b/packages/core/js-peer/src/js-peer/__test__/unit/builtInHandler.spec.ts @@ -1,5 +1,6 @@ +import { CallParams } from '@fluencelabs/interface'; import { toUint8Array } from 'js-base64'; -import { CallParams, CallServiceData } from '../../../interfaces/commonTypes.js'; +import { CallServiceData } from '../../../interfaces/commonTypes.js'; import { builtInServices } from '../../builtins/common.js'; import { KeyPair } from '../../../keypair/index.js'; import { Sig, defaultSigGuard } from '../../builtins/Sig.js'; diff --git a/packages/core/src/js-peer/__test__/unit/ephemeral.spec.ts.skip b/packages/core/js-peer/src/js-peer/__test__/unit/ephemeral.spec.ts.skip similarity index 100% rename from packages/core/src/js-peer/__test__/unit/ephemeral.spec.ts.skip rename to packages/core/js-peer/src/js-peer/__test__/unit/ephemeral.spec.ts.skip diff --git a/packages/core/src/js-peer/__test__/util.ts b/packages/core/js-peer/src/js-peer/__test__/util.ts similarity index 95% rename from packages/core/src/js-peer/__test__/util.ts rename to packages/core/js-peer/src/js-peer/__test__/util.ts index d55e357c..fd1934f4 100644 --- a/packages/core/src/js-peer/__test__/util.ts +++ b/packages/core/js-peer/src/js-peer/__test__/util.ts @@ -5,8 +5,8 @@ import { FluencePeer, PeerConfig2 as PeerConfig } from '../FluencePeer.js'; import { Particle } from '../Particle.js'; import { MakeServiceCall } from '../utils.js'; import { avmModuleLoader, controlModuleLoader } from '../utilsForNode.js'; -import { ServiceDef } from '../compilerSupport/interface.js'; -import { callFunctionImpl } from '../compilerSupport/callFunction.js'; +import { ServiceDef } from '@fluencelabs/interface'; +import { callFunctionImpl } from '../../compilerSupport/callFunction.js'; import { marineLogFunction } from '../utils.js'; import { MarineBackgroundRunner } from '../../marine/worker/index.js'; diff --git a/packages/core/src/js-peer/_aqua/node-utils.ts b/packages/core/js-peer/src/js-peer/_aqua/node-utils.ts similarity index 95% rename from packages/core/src/js-peer/_aqua/node-utils.ts rename to packages/core/js-peer/src/js-peer/_aqua/node-utils.ts index 947009d0..4ac71800 100644 --- a/packages/core/src/js-peer/_aqua/node-utils.ts +++ b/packages/core/js-peer/src/js-peer/_aqua/node-utils.ts @@ -6,8 +6,8 @@ * Aqua version: 0.7.7-362 * */ -import { CallParams } from '../../interfaces/commonTypes.js'; -import { registerServiceImpl } from '../compilerSupport/registerService.js'; +import { CallParams } from '@fluencelabs/interface'; +import { registerServiceImpl } from '../../compilerSupport/registerService.js'; import { FluencePeer } from '../FluencePeer.js'; // Services diff --git a/packages/core/src/js-peer/_aqua/services.ts b/packages/core/js-peer/src/js-peer/_aqua/services.ts similarity index 97% rename from packages/core/src/js-peer/_aqua/services.ts rename to packages/core/js-peer/src/js-peer/_aqua/services.ts index 58b7097a..9e396893 100644 --- a/packages/core/src/js-peer/_aqua/services.ts +++ b/packages/core/js-peer/src/js-peer/_aqua/services.ts @@ -6,8 +6,8 @@ * Aqua version: 0.7.7-362 * */ -import { CallParams } from '../../interfaces/commonTypes.js'; -import { registerServiceImpl } from '../compilerSupport/registerService.js'; +import { CallParams } from '@fluencelabs/interface'; +import { registerServiceImpl } from '../../compilerSupport/registerService.js'; import { FluencePeer } from '../FluencePeer.js'; // Services diff --git a/packages/core/src/js-peer/_aqua/single-module-srv.ts b/packages/core/js-peer/src/js-peer/_aqua/single-module-srv.ts similarity index 97% rename from packages/core/src/js-peer/_aqua/single-module-srv.ts rename to packages/core/js-peer/src/js-peer/_aqua/single-module-srv.ts index f46a402f..7a2ade1c 100644 --- a/packages/core/src/js-peer/_aqua/single-module-srv.ts +++ b/packages/core/js-peer/src/js-peer/_aqua/single-module-srv.ts @@ -6,8 +6,8 @@ * Aqua version: 0.7.7-362 * */ -import { CallParams } from '../../interfaces/commonTypes.js'; -import { registerServiceImpl } from '../compilerSupport/registerService.js'; +import { CallParams } from '@fluencelabs/interface'; +import { registerServiceImpl } from '../../compilerSupport/registerService.js'; import { FluencePeer } from '../FluencePeer.js'; // Services diff --git a/packages/core/src/js-peer/avm.ts b/packages/core/js-peer/src/js-peer/avm.ts similarity index 100% rename from packages/core/src/js-peer/avm.ts rename to packages/core/js-peer/src/js-peer/avm.ts diff --git a/packages/core/src/js-peer/builtins/Sig.ts b/packages/core/js-peer/src/js-peer/builtins/Sig.ts similarity index 96% rename from packages/core/src/js-peer/builtins/Sig.ts rename to packages/core/js-peer/src/js-peer/builtins/Sig.ts index 7742b4d7..a989ed49 100644 --- a/packages/core/src/js-peer/builtins/Sig.ts +++ b/packages/core/js-peer/src/js-peer/builtins/Sig.ts @@ -1,4 +1,4 @@ -import { CallParams, PeerIdB58 } from '../../interfaces/commonTypes.js'; +import { CallParams, PeerIdB58 } from '@fluencelabs/interface'; import { KeyPair } from '../../keypair/index.js'; import { SigDef } from '../_aqua/services.js'; import { allowOnlyParticleOriginatedAt, allowServiceFn, and, or, SecurityGuard } from './securityGuard.js'; diff --git a/packages/core/src/js-peer/builtins/SingleModuleSrv.ts b/packages/core/js-peer/src/js-peer/builtins/SingleModuleSrv.ts similarity index 98% rename from packages/core/src/js-peer/builtins/SingleModuleSrv.ts rename to packages/core/js-peer/src/js-peer/builtins/SingleModuleSrv.ts index ac75ef07..f7ad88e6 100644 --- a/packages/core/src/js-peer/builtins/SingleModuleSrv.ts +++ b/packages/core/js-peer/src/js-peer/builtins/SingleModuleSrv.ts @@ -2,7 +2,7 @@ import { v4 as uuidv4 } from 'uuid'; import { SrvDef } from '../_aqua/single-module-srv.js'; import { NodeUtilsDef } from '../_aqua/node-utils.js'; import { FluencePeer } from '../FluencePeer.js'; -import { CallParams } from '../../interfaces/commonTypes.js'; +import { CallParams } from '@fluencelabs/interface'; import { Buffer } from 'buffer'; import { allowOnlyParticleOriginatedAt, SecurityGuard } from './securityGuard.js'; diff --git a/packages/core/src/js-peer/builtins/common.ts b/packages/core/js-peer/src/js-peer/builtins/common.ts similarity index 100% rename from packages/core/src/js-peer/builtins/common.ts rename to packages/core/js-peer/src/js-peer/builtins/common.ts diff --git a/packages/core/src/js-peer/builtins/securityGuard.ts b/packages/core/js-peer/src/js-peer/builtins/securityGuard.ts similarity index 96% rename from packages/core/src/js-peer/builtins/securityGuard.ts rename to packages/core/js-peer/src/js-peer/builtins/securityGuard.ts index 51f0d094..6a26fe0a 100644 --- a/packages/core/src/js-peer/builtins/securityGuard.ts +++ b/packages/core/js-peer/src/js-peer/builtins/securityGuard.ts @@ -1,5 +1,5 @@ import { SecurityTetraplet } from '@fluencelabs/avm'; -import { CallParams, PeerIdB58 } from '../../interfaces/commonTypes.js'; +import { CallParams, PeerIdB58 } from '@fluencelabs/interface'; type ArgName = string | null; diff --git a/packages/core/src/js-peer/ephemeral.ts b/packages/core/js-peer/src/js-peer/ephemeral.ts similarity index 99% rename from packages/core/src/js-peer/ephemeral.ts rename to packages/core/js-peer/src/js-peer/ephemeral.ts index a5161df1..70486958 100644 --- a/packages/core/src/js-peer/ephemeral.ts +++ b/packages/core/js-peer/src/js-peer/ephemeral.ts @@ -1,6 +1,6 @@ +import { PeerIdB58 } from '@fluencelabs/interface'; import { FluenceConnection, ParticleHandler } from '../interfaces/index.js'; import { keyPairFromBase64Sk } from '../keypair/index.js'; -import { PeerIdB58 } from '../interfaces/commonTypes.js'; import { FluencePeer } from './FluencePeer.js'; import { MarineBackgroundRunner } from '../marine/worker/index.js'; import { avmModuleLoader, controlModuleLoader } from './utilsForNode'; diff --git a/packages/core/src/js-peer/utils.ts b/packages/core/js-peer/src/js-peer/utils.ts similarity index 100% rename from packages/core/src/js-peer/utils.ts rename to packages/core/js-peer/src/js-peer/utils.ts diff --git a/packages/core/src/js-peer/utilsForNode.ts b/packages/core/js-peer/src/js-peer/utilsForNode.ts similarity index 100% rename from packages/core/src/js-peer/utilsForNode.ts rename to packages/core/js-peer/src/js-peer/utilsForNode.ts diff --git a/packages/core/src/keypair/__test__/KeyPair.spec.ts b/packages/core/js-peer/src/keypair/__test__/KeyPair.spec.ts similarity index 100% rename from packages/core/src/keypair/__test__/KeyPair.spec.ts rename to packages/core/js-peer/src/keypair/__test__/KeyPair.spec.ts diff --git a/packages/core/src/keypair/index.ts b/packages/core/js-peer/src/keypair/index.ts similarity index 100% rename from packages/core/src/keypair/index.ts rename to packages/core/js-peer/src/keypair/index.ts diff --git a/packages/core/src/marine/deps-loader/common.ts b/packages/core/js-peer/src/marine/deps-loader/common.ts similarity index 100% rename from packages/core/src/marine/deps-loader/common.ts rename to packages/core/js-peer/src/marine/deps-loader/common.ts diff --git a/packages/core/src/marine/deps-loader/node.ts b/packages/core/js-peer/src/marine/deps-loader/node.ts similarity index 100% rename from packages/core/src/marine/deps-loader/node.ts rename to packages/core/js-peer/src/marine/deps-loader/node.ts diff --git a/packages/core/src/marine/deps-loader/web.ts b/packages/core/js-peer/src/marine/deps-loader/web.ts similarity index 100% rename from packages/core/src/marine/deps-loader/web.ts rename to packages/core/js-peer/src/marine/deps-loader/web.ts diff --git a/packages/core/src/marine/worker-script/index.ts b/packages/core/js-peer/src/marine/worker-script/index.ts similarity index 100% rename from packages/core/src/marine/worker-script/index.ts rename to packages/core/js-peer/src/marine/worker-script/index.ts diff --git a/packages/core/src/marine/worker/index.ts b/packages/core/js-peer/src/marine/worker/index.ts similarity index 100% rename from packages/core/src/marine/worker/index.ts rename to packages/core/js-peer/src/marine/worker/index.ts diff --git a/packages/core/js-peer/tsconfig.json b/packages/core/js-peer/tsconfig.json new file mode 100644 index 00000000..eb76f9fe --- /dev/null +++ b/packages/core/js-peer/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "moduleResolution": "node" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a157551..00767858 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,22 +18,24 @@ importers: specifiers: '@fluencelabs/aqua': 0.9.1-374 '@fluencelabs/fluence-network-environment': 1.0.13 + '@fluencelabs/interface': workspace:* '@fluencelabs/js-client.api': workspace:* '@fluencelabs/js-peer': workspace:* http-server: 14.1.1 dependencies: '@fluencelabs/fluence-network-environment': 1.0.13 + '@fluencelabs/interface': link:../../core/interface '@fluencelabs/js-client.api': link:../../client/api devDependencies: '@fluencelabs/aqua': 0.9.1-374_4kllvqvlnb5b3k2borritadfgq - '@fluencelabs/js-peer': link:../../core + '@fluencelabs/js-peer': link:../../core/js-peer http-server: 14.1.1 packages/client/api: specifiers: - '@fluencelabs/js-peer': workspace:* - devDependencies: - '@fluencelabs/js-peer': link:../../core + '@fluencelabs/interface': workspace:* + dependencies: + '@fluencelabs/interface': link:../../core/interface packages/client/js-client.web.standalone: specifiers: @@ -52,7 +54,7 @@ importers: vite-plugin-replace: 0.1.1 vite-tsconfig-paths: 4.0.3 dependencies: - '@fluencelabs/js-peer': link:../../core + '@fluencelabs/js-peer': link:../../core/js-peer buffer: 6.0.3 process: 0.11.10 devDependencies: @@ -74,7 +76,15 @@ importers: devDependencies: '@types/node': 16.11.59 - packages/core: + packages/core/interface: + specifiers: + '@fluencelabs/avm': 0.35.3 + '@multiformats/multiaddr': 11.3.0 + devDependencies: + '@fluencelabs/avm': 0.35.3 + '@multiformats/multiaddr': 11.3.0 + + packages/core/js-peer: specifiers: '@chainsafe/libp2p-noise': 11.0.0 '@fluencelabs/aqua': 0.7.7-362 @@ -82,6 +92,7 @@ importers: '@fluencelabs/aqua-lib': 0.6.0 '@fluencelabs/avm': 0.31.10 '@fluencelabs/fluence-network-environment': 1.0.13 + '@fluencelabs/interface': workspace:* '@fluencelabs/marine-js': 0.3.44 '@libp2p/crypto': 1.0.8 '@libp2p/interface-connection': 3.0.8 @@ -120,6 +131,7 @@ importers: dependencies: '@chainsafe/libp2p-noise': 11.0.0 '@fluencelabs/avm': 0.31.10 + '@fluencelabs/interface': link:../interface '@fluencelabs/marine-js': 0.3.44 '@libp2p/crypto': 1.0.8_uint8arraylist@2.4.3 '@libp2p/interface-connection': 3.0.8 @@ -545,13 +557,12 @@ packages: /@chainsafe/is-ip/2.0.1: resolution: {integrity: sha512-nqSJ8u2a1Rv9FYbyI8qpDhTYujaKEyLknNrTejLYoSWmdeg+2WB7R6BZqPZYfrJzDxVi3rl6ZQuoaEvpKRZWgQ==} - dev: false /@chainsafe/libp2p-noise/11.0.0: resolution: {integrity: sha512-NEl5aIv6muz9OL+dsa3INEU89JX0NViBxOy7NwwG8eNRPUDHo5E3ZTMSHXQpVx1K/ofoNS4ANO9xwezY6ss5GA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: - '@libp2p/crypto': 1.0.8_uint8arraylist@2.4.3 + '@libp2p/crypto': 1.0.11_uint8arraylist@2.4.3 '@libp2p/interface-connection-encrypter': 3.0.6 '@libp2p/interface-keys': 1.0.7 '@libp2p/interface-metrics': 4.0.5 @@ -2052,7 +2063,7 @@ packages: resolution: {integrity: sha512-CRJmqwNQhDC51sQ9lf6EqEY8HuywwymMVffL2kIYI5ts5k+6gvIXzoSxLf3V3o+OxcroXG4KG0uGxxAi5DUXSA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: - '@libp2p/crypto': 1.0.8_uint8arraylist@2.4.3 + '@libp2p/crypto': 1.0.11_uint8arraylist@2.4.3 '@libp2p/interface-keys': 1.0.7 '@libp2p/interface-peer-id': 2.0.1 '@libp2p/peer-id': 2.0.1 @@ -2214,7 +2225,6 @@ packages: varint: 6.0.0 transitivePeerDependencies: - supports-color - dev: false /@noble/ed25519/1.7.1: resolution: {integrity: sha512-Rk4SkJFaXZiznFyC/t77Q0NKS4FL7TLJJsVG2V2oiEq3kJVeTdxysEe/yRWSpnWMe808XRDJ+VFh5pt/FN5plw==} @@ -3084,7 +3094,6 @@ packages: engines: {node: '>=10.16.0'} dependencies: streamsearch: 1.1.0 - dev: false /byte-access/1.0.1: resolution: {integrity: sha512-GKYa+lvxnzhgHWj9X+LCsQ4s2/C5uvib573eAOiQKywXMkzFFErY2+yQdzmdE5iWVpmqecsRx3bOtOY4/1eINw==} @@ -3433,7 +3442,6 @@ packages: undici: 5.16.0 transitivePeerDependencies: - supports-color - dev: false /domexception/2.0.1: resolution: {integrity: sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==} @@ -6409,7 +6417,7 @@ packages: engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: '@achingbrain/nat-port-mapper': 1.0.7 - '@libp2p/crypto': 1.0.8_uint8arraylist@2.4.3 + '@libp2p/crypto': 1.0.11_uint8arraylist@2.4.3 '@libp2p/interface-address-manager': 2.0.4 '@libp2p/interface-connection': 3.0.8 '@libp2p/interface-connection-encrypter': 3.0.6 @@ -6739,7 +6747,6 @@ packages: /multiformats/11.0.1: resolution: {integrity: sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dev: false /multiformats/9.6.5: resolution: {integrity: sha512-vMwf/FUO+qAPvl3vlSZEgEVFY/AxeZq5yg761ScF3CZsXgmTi/HGkicUiNN0CI4PW8FiY2P0OLklOcmQjdQJhw==} @@ -6866,7 +6873,6 @@ packages: undici: '*' dependencies: undici: 5.16.0 - dev: false /natural-compare/1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -7704,7 +7710,6 @@ packages: /streamsearch/1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} - dev: false /string-length/4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} @@ -8160,14 +8165,12 @@ packages: engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: multiformats: 11.0.1 - dev: false /undici/5.16.0: resolution: {integrity: sha512-KWBOXNv6VX+oJQhchXieUznEmnJMqgXMbs0xxH2t8q/FUAWSJvOSr/rMaZKnX5RIVq7JDn0JbP4BOnKG2SGXLQ==} engines: {node: '>=12.18'} dependencies: busboy: 1.6.0 - dev: false /union/0.5.0: resolution: {integrity: sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==}