@hiveio/dhive 1.2.4 → 1.2.6-rc.0

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.
package/dist/dhive.d.ts CHANGED
@@ -567,6 +567,9 @@ declare module 'dhive/chain/serializer' {
567
567
  Binary: (size?: number | undefined) => (buffer: ByteBuffer, data: HexBuffer | Buffer) => void;
568
568
  Boolean: (buffer: ByteBuffer, data: boolean) => void;
569
569
  Date: (buffer: ByteBuffer, data: string) => void;
570
+ EncryptedMemo: (buffer: ByteBuffer, data: {
571
+ [key: string]: any;
572
+ }) => void;
570
573
  FlatMap: (keySerializer: Serializer, valueSerializer: Serializer) => (buffer: ByteBuffer, data: [any, any][]) => void;
571
574
  Int16: (buffer: ByteBuffer, data: number) => void;
572
575
  Int32: (buffer: ByteBuffer, data: number) => void;
@@ -684,6 +687,7 @@ declare module 'dhive/crypto' {
684
687
  * in the design, construction, operation or maintenance of any military facility.
685
688
  */
686
689
  /// <reference types="node" />
690
+ import * as ByteBuffer from 'bytebuffer';
687
691
  import { SignedTransaction, Transaction } from 'dhive/chain/transaction';
688
692
  /**
689
693
  * Network id used in WIF-encoding.
@@ -693,9 +697,13 @@ declare module 'dhive/crypto' {
693
697
  * ECDSA (secp256k1) public key.
694
698
  */
695
699
  export class PublicKey {
696
- readonly key: Buffer;
700
+ readonly key: any;
697
701
  readonly prefix: string;
698
- constructor(key: Buffer, prefix?: string);
702
+ readonly uncompressed: Buffer;
703
+ constructor(key: any, prefix?: string);
704
+ static fromBuffer(key: ByteBuffer): {
705
+ key: ByteBuffer;
706
+ };
699
707
  /**
700
708
  * Create a new instance from a WIF-encoded key.
701
709
  */
@@ -729,6 +737,7 @@ declare module 'dhive/crypto' {
729
737
  */
730
738
  export class PrivateKey {
731
739
  private key;
740
+ secret: Buffer;
732
741
  constructor(key: Buffer);
733
742
  /**
734
743
  * Convenience to create a new instance from WIF string or buffer.
@@ -746,6 +755,7 @@ declare module 'dhive/crypto' {
746
755
  * Create key from username and password.
747
756
  */
748
757
  static fromLogin(username: string, password: string, role?: KeyRole): PrivateKey;
758
+ multiply(pub: any): Buffer;
749
759
  /**
750
760
  * Sign message.
751
761
  * @param message 32-byte message.
@@ -764,6 +774,10 @@ declare module 'dhive/crypto' {
764
774
  * to get the full encoded key you need to explicitly call {@link toString}.
765
775
  */
766
776
  inspect(): string;
777
+ /**
778
+ * Get shared secret for memo cryptography
779
+ */
780
+ get_shared_secret(public_key: PublicKey): Buffer;
767
781
  }
768
782
  /**
769
783
  * ECDSA (secp256k1) signature.
@@ -1895,7 +1909,7 @@ declare module 'dhive/utils' {
1895
1909
  hbd_interest_rate?: number;
1896
1910
  url?: string;
1897
1911
  }
1898
- export function buildWitnessUpdateOp(owner: string, props: WitnessProps): WitnessSetPropertiesOperation;
1912
+ export const buildWitnessUpdateOp: (owner: string, props: WitnessProps) => WitnessSetPropertiesOperation;
1899
1913
  export const operationOrders: {
1900
1914
  vote: number;
1901
1915
  comment: number;
@@ -2923,6 +2937,29 @@ declare module 'dhive/client' {
2923
2937
  updateOperations(rebrandedApi: any): void;
2924
2938
  }
2925
2939
 
2940
+ }
2941
+ declare module 'dhive/chain/deserializer' {
2942
+ import * as ByteBuffer from 'bytebuffer';
2943
+ export type Deserializer = (buffer: ByteBuffer) => void;
2944
+ export const types: {
2945
+ EncryptedMemoD: any;
2946
+ };
2947
+
2948
+ }
2949
+ declare module 'dhive/helpers/aes' {
2950
+ /// <reference types="node" />
2951
+ import { PrivateKey, PublicKey } from 'dhive/crypto';
2952
+ export const encrypt: (private_key: PrivateKey, public_key: PublicKey, message: Buffer, nonce?: string) => any;
2953
+ export const decrypt: (private_key: PrivateKey, public_key: PublicKey, nonce: any, message: any, checksum: number) => any;
2954
+
2955
+ }
2956
+ declare module 'dhive/memo' {
2957
+ import { PrivateKey, PublicKey } from 'dhive/crypto';
2958
+ export const Memo: {
2959
+ decode: (private_key: string | PrivateKey, memo: string) => string;
2960
+ encode: (private_key: string | PrivateKey, public_key: string | PublicKey, memo: string, testNonce?: string | undefined) => string;
2961
+ };
2962
+
2926
2963
  }
2927
2964
  declare module 'dhive' {
2928
2965
  /**
@@ -2974,8 +3011,10 @@ declare module 'dhive' {
2974
3011
  export * from 'dhive/chain/operation';
2975
3012
  export * from 'dhive/chain/serializer';
2976
3013
  export * from 'dhive/chain/transaction';
3014
+ export * from 'dhive/chain/hivemind';
2977
3015
  export * from 'dhive/client';
2978
3016
  export * from 'dhive/crypto';
3017
+ export * from 'dhive/memo';
2979
3018
 
2980
3019
  }
2981
3020
  declare module 'dhive/index-browser' {