2023-08-31 07:49:01 +00:00
|
|
|
import { S5Node } from "#node.js";
|
2023-09-01 13:24:50 +00:00
|
|
|
import type { SignedRegistryEntry } from "#types.js";
|
2023-08-31 11:22:16 +00:00
|
|
|
import { ed25519 } from "@noble/curves/ed25519";
|
|
|
|
import KeyPairEd25519 from "#ed25519.js";
|
2023-08-31 15:02:17 +00:00
|
|
|
import { S5NodeConfig } from "./types.js";
|
2023-08-31 15:10:15 +00:00
|
|
|
import NodeId from "#nodeId.js";
|
2023-08-31 07:49:01 +00:00
|
|
|
|
2023-08-31 06:37:32 +00:00
|
|
|
export * from "./types.js";
|
2023-09-01 07:18:37 +00:00
|
|
|
export * from "./constants.js";
|
2023-09-01 11:28:21 +00:00
|
|
|
export type { S5Node } from "./node.js";
|
2023-08-31 09:04:33 +00:00
|
|
|
export {
|
|
|
|
createTransportSocket,
|
|
|
|
isTransport,
|
|
|
|
createTransportPeer,
|
2023-08-31 21:32:37 +00:00
|
|
|
BasePeer,
|
2023-08-31 09:04:33 +00:00
|
|
|
} from "./transports/index.js";
|
2023-08-31 15:02:17 +00:00
|
|
|
export type { SignedRegistryEntry };
|
2023-08-31 15:10:15 +00:00
|
|
|
export { NodeId };
|
2023-08-31 07:49:01 +00:00
|
|
|
|
|
|
|
export function createNode(config: S5NodeConfig) {
|
|
|
|
return new S5Node(config);
|
|
|
|
}
|
2023-08-31 11:22:16 +00:00
|
|
|
|
|
|
|
export function createKeyPair(privateKey?: Uint8Array) {
|
|
|
|
return new KeyPairEd25519(privateKey ?? ed25519.utils.randomPrivateKey());
|
|
|
|
}
|