@hiveio/dhive 1.0.0 → 1.2.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
@@ -787,13 +787,13 @@ declare module 'dhive/crypto' {
787
787
  doubleSha256: typeof doubleSha256;
788
788
  encodePrivate: typeof encodePrivate;
789
789
  encodePublic: typeof encodePublic;
790
+ generateTrxId: typeof generateTrxId;
790
791
  isCanonicalSignature: typeof isCanonicalSignature;
791
792
  isWif: typeof isWif;
792
793
  ripemd160: typeof ripemd160;
793
794
  sha256: typeof sha256;
794
795
  signTransaction: typeof signTransaction;
795
796
  transactionDigest: typeof transactionDigest;
796
- generateTrxId: typeof generateTrxId;
797
797
  };
798
798
  export {};
799
799
 
@@ -1412,8 +1412,8 @@ declare module 'dhive/chain/operation' {
1412
1412
  owner: string;
1413
1413
  orderid: number;
1414
1414
  amount_to_sell: Asset | string;
1415
- fill_or_kill: boolean;
1416
1415
  exchange_rate: PriceType;
1416
+ fill_or_kill: boolean;
1417
1417
  expiration: string;
1418
1418
  };
1419
1419
  }
@@ -2588,6 +2588,30 @@ declare module 'dhive/helpers/hivemind' {
2588
2588
  }
2589
2589
  export {};
2590
2590
 
2591
+ }
2592
+ declare module 'dhive/helpers/key' {
2593
+ /**
2594
+ * @file Account by key API helpers.
2595
+ * @author Bartłomiej (@engrave) Górnicki
2596
+ */
2597
+ import { PublicKey } from 'dhive/crypto';
2598
+ import { Client } from 'dhive/client';
2599
+ export interface AccountsByKey {
2600
+ accounts: string[][];
2601
+ }
2602
+ export class AccountByKeyAPI {
2603
+ readonly client: Client;
2604
+ constructor(client: Client);
2605
+ /**
2606
+ * Convenience for calling `account_by_key_api`.
2607
+ */
2608
+ call(method: string, params?: any): Promise<any>;
2609
+ /**
2610
+ * Returns all accounts that have the key associated with their owner or active authorities.
2611
+ */
2612
+ getKeyReferences(keys: (PublicKey | string)[]): Promise<AccountsByKey>;
2613
+ }
2614
+
2591
2615
  }
2592
2616
  declare module 'dhive/chain/rc' {
2593
2617
  import { SMTAsset } from 'dhive/chain/asset';
@@ -2690,6 +2714,29 @@ declare module 'dhive/helpers/rc' {
2690
2714
  private _calculateManabar;
2691
2715
  }
2692
2716
 
2717
+ }
2718
+ declare module 'dhive/helpers/transaction' {
2719
+ /**
2720
+ * @file Transaction status API helpers.
2721
+ * @author Bartłomiej (@engrave) Górnicki
2722
+ */
2723
+ import { Client } from 'dhive/client';
2724
+ export type TransactionStatus = 'unknown' | 'within_mempool' | 'within_reversible_block' | 'within_irreversible_block' | 'expired_reversible' | 'expired_irreversible' | 'too_old';
2725
+ export class TransactionStatusAPI {
2726
+ readonly client: Client;
2727
+ constructor(client: Client);
2728
+ /**
2729
+ * Convenience for calling `transaction_status_api`.
2730
+ */
2731
+ call(method: string, params?: any): Promise<any>;
2732
+ /**
2733
+ * Returns the status of a given transaction id
2734
+ */
2735
+ findTransaction(transaction_id: string, expiration?: string): Promise<{
2736
+ status: TransactionStatus;
2737
+ }>;
2738
+ }
2739
+
2693
2740
  }
2694
2741
  declare module 'dhive/client' {
2695
2742
  /**
@@ -2731,7 +2778,9 @@ declare module 'dhive/client' {
2731
2778
  import { BroadcastAPI } from 'dhive/helpers/broadcast';
2732
2779
  import { DatabaseAPI } from 'dhive/helpers/database';
2733
2780
  import { HivemindAPI } from 'dhive/helpers/hivemind';
2781
+ import { AccountByKeyAPI } from 'dhive/helpers/key';
2734
2782
  import { RCAPI } from 'dhive/helpers/rc';
2783
+ import { TransactionStatusAPI } from 'dhive/helpers/transaction';
2735
2784
  /**
2736
2785
  * Library version.
2737
2786
  */
@@ -2827,13 +2876,21 @@ declare module 'dhive/client' {
2827
2876
  */
2828
2877
  readonly blockchain: Blockchain;
2829
2878
  /**
2830
- * Blockchain helper.
2879
+ * Hivemind helper.
2831
2880
  */
2832
2881
  readonly hivemind: HivemindAPI;
2882
+ /**
2883
+ * Accounts by key API helper.
2884
+ */
2885
+ readonly keys: AccountByKeyAPI;
2886
+ /**
2887
+ * Transaction status API helper.
2888
+ */
2889
+ readonly transaction: TransactionStatusAPI;
2833
2890
  /**
2834
2891
  * Chain ID for current network.
2835
2892
  */
2836
- chainId: Buffer;
2893
+ readonly chainId: Buffer;
2837
2894
  /**
2838
2895
  * Address prefix for current network.
2839
2896
  */
@@ -2906,6 +2963,8 @@ declare module 'dhive' {
2906
2963
  export * from 'dhive/helpers/blockchain';
2907
2964
  export * from 'dhive/helpers/database';
2908
2965
  export * from 'dhive/helpers/rc';
2966
+ export * from 'dhive/helpers/key';
2967
+ export * from 'dhive/helpers/hivemind';
2909
2968
  export * from 'dhive/chain/account';
2910
2969
  export * from 'dhive/chain/asset';
2911
2970
  export * from 'dhive/chain/block';