@hiveio/dhive 1.1.1 → 1.2.2
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 +31 -2
- package/dist/dhive.js +1 -1
- package/dist/dhive.js.gz +0 -0
- package/dist/dhive.js.map +1 -1
- package/lib/chain/account.d.ts +1 -0
- package/lib/client.d.ts +6 -1
- package/lib/client.js +2 -0
- package/lib/helpers/key.d.ts +1 -1
- package/lib/helpers/key.js +1 -1
- package/lib/helpers/transaction.d.ts +20 -0
- package/lib/helpers/transaction.js +41 -0
- package/lib/utils.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -2
package/dist/dhive.d.ts
CHANGED
|
@@ -209,6 +209,7 @@ declare module 'dhive/chain/account' {
|
|
|
209
209
|
posting: Authority;
|
|
210
210
|
memo_key: string;
|
|
211
211
|
json_metadata: string;
|
|
212
|
+
posting_json_metadata: string;
|
|
212
213
|
proxy: string;
|
|
213
214
|
last_owner_update: string;
|
|
214
215
|
last_account_update: string;
|
|
@@ -2597,7 +2598,7 @@ declare module 'dhive/helpers/key' {
|
|
|
2597
2598
|
import { PublicKey } from 'dhive/crypto';
|
|
2598
2599
|
import { Client } from 'dhive/client';
|
|
2599
2600
|
export interface AccountsByKey {
|
|
2600
|
-
accounts:
|
|
2601
|
+
accounts: string[][];
|
|
2601
2602
|
}
|
|
2602
2603
|
export class AccountByKeyAPI {
|
|
2603
2604
|
readonly client: Client;
|
|
@@ -2714,6 +2715,29 @@ declare module 'dhive/helpers/rc' {
|
|
|
2714
2715
|
private _calculateManabar;
|
|
2715
2716
|
}
|
|
2716
2717
|
|
|
2718
|
+
}
|
|
2719
|
+
declare module 'dhive/helpers/transaction' {
|
|
2720
|
+
/**
|
|
2721
|
+
* @file Transaction status API helpers.
|
|
2722
|
+
* @author Bartłomiej (@engrave) Górnicki
|
|
2723
|
+
*/
|
|
2724
|
+
import { Client } from 'dhive/client';
|
|
2725
|
+
export type TransactionStatus = 'unknown' | 'within_mempool' | 'within_reversible_block' | 'within_irreversible_block' | 'expired_reversible' | 'expired_irreversible' | 'too_old';
|
|
2726
|
+
export class TransactionStatusAPI {
|
|
2727
|
+
readonly client: Client;
|
|
2728
|
+
constructor(client: Client);
|
|
2729
|
+
/**
|
|
2730
|
+
* Convenience for calling `transaction_status_api`.
|
|
2731
|
+
*/
|
|
2732
|
+
call(method: string, params?: any): Promise<any>;
|
|
2733
|
+
/**
|
|
2734
|
+
* Returns the status of a given transaction id
|
|
2735
|
+
*/
|
|
2736
|
+
findTransaction(transaction_id: string, expiration?: string): Promise<{
|
|
2737
|
+
status: TransactionStatus;
|
|
2738
|
+
}>;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2717
2741
|
}
|
|
2718
2742
|
declare module 'dhive/client' {
|
|
2719
2743
|
/**
|
|
@@ -2757,6 +2781,7 @@ declare module 'dhive/client' {
|
|
|
2757
2781
|
import { HivemindAPI } from 'dhive/helpers/hivemind';
|
|
2758
2782
|
import { AccountByKeyAPI } from 'dhive/helpers/key';
|
|
2759
2783
|
import { RCAPI } from 'dhive/helpers/rc';
|
|
2784
|
+
import { TransactionStatusAPI } from 'dhive/helpers/transaction';
|
|
2760
2785
|
/**
|
|
2761
2786
|
* Library version.
|
|
2762
2787
|
*/
|
|
@@ -2859,6 +2884,10 @@ declare module 'dhive/client' {
|
|
|
2859
2884
|
* Accounts by key API helper.
|
|
2860
2885
|
*/
|
|
2861
2886
|
readonly keys: AccountByKeyAPI;
|
|
2887
|
+
/**
|
|
2888
|
+
* Transaction status API helper.
|
|
2889
|
+
*/
|
|
2890
|
+
readonly transaction: TransactionStatusAPI;
|
|
2862
2891
|
/**
|
|
2863
2892
|
* Chain ID for current network.
|
|
2864
2893
|
*/
|
|
@@ -2871,7 +2900,7 @@ declare module 'dhive/client' {
|
|
|
2871
2900
|
private backoff;
|
|
2872
2901
|
private failoverThreshold;
|
|
2873
2902
|
private consoleOnFailover;
|
|
2874
|
-
|
|
2903
|
+
currentAddress: string;
|
|
2875
2904
|
/**
|
|
2876
2905
|
* @param address The address to the Hive RPC server,
|
|
2877
2906
|
* e.g. `https://api.hive.blog`. or [`https://api.hive.blog`, `https://another.api.com`]
|