Compare commits

...

3 Commits

4 changed files with 8 additions and 6 deletions

View File

@ -1,3 +1,5 @@
# [0.1.0-develop.10](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.1.0-develop.9...v0.1.0-develop.10) (2023-09-09)
# [0.1.0-develop.9](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.1.0-develop.8...v0.1.0-develop.9) (2023-09-03) # [0.1.0-develop.9](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.1.0-develop.8...v0.1.0-develop.9) (2023-09-03)
# [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-09-02) # [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-09-02)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/kernel-swarm-client", "name": "@lumeweb/kernel-swarm-client",
"version": "0.1.0-develop.9", "version": "0.1.0-develop.10",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/kernel-swarm-client", "name": "@lumeweb/kernel-swarm-client",
"version": "0.1.0-develop.9", "version": "0.1.0-develop.10",
"dependencies": { "dependencies": {
"@lumeweb/libkernel": "^0.1.0-develop.38", "@lumeweb/libkernel": "^0.1.0-develop.38",
"async-mutex": "^0.4.0", "async-mutex": "^0.4.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/kernel-swarm-client", "name": "@lumeweb/kernel-swarm-client",
"version": "0.1.0-develop.9", "version": "0.1.0-develop.10",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

@ -1,6 +1,7 @@
import { Buffer } from "buffer"; import { Buffer } from "buffer";
import { Client, factory } from "@lumeweb/libkernel/module"; import { Client, factory } from "@lumeweb/libkernel/module";
import { DataFn, ErrTuple, hexToBuf, logErr } from "@lumeweb/libkernel"; import { DataFn, ErrTuple, logErr } from "@lumeweb/libkernel";
import { hexToBytes } from "@lumeweb/libweb";
import { blake2b } from "@noble/hashes/blake2b"; import { blake2b } from "@noble/hashes/blake2b";
import b4a from "b4a"; import b4a from "b4a";
@ -54,8 +55,7 @@ export class SwarmClient extends Client {
public async connect(pubkey: string | Uint8Array): Promise<Socket> { public async connect(pubkey: string | Uint8Array): Promise<Socket> {
if (typeof pubkey === "string") { if (typeof pubkey === "string") {
const buf = hexToBuf(pubkey); pubkey = hexToBytes(pubkey);
pubkey = this.handleErrorOrReturn(buf);
} }
let existing = Array.from(this._sockets.values()).filter((socket) => { let existing = Array.from(this._sockets.values()).filter((socket) => {