@leofcoin/peernet 1.1.55 → 1.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/exports/browser/browser-store.js +4 -3
  2. package/exports/browser/identity.d.ts +7 -4
  3. package/exports/browser/{index-ba1b3977.js → index-329e0324.js} +1 -1
  4. package/exports/browser/messages/chat.d.ts +1 -1
  5. package/exports/browser/messages/data-response.d.ts +1 -1
  6. package/exports/browser/messages/dht-response.d.ts +1 -1
  7. package/exports/browser/messages/dht.d.ts +1 -1
  8. package/exports/browser/messages/peer-response.d.ts +1 -1
  9. package/exports/browser/messages/peer.d.ts +1 -1
  10. package/exports/browser/messages/peernet.d.ts +1 -1
  11. package/exports/browser/messages/ps.d.ts +1 -1
  12. package/exports/browser/messages/request.d.ts +1 -1
  13. package/exports/browser/messages/response.d.ts +1 -1
  14. package/exports/browser/{messages-dd1ad11c.js → messages-000b7f84.js} +1 -1
  15. package/exports/browser/{peernet-d5023a29.js → peernet-bfbe6fff.js} +943 -884
  16. package/exports/browser/peernet.d.ts +32 -14
  17. package/exports/browser/peernet.js +1 -1
  18. package/exports/peernet.js +26 -12
  19. package/exports/store.js +11 -9
  20. package/exports/types/identity.d.ts +7 -4
  21. package/exports/types/messages/chat.d.ts +1 -1
  22. package/exports/types/messages/data-response.d.ts +1 -1
  23. package/exports/types/messages/dht-response.d.ts +1 -1
  24. package/exports/types/messages/dht.d.ts +1 -1
  25. package/exports/types/messages/peer-response.d.ts +1 -1
  26. package/exports/types/messages/peer.d.ts +1 -1
  27. package/exports/types/messages/peernet.d.ts +1 -1
  28. package/exports/types/messages/ps.d.ts +1 -1
  29. package/exports/types/messages/request.d.ts +1 -1
  30. package/exports/types/messages/response.d.ts +1 -1
  31. package/exports/types/peernet.d.ts +32 -14
  32. package/package.json +4 -3
  33. package/src/identity.ts +21 -10
  34. package/src/peernet.ts +26 -3
  35. package/tsconfig.json +1 -1
@@ -331,13 +331,14 @@ class BrowerStore {
331
331
  });
332
332
  }
333
333
  toKeyPath(key) {
334
- if (!key.isKeyPath())
334
+ if (key instanceof KeyPath)
335
335
  key = new KeyPath(key);
336
- return key.toString('base32');
336
+ return key.toString();
337
337
  }
338
338
  toKeyValue(value) {
339
- if (!value.isKeyValue())
339
+ if (value instanceof KeyValue)
340
340
  value = new KeyValue(value);
341
+ // @ts-ignore
341
342
  return value.uint8Array;
342
343
  }
343
344
  async get(key) {
@@ -1,15 +1,18 @@
1
- import MultiWallet from '@leofcoin/multi-wallet';
2
1
  export default class Identity {
3
2
  #private;
4
- network: MultiWallet.network;
3
+ network: any;
5
4
  id: string;
5
+ selectedAccount: string;
6
6
  constructor(network: string);
7
7
  get accounts(): Promise<[[name: string, externalAddress: string, internalAddress: string]]>;
8
8
  getAccounts(): Promise<[[name: string, externalAddress: string, internalAddress: string]]>;
9
9
  load(password?: string): Promise<void>;
10
+ selectAccount(account: string): Promise<void> | Promise<IDBValidKey> | Promise<any[]>;
10
11
  sign(hash: Uint8Array): any;
11
- export(password: string): Promise<string>;
12
+ lock(password: string): void;
13
+ unlock(password: string): void;
14
+ export(password: string): Promise<any>;
12
15
  import(password: any, encrypted: base58String): Promise<void>;
13
- exportQR(password: string): Promise<any>;
16
+ exportQR(password: string): Promise<string>;
14
17
  importQR(image: File | Blob, password: string): Promise<void>;
15
18
  }
@@ -1,4 +1,4 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './peernet-d5023a29.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './peernet-bfbe6fff.js';
2
2
  import './value-4e80eeeb.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- declare const ChatMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const ChatMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class ChatMessage extends ChatMessage_base {
3
3
  constructor(buffer: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const DataMessageResponse_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const DataMessageResponse_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class DataMessageResponse extends DataMessageResponse_base {
3
3
  constructor(data: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const DHTMessageResponse_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const DHTMessageResponse_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class DHTMessageResponse extends DHTMessageResponse_base {
3
3
  constructor(data: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const DHTMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const DHTMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  /**
3
3
  * @example `
4
4
  new DHTMessage(hash, store)
@@ -1,4 +1,4 @@
1
- declare const PeerMessageResponse_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const PeerMessageResponse_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class PeerMessageResponse extends PeerMessageResponse_base {
3
3
  constructor(data: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const PeerMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const PeerMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class PeerMessage extends PeerMessage_base {
3
3
  constructor(data: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const PeernetMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const PeernetMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class PeernetMessage extends PeernetMessage_base {
3
3
  constructor(buffer: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const PsMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const PsMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class PsMessage extends PsMessage_base {
3
3
  constructor(buffer: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const RequestMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const RequestMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class RequestMessage extends RequestMessage_base {
3
3
  constructor(data: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- declare const ResponseMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/dist/codec-format-interface.js").default;
1
+ declare const ResponseMessage_base: typeof import("../../node_modules/@leofcoin/codec-format-interface/exports/codec-format-interface.js").default;
2
2
  export default class ResponseMessage extends ResponseMessage_base {
3
3
  constructor(data: any);
4
4
  get messageName(): string;
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './peernet-d5023a29.js';
1
+ import { F as FormatInterface } from './peernet-bfbe6fff.js';
2
2
  import './value-4e80eeeb.js';
3
3
 
4
4
  var proto$b = {