@hiveio/dhive 1.2.5 → 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
@@ -517,7 +517,6 @@ declare module 'dhive/chain/misc' {
517
517
 
518
518
  }
519
519
  declare module 'dhive/chain/serializer' {
520
- /// <reference types="node" />
521
520
  /**
522
521
  * @file Hive protocol serialization.
523
522
  * @author Johan Nordberg <code@johan-nordberg.com>
@@ -552,6 +551,7 @@ declare module 'dhive/chain/serializer' {
552
551
  * You acknowledge that this software is not designed, licensed or intended for use
553
552
  * in the design, construction, operation or maintenance of any military facility.
554
553
  */
554
+ /// <reference types="node" />
555
555
  import * as ByteBuffer from 'bytebuffer';
556
556
  import { PublicKey } from 'dhive/crypto';
557
557
  import { Asset } from 'dhive/chain/asset';
@@ -593,7 +593,7 @@ declare module 'dhive/chain/serializer' {
593
593
  UInt32: (buffer: ByteBuffer, data: number) => void;
594
594
  UInt64: (buffer: ByteBuffer, data: number) => void;
595
595
  UInt8: (buffer: ByteBuffer, data: number) => void;
596
- Void: () => never;
596
+ Void: (buffer: ByteBuffer) => never;
597
597
  };
598
598
 
599
599
  }
@@ -2939,50 +2939,26 @@ declare module 'dhive/client' {
2939
2939
 
2940
2940
  }
2941
2941
  declare module 'dhive/chain/deserializer' {
2942
- /// <reference types="node" />
2943
2942
  import * as ByteBuffer from 'bytebuffer';
2944
2943
  export type Deserializer = (buffer: ByteBuffer) => void;
2945
2944
  export const types: {
2946
- EncryptedMemoD: (buf: Buffer | ByteBuffer) => {};
2945
+ EncryptedMemoD: any;
2947
2946
  };
2948
2947
 
2949
2948
  }
2950
2949
  declare module 'dhive/helpers/aes' {
2950
+ /// <reference types="node" />
2951
2951
  import { PrivateKey, PublicKey } from 'dhive/crypto';
2952
- /**
2953
- * Spec: http://peakd.com/steem/@dantheman/how-to-encrypt-a-memo-when-transferring-steem
2954
- * @throws {Error|TypeError} - "Invalid Key, ..."
2955
- * @param {PrivateKey} private_key - required and used for decryption
2956
- * @param {PublicKey} public_key - required and used to calcualte the shared secret
2957
- * @param message - message to be encrypted
2958
- * @param {string} [nonce = uniqueNonce()] - assigned a random unique uint64
2959
- *
2960
- * @return {object}
2961
- * @property {string} nonce - random or unique uint64, provides entropy when re-using the same private/public keys.
2962
- * @property {Buffer} message - Plain text message
2963
- * @property {number} checksum - shared secret checksum
2964
- */
2965
- export function encrypt(private_key: PrivateKey, public_key: PublicKey, message: any, nonce: any): any;
2966
- /**
2967
- * Spec: http://peakd.com/steem/@dantheman/how-to-encrypt-a-memo-when-transferring-steem
2968
- * @arg {PrivateKey} private_key - required and used for decryption
2969
- * @arg {PublicKey} public_key - required and used to calcualte the shared secret
2970
- * @arg {string} nonce - random or unique uint64, provides entropy when re-using the same private/public keys.
2971
- * @arg {Buffer} message - Encrypted or plain text message
2972
- * @arg {number} checksum - shared secret checksum
2973
- * @throws {Error|TypeError} - "Invalid Key, ..."
2974
- * @return {Buffer} - message
2975
- */
2976
- export function decrypt(private_key: PrivateKey, public_key: PublicKey, nonce: any, message: any, checksum: number): string;
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;
2977
2954
 
2978
2955
  }
2979
2956
  declare module 'dhive/memo' {
2980
- import { PrivateKey, PublicKey } from 'dhive/crypto'; function encode(private_key: PrivateKey | string, public_key: PublicKey | string, memo: string, testNonce?: number): string; function decode(private_key: PrivateKey | string, memo: any): any;
2957
+ import { PrivateKey, PublicKey } from 'dhive/crypto';
2981
2958
  export const Memo: {
2982
- decode: typeof decode;
2983
- encode: typeof encode;
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;
2984
2961
  };
2985
- export {};
2986
2962
 
2987
2963
  }
2988
2964
  declare module 'dhive' {
@@ -3034,7 +3010,6 @@ declare module 'dhive' {
3034
3010
  export * from 'dhive/chain/misc';
3035
3011
  export * from 'dhive/chain/operation';
3036
3012
  export * from 'dhive/chain/serializer';
3037
- export * from 'dhive/chain/deserializer';
3038
3013
  export * from 'dhive/chain/transaction';
3039
3014
  export * from 'dhive/chain/hivemind';
3040
3015
  export * from 'dhive/client';