@xelis/sdk 0.8.4 → 0.9.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.
@@ -16,8 +16,8 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  exports.__esModule = true;
18
18
  exports.WS = exports.WalletMethods = void 0;
19
- var websocket_js_1 = require("../lib/websocket.js");
20
- var types_js_1 = require("./types.js");
19
+ var websocket_1 = require("../lib/websocket");
20
+ var types_1 = require("./types");
21
21
  var WalletMethods = /** @class */ (function () {
22
22
  function WalletMethods(ws, prefix) {
23
23
  if (prefix === void 0) { prefix = ""; }
@@ -28,53 +28,59 @@ var WalletMethods = /** @class */ (function () {
28
28
  return this.ws.dataCall(this.prefix + method, params);
29
29
  };
30
30
  WalletMethods.prototype.getVersion = function () {
31
- return this.dataCall(types_js_1.RPCMethod.GetVersion);
31
+ return this.dataCall(types_1.RPCMethod.GetVersion);
32
32
  };
33
33
  WalletMethods.prototype.getNetwork = function () {
34
- return this.dataCall(types_js_1.RPCMethod.GetNetwork);
34
+ return this.dataCall(types_1.RPCMethod.GetNetwork);
35
35
  };
36
36
  WalletMethods.prototype.getNonce = function () {
37
- return this.dataCall(types_js_1.RPCMethod.GetNonce);
37
+ return this.dataCall(types_1.RPCMethod.GetNonce);
38
38
  };
39
39
  WalletMethods.prototype.getTopoheight = function () {
40
- return this.dataCall(types_js_1.RPCMethod.GetTopoheight);
40
+ return this.dataCall(types_1.RPCMethod.GetTopoheight);
41
41
  };
42
42
  WalletMethods.prototype.getAddress = function (params) {
43
43
  if (params === void 0) { params = {}; }
44
- return this.dataCall(types_js_1.RPCMethod.GetAddress, params);
44
+ return this.dataCall(types_1.RPCMethod.GetAddress, params);
45
45
  };
46
46
  WalletMethods.prototype.splitAddress = function (params) {
47
- return this.dataCall(types_js_1.RPCMethod.SplitAddress, params);
47
+ return this.dataCall(types_1.RPCMethod.SplitAddress, params);
48
48
  };
49
- WalletMethods.prototype.rescan = function () {
50
- return this.dataCall(types_js_1.RPCMethod.Rescan);
49
+ WalletMethods.prototype.rescan = function (params) {
50
+ return this.dataCall(types_1.RPCMethod.Rescan, params);
51
51
  };
52
52
  WalletMethods.prototype.getBalance = function (asset) {
53
- return this.dataCall(types_js_1.RPCMethod.GetBalance, { asset: asset });
53
+ return this.dataCall(types_1.RPCMethod.GetBalance, { asset: asset });
54
54
  };
55
55
  WalletMethods.prototype.getTrackedAssets = function () {
56
- return this.dataCall(types_js_1.RPCMethod.GetTrackedAssets);
56
+ return this.dataCall(types_1.RPCMethod.GetTrackedAssets);
57
57
  };
58
58
  WalletMethods.prototype.getAssetPrecision = function (params) {
59
- return this.dataCall(types_js_1.RPCMethod.GetAssetPrecision, params);
59
+ return this.dataCall(types_1.RPCMethod.GetAssetPrecision, params);
60
60
  };
61
61
  WalletMethods.prototype.getTransaction = function (hash) {
62
- return this.dataCall(types_js_1.RPCMethod.GetTransaction, { hash: hash });
62
+ return this.dataCall(types_1.RPCMethod.GetTransaction, { hash: hash });
63
63
  };
64
64
  WalletMethods.prototype.buildTransaction = function (params) {
65
- return this.dataCall(types_js_1.RPCMethod.BuildTransaction, params);
65
+ return this.dataCall(types_1.RPCMethod.BuildTransaction, params);
66
66
  };
67
67
  WalletMethods.prototype.listTransactions = function (params) {
68
- return this.dataCall(types_js_1.RPCMethod.GetTransaction, params);
68
+ return this.dataCall(types_1.RPCMethod.GetTransaction, params);
69
69
  };
70
70
  WalletMethods.prototype.isOnline = function () {
71
- return this.dataCall(types_js_1.RPCMethod.IsOnline);
71
+ return this.dataCall(types_1.RPCMethod.IsOnline);
72
72
  };
73
73
  WalletMethods.prototype.signData = function (data) {
74
- return this.dataCall(types_js_1.RPCMethod.SignData, data);
74
+ return this.dataCall(types_1.RPCMethod.SignData, data);
75
75
  };
76
- WalletMethods.prototype.estimateFees = function (txData) {
77
- return this.dataCall(types_js_1.RPCMethod.EstimateFees, { tx_type: txData });
76
+ WalletMethods.prototype.estimateFees = function (params) {
77
+ return this.dataCall(types_1.RPCMethod.EstimateFees, params);
78
+ };
79
+ WalletMethods.prototype.setOnlineMode = function (params) {
80
+ return this.dataCall(types_1.RPCMethod.SetOfflineMode, params);
81
+ };
82
+ WalletMethods.prototype.setOfflineMode = function () {
83
+ return this.dataCall(types_1.RPCMethod.SetOfflineMode);
78
84
  };
79
85
  return WalletMethods;
80
86
  }());
@@ -87,6 +93,6 @@ var WS = /** @class */ (function (_super) {
87
93
  return _this;
88
94
  }
89
95
  return WS;
90
- }(websocket_js_1.WS));
96
+ }(websocket_1.WS));
91
97
  exports.WS = WS;
92
98
  exports["default"] = WS;
@@ -16,16 +16,16 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  exports.__esModule = true;
18
18
  exports.WS = void 0;
19
- var websocket_js_1 = require("../lib/websocket.js");
20
- var websocket_js_2 = require("../daemon/websocket.js");
21
- var websocket_js_3 = require("../wallet/websocket.js");
19
+ var websocket_1 = require("../lib/websocket");
20
+ var websocket_2 = require("../daemon/websocket");
21
+ var websocket_3 = require("../wallet/websocket");
22
22
  var WS = /** @class */ (function (_super) {
23
23
  __extends(WS, _super);
24
24
  function WS() {
25
25
  var _this = _super.call(this) || this;
26
26
  _this.timeout = 0;
27
- _this.daemon = new websocket_js_2.DaemonMethods(_this, "node.");
28
- _this.wallet = new websocket_js_3.WalletMethods(_this, "wallet.");
27
+ _this.daemon = new websocket_2.DaemonMethods(_this, "node.");
28
+ _this.wallet = new websocket_3.WalletMethods(_this, "wallet.");
29
29
  return _this;
30
30
  }
31
31
  WS.prototype.authorize = function (app) {
@@ -33,6 +33,6 @@ var WS = /** @class */ (function (_super) {
33
33
  return this.call("", {}, data);
34
34
  };
35
35
  return WS;
36
- }(websocket_js_1.WS));
36
+ }(websocket_1.WS));
37
37
  exports.WS = WS;
38
38
  exports["default"] = WS;
@@ -47,8 +47,8 @@ var RPC = /** @class */ (function (_super) {
47
47
  RPC.prototype.getTopBlock = function (params) {
48
48
  return this.post(RPCMethod.GetTopBlock, params);
49
49
  };
50
- RPC.prototype.submitBlock = function (blockTemplate) {
51
- return this.post(RPCMethod.SubmitBlock, { block_template: blockTemplate });
50
+ RPC.prototype.submitBlock = function (params) {
51
+ return this.post(RPCMethod.SubmitBlock, params);
52
52
  };
53
53
  RPC.prototype.getBalance = function (params) {
54
54
  return this.post(RPCMethod.GetBalance, params);
@@ -137,6 +137,24 @@ var RPC = /** @class */ (function (_super) {
137
137
  RPC.prototype.getAccountRegistrationTopoheight = function (address) {
138
138
  return this.post(RPCMethod.GetAccountRegistrationTopoheight, { address: address });
139
139
  };
140
+ RPC.prototype.isAccountRegistered = function (params) {
141
+ return this.post(RPCMethod.IsAccountRegistered, params);
142
+ };
143
+ RPC.prototype.getMempoolCache = function (address) {
144
+ return this.post(RPCMethod.GetMempoolCache, { address: address });
145
+ };
146
+ RPC.prototype.getDifficulty = function () {
147
+ return this.post(RPCMethod.GetDifficulty);
148
+ };
149
+ RPC.prototype.validateAddress = function (params) {
150
+ return this.post(RPCMethod.ValidateAddress, params);
151
+ };
152
+ RPC.prototype.extractKeyFromAddress = function (params) {
153
+ return this.post(RPCMethod.ExtractKeyFromAddress, params);
154
+ };
155
+ RPC.prototype.createMinerWork = function (params) {
156
+ return this.post(RPCMethod.CreateMinerWork, params);
157
+ };
140
158
  return RPC;
141
159
  }(BaseRPC));
142
160
  export { RPC };
@@ -52,6 +52,12 @@ export var RPCMethod;
52
52
  RPCMethod["GetSizeOnDisk"] = "get_size_on_disk";
53
53
  RPCMethod["IsTxExecutedInBlock"] = "is_tx_executed_in_block";
54
54
  RPCMethod["GetAccountRegistrationTopoheight"] = "get_account_registration_topoheight";
55
+ RPCMethod["IsAccountRegistered"] = "is_account_registered";
56
+ RPCMethod["GetMempoolCache"] = "get_mempool_cache";
57
+ RPCMethod["GetDifficulty"] = "get_difficulty";
58
+ RPCMethod["ValidateAddress"] = "validate_address";
59
+ RPCMethod["ExtractKeyFromAddress"] = "extract_key_from_address";
60
+ RPCMethod["CreateMinerWork"] = "create_miner_work";
55
61
  })(RPCMethod || (RPCMethod = {}));
56
62
  export var RPCEvent;
57
63
  (function (RPCEvent) {
@@ -133,8 +133,8 @@ var DaemonMethods = /** @class */ (function () {
133
133
  DaemonMethods.prototype.getTopBlock = function (params) {
134
134
  return this.dataCall(RPCMethod.GetTopBlock, params);
135
135
  };
136
- DaemonMethods.prototype.submitBlock = function (blockTemplate) {
137
- return this.dataCall(RPCMethod.SubmitBlock, { block_template: blockTemplate });
136
+ DaemonMethods.prototype.submitBlock = function (params) {
137
+ return this.dataCall(RPCMethod.SubmitBlock, params);
138
138
  };
139
139
  DaemonMethods.prototype.getBalance = function (params) {
140
140
  return this.dataCall(RPCMethod.GetBalance, params);
@@ -220,6 +220,24 @@ var DaemonMethods = /** @class */ (function () {
220
220
  DaemonMethods.prototype.getAccountRegistrationTopoheight = function (address) {
221
221
  return this.dataCall(RPCMethod.GetAccountRegistrationTopoheight, { address: address });
222
222
  };
223
+ DaemonMethods.prototype.isAccountRegistered = function (params) {
224
+ return this.dataCall(RPCMethod.IsAccountRegistered, params);
225
+ };
226
+ DaemonMethods.prototype.getMempoolCacheResult = function (address) {
227
+ return this.dataCall(RPCMethod.GetMempoolCache, { address: address });
228
+ };
229
+ DaemonMethods.prototype.getDifficulty = function () {
230
+ return this.dataCall(RPCMethod.GetDifficulty);
231
+ };
232
+ DaemonMethods.prototype.validateAddress = function (params) {
233
+ return this.dataCall(RPCMethod.ValidateAddress, params);
234
+ };
235
+ DaemonMethods.prototype.extractKeyFromAddress = function (params) {
236
+ return this.dataCall(RPCMethod.ExtractKeyFromAddress, params);
237
+ };
238
+ DaemonMethods.prototype.createMinerWork = function (params) {
239
+ return this.dataCall(RPCMethod.CreateMinerWork, params);
240
+ };
223
241
  return DaemonMethods;
224
242
  }());
225
243
  export { DaemonMethods };
@@ -89,8 +89,8 @@ var RPC = /** @class */ (function (_super) {
89
89
  RPC.prototype.splitAddress = function (params) {
90
90
  return this.post(RPCMethod.SplitAddress, params);
91
91
  };
92
- RPC.prototype.rescan = function () {
93
- return this.post(RPCMethod.Rescan);
92
+ RPC.prototype.rescan = function (params) {
93
+ return this.post(RPCMethod.Rescan, params);
94
94
  };
95
95
  RPC.prototype.getBalance = function (asset) {
96
96
  return this.post(RPCMethod.GetBalance, { asset: asset });
@@ -119,8 +119,14 @@ var RPC = /** @class */ (function (_super) {
119
119
  RPC.prototype.signData = function (data) {
120
120
  return this.post(RPCMethod.SignData, data);
121
121
  };
122
- RPC.prototype.estimateFees = function (txData) {
123
- return this.post(RPCMethod.EstimateFees, { tx_type: txData });
122
+ RPC.prototype.estimateFees = function (params) {
123
+ return this.post(RPCMethod.EstimateFees, params);
124
+ };
125
+ RPC.prototype.setOnlineMode = function (params) {
126
+ return this.post(RPCMethod.SetOnlineMode, params);
127
+ };
128
+ RPC.prototype.setOfflineMode = function () {
129
+ return this.post(RPCMethod.SetOfflineMode);
124
130
  };
125
131
  return RPC;
126
132
  }(BaseRPC));
@@ -15,6 +15,8 @@ export var RPCMethod;
15
15
  RPCMethod["BuildTransaction"] = "build_transaction";
16
16
  RPCMethod["ListTransactions"] = "list_transactions";
17
17
  RPCMethod["IsOnline"] = "is_online";
18
+ RPCMethod["SetOnlineMode"] = "set_online_mode";
19
+ RPCMethod["SetOfflineMode"] = "set_offline_mode";
18
20
  RPCMethod["SignData"] = "sign_data";
19
21
  RPCMethod["EstimateFees"] = "estimate_fees";
20
22
  })(RPCMethod || (RPCMethod = {}));
@@ -43,8 +43,8 @@ var WalletMethods = /** @class */ (function () {
43
43
  WalletMethods.prototype.splitAddress = function (params) {
44
44
  return this.dataCall(RPCMethod.SplitAddress, params);
45
45
  };
46
- WalletMethods.prototype.rescan = function () {
47
- return this.dataCall(RPCMethod.Rescan);
46
+ WalletMethods.prototype.rescan = function (params) {
47
+ return this.dataCall(RPCMethod.Rescan, params);
48
48
  };
49
49
  WalletMethods.prototype.getBalance = function (asset) {
50
50
  return this.dataCall(RPCMethod.GetBalance, { asset: asset });
@@ -70,8 +70,14 @@ var WalletMethods = /** @class */ (function () {
70
70
  WalletMethods.prototype.signData = function (data) {
71
71
  return this.dataCall(RPCMethod.SignData, data);
72
72
  };
73
- WalletMethods.prototype.estimateFees = function (txData) {
74
- return this.dataCall(RPCMethod.EstimateFees, { tx_type: txData });
73
+ WalletMethods.prototype.estimateFees = function (params) {
74
+ return this.dataCall(RPCMethod.EstimateFees, params);
75
+ };
76
+ WalletMethods.prototype.setOnlineMode = function (params) {
77
+ return this.dataCall(RPCMethod.SetOfflineMode, params);
78
+ };
79
+ WalletMethods.prototype.setOfflineMode = function () {
80
+ return this.dataCall(RPCMethod.SetOfflineMode);
75
81
  };
76
82
  return WalletMethods;
77
83
  }());
@@ -1,44 +1,50 @@
1
- import { Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams, GetBalanceResult, P2PStatusResult, GetBalanceParams, GetBalanceAtTopoHeightParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceResult, GetNonceParams, GetAccountHistoryParams, AccounHistory, DevFee, DiskSize, HasBalanceParams, HasBalanceResult, AssetData, IsTxExecutedInBlockParams, GetAssetParams, GetPeersResult, GetBlockTemplateResult, VersionedBalance, VersionedNonce, GetNonceAtTopoheightParams, HasNonceParams, HasNonceResult, TransactionResponse } from './types.js';
2
- import { RPC as BaseRPC } from '../lib/rpc.js';
1
+ import { Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams, GetBalanceResult, P2PStatusResult, GetBalanceParams, GetBalanceAtTopoHeightParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceResult, GetNonceParams, GetAccountHistoryParams, AccounHistory, DevFee, DiskSize, HasBalanceParams, HasBalanceResult, AssetData, IsTxExecutedInBlockParams, GetAssetParams, GetPeersResult, GetBlockTemplateResult, VersionedBalance, VersionedNonce, GetNonceAtTopoheightParams, HasNonceParams, HasNonceResult, TransactionResponse, IsAccountRegisteredParams, GetMempoolCacheResult, GetDifficultyResult, ValidateAddressParams, ExtractKeyFromAddressParams, SubmitBlockParams, CreateMinerWorkParams, CreateMinerWorkResult } from './types';
2
+ import { RPC as BaseRPC } from '../lib/rpc';
3
3
  export declare class RPC extends BaseRPC {
4
- getVersion(): Promise<import("../lib/types.js").RPCResponse<string>>;
5
- getHeight(): Promise<import("../lib/types.js").RPCResponse<number>>;
6
- getTopoHeight(): Promise<import("../lib/types.js").RPCResponse<number>>;
7
- getStableHeight(): Promise<import("../lib/types.js").RPCResponse<number>>;
8
- getBlockTemplate(address: string): Promise<import("../lib/types.js").RPCResponse<GetBlockTemplateResult>>;
9
- getBlockAtTopoHeight(params: GetBlockAtTopoHeightParams): Promise<import("../lib/types.js").RPCResponse<Block>>;
10
- getBlocksAtHeight(params: GetBlocksAtHeightParams): Promise<import("../lib/types.js").RPCResponse<Block[]>>;
11
- getBlockByHash(params: GetBlockByHashParams): Promise<import("../lib/types.js").RPCResponse<Block>>;
12
- getTopBlock(params: GetTopBlockParams): Promise<import("../lib/types.js").RPCResponse<Block>>;
13
- submitBlock(blockTemplate: string): Promise<import("../lib/types.js").RPCResponse<boolean>>;
14
- getBalance(params: GetBalanceParams): Promise<import("../lib/types.js").RPCResponse<GetBalanceResult>>;
15
- hasBalance(params: HasBalanceParams): Promise<import("../lib/types.js").RPCResponse<HasBalanceResult>>;
16
- getBalanceAtTopoHeight(params: GetBalanceAtTopoHeightParams): Promise<import("../lib/types.js").RPCResponse<VersionedBalance>>;
17
- getInfo(): Promise<import("../lib/types.js").RPCResponse<GetInfoResult>>;
18
- getNonce(params: GetNonceParams): Promise<import("../lib/types.js").RPCResponse<GetNonceResult>>;
19
- hasNonce(params: HasNonceParams): Promise<import("../lib/types.js").RPCResponse<HasNonceResult>>;
20
- getNonceAtTopoheight(params: GetNonceAtTopoheightParams): Promise<import("../lib/types.js").RPCResponse<VersionedNonce>>;
21
- getAsset(params: GetAssetParams): Promise<import("../lib/types.js").RPCResponse<AssetData>>;
22
- getAssets(): Promise<import("../lib/types.js").RPCResponse<string[]>>;
23
- countAssets(): Promise<import("../lib/types.js").RPCResponse<number>>;
24
- countAccounts(): Promise<import("../lib/types.js").RPCResponse<number>>;
25
- countTransactions(): Promise<import("../lib/types.js").RPCResponse<number>>;
26
- submitTransaction(hexData: string): Promise<import("../lib/types.js").RPCResponse<boolean>>;
27
- getTransaction(hash: string): Promise<import("../lib/types.js").RPCResponse<TransactionResponse>>;
28
- p2pStatus(): Promise<import("../lib/types.js").RPCResponse<P2PStatusResult>>;
29
- getPeers(): Promise<import("../lib/types.js").RPCResponse<GetPeersResult>>;
30
- getMemPool(): Promise<import("../lib/types.js").RPCResponse<TransactionResponse[]>>;
31
- getTips(): Promise<import("../lib/types.js").RPCResponse<string[]>>;
32
- getDAGOrder(params: TopoHeightRangeParams): Promise<import("../lib/types.js").RPCResponse<string[]>>;
33
- getBlocksRangeByTopoheight(params: TopoHeightRangeParams): Promise<import("../lib/types.js").RPCResponse<Block[]>>;
34
- getBlocksRangeByHeight(params: HeightRangeParams): Promise<import("../lib/types.js").RPCResponse<Block[]>>;
35
- getTransactions(txHashes: string[]): Promise<import("../lib/types.js").RPCResponse<TransactionResponse[]>>;
36
- getAccountHistory(params: GetAccountHistoryParams): Promise<import("../lib/types.js").RPCResponse<AccounHistory[]>>;
37
- getAccountAssets(address: string): Promise<import("../lib/types.js").RPCResponse<string[]>>;
38
- getAccounts(params: GetAccountsParams): Promise<import("../lib/types.js").RPCResponse<string[]>>;
39
- isTxExecutedInBlock(params: IsTxExecutedInBlockParams): Promise<import("../lib/types.js").RPCResponse<boolean>>;
40
- getDevFeeThresholds(): Promise<import("../lib/types.js").RPCResponse<DevFee[]>>;
41
- getSizeOnDisk(): Promise<import("../lib/types.js").RPCResponse<DiskSize>>;
42
- getAccountRegistrationTopoheight(address: String): Promise<import("../lib/types.js").RPCResponse<Number>>;
4
+ getVersion(): Promise<import("../lib/types").RPCResponse<string>>;
5
+ getHeight(): Promise<import("../lib/types").RPCResponse<number>>;
6
+ getTopoHeight(): Promise<import("../lib/types").RPCResponse<number>>;
7
+ getStableHeight(): Promise<import("../lib/types").RPCResponse<number>>;
8
+ getBlockTemplate(address: string): Promise<import("../lib/types").RPCResponse<GetBlockTemplateResult>>;
9
+ getBlockAtTopoHeight(params: GetBlockAtTopoHeightParams): Promise<import("../lib/types").RPCResponse<Block>>;
10
+ getBlocksAtHeight(params: GetBlocksAtHeightParams): Promise<import("../lib/types").RPCResponse<Block[]>>;
11
+ getBlockByHash(params: GetBlockByHashParams): Promise<import("../lib/types").RPCResponse<Block>>;
12
+ getTopBlock(params: GetTopBlockParams): Promise<import("../lib/types").RPCResponse<Block>>;
13
+ submitBlock(params: SubmitBlockParams): Promise<import("../lib/types").RPCResponse<boolean>>;
14
+ getBalance(params: GetBalanceParams): Promise<import("../lib/types").RPCResponse<GetBalanceResult>>;
15
+ hasBalance(params: HasBalanceParams): Promise<import("../lib/types").RPCResponse<HasBalanceResult>>;
16
+ getBalanceAtTopoHeight(params: GetBalanceAtTopoHeightParams): Promise<import("../lib/types").RPCResponse<VersionedBalance>>;
17
+ getInfo(): Promise<import("../lib/types").RPCResponse<GetInfoResult>>;
18
+ getNonce(params: GetNonceParams): Promise<import("../lib/types").RPCResponse<GetNonceResult>>;
19
+ hasNonce(params: HasNonceParams): Promise<import("../lib/types").RPCResponse<HasNonceResult>>;
20
+ getNonceAtTopoheight(params: GetNonceAtTopoheightParams): Promise<import("../lib/types").RPCResponse<VersionedNonce>>;
21
+ getAsset(params: GetAssetParams): Promise<import("../lib/types").RPCResponse<AssetData>>;
22
+ getAssets(): Promise<import("../lib/types").RPCResponse<string[]>>;
23
+ countAssets(): Promise<import("../lib/types").RPCResponse<number>>;
24
+ countAccounts(): Promise<import("../lib/types").RPCResponse<number>>;
25
+ countTransactions(): Promise<import("../lib/types").RPCResponse<number>>;
26
+ submitTransaction(hexData: string): Promise<import("../lib/types").RPCResponse<boolean>>;
27
+ getTransaction(hash: string): Promise<import("../lib/types").RPCResponse<TransactionResponse>>;
28
+ p2pStatus(): Promise<import("../lib/types").RPCResponse<P2PStatusResult>>;
29
+ getPeers(): Promise<import("../lib/types").RPCResponse<GetPeersResult>>;
30
+ getMemPool(): Promise<import("../lib/types").RPCResponse<TransactionResponse[]>>;
31
+ getTips(): Promise<import("../lib/types").RPCResponse<string[]>>;
32
+ getDAGOrder(params: TopoHeightRangeParams): Promise<import("../lib/types").RPCResponse<string[]>>;
33
+ getBlocksRangeByTopoheight(params: TopoHeightRangeParams): Promise<import("../lib/types").RPCResponse<Block[]>>;
34
+ getBlocksRangeByHeight(params: HeightRangeParams): Promise<import("../lib/types").RPCResponse<Block[]>>;
35
+ getTransactions(txHashes: string[]): Promise<import("../lib/types").RPCResponse<TransactionResponse[]>>;
36
+ getAccountHistory(params: GetAccountHistoryParams): Promise<import("../lib/types").RPCResponse<AccounHistory[]>>;
37
+ getAccountAssets(address: string): Promise<import("../lib/types").RPCResponse<string[]>>;
38
+ getAccounts(params: GetAccountsParams): Promise<import("../lib/types").RPCResponse<string[]>>;
39
+ isTxExecutedInBlock(params: IsTxExecutedInBlockParams): Promise<import("../lib/types").RPCResponse<boolean>>;
40
+ getDevFeeThresholds(): Promise<import("../lib/types").RPCResponse<DevFee[]>>;
41
+ getSizeOnDisk(): Promise<import("../lib/types").RPCResponse<DiskSize>>;
42
+ getAccountRegistrationTopoheight(address: String): Promise<import("../lib/types").RPCResponse<Number>>;
43
+ isAccountRegistered(params: IsAccountRegisteredParams): Promise<import("../lib/types").RPCResponse<boolean>>;
44
+ getMempoolCache(address: String): Promise<import("../lib/types").RPCResponse<GetMempoolCacheResult>>;
45
+ getDifficulty(): Promise<import("../lib/types").RPCResponse<GetDifficultyResult>>;
46
+ validateAddress(params: ValidateAddressParams): Promise<import("../lib/types").RPCResponse<boolean>>;
47
+ extractKeyFromAddress(params: ExtractKeyFromAddressParams): Promise<import("../lib/types").RPCResponse<string | number[]>>;
48
+ createMinerWork(params: CreateMinerWorkParams): Promise<import("../lib/types").RPCResponse<CreateMinerWorkResult>>;
43
49
  }
44
50
  export default RPC;
@@ -84,6 +84,7 @@ export interface P2PStatusResult {
84
84
  peer_id: number;
85
85
  our_topoheight: number;
86
86
  best_topoheight: number;
87
+ median_topoheight: number;
87
88
  max_peers: number;
88
89
  }
89
90
  export interface TopoHeightRangeParams {
@@ -286,12 +287,47 @@ export declare enum BlockType {
286
287
  export interface GetBlockTemplateResult {
287
288
  template: string;
288
289
  height: number;
289
- difficulty: number;
290
+ topoheight: number;
291
+ difficulty: string;
290
292
  }
291
293
  export interface HasNonceParams {
292
294
  address: string;
293
295
  topoheight?: number;
294
296
  }
297
+ export interface IsAccountRegisteredParams {
298
+ address: string;
299
+ in_stable_height: boolean;
300
+ }
301
+ export interface GetMempoolCacheResult {
302
+ min: number;
303
+ max: number;
304
+ txs: string[];
305
+ balances: Map<string, string>;
306
+ }
307
+ export interface GetDifficultyResult {
308
+ difficulty: string;
309
+ hashrate: string;
310
+ hashrate_formatted: string;
311
+ }
312
+ export interface ValidateAddressParams {
313
+ address: string;
314
+ allow_integrated: boolean;
315
+ }
316
+ export interface ExtractKeyFromAddressParams {
317
+ address: string;
318
+ tx_as_hex: boolean;
319
+ }
320
+ export interface SubmitBlockParams {
321
+ block_template: string;
322
+ miner_work?: string;
323
+ }
324
+ export interface CreateMinerWorkParams {
325
+ template: string;
326
+ address?: string;
327
+ }
328
+ export interface CreateMinerWorkResult {
329
+ miner_work: string;
330
+ }
295
331
  export declare enum RPCMethod {
296
332
  GetVersion = "get_version",
297
333
  GetInfo = "get_info",
@@ -331,7 +367,13 @@ export declare enum RPCMethod {
331
367
  GetDevFeeThresholds = "get_dev_fee_thresholds",
332
368
  GetSizeOnDisk = "get_size_on_disk",
333
369
  IsTxExecutedInBlock = "is_tx_executed_in_block",
334
- GetAccountRegistrationTopoheight = "get_account_registration_topoheight"
370
+ GetAccountRegistrationTopoheight = "get_account_registration_topoheight",
371
+ IsAccountRegistered = "is_account_registered",
372
+ GetMempoolCache = "get_mempool_cache",
373
+ GetDifficulty = "get_difficulty",
374
+ ValidateAddress = "validate_address",
375
+ ExtractKeyFromAddress = "extract_key_from_address",
376
+ CreateMinerWork = "create_miner_work"
335
377
  }
336
378
  export declare enum RPCEvent {
337
379
  NewBlock = "new_block",
@@ -1,6 +1,6 @@
1
1
  import { MessageEvent } from 'ws';
2
- import { Block, GetInfoResult, GetPeersResult, RPCEventResult, TopoHeightRangeParams, P2PStatusResult, GetBalanceAtTopoHeightParams, GetBalanceResult, HeightRangeParams, BlockOrdered, GetBalanceParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceParams, GetNonceResult, GetAccountHistoryParams, AccounHistory, Peer, PeerPeerListUpdated, PeerPeerDisconnected, DevFee, DiskSize, AssetWithData, AssetData, GetAssetParams, HasBalanceParams, HasBalanceResult, IsTxExecutedInBlockParams, BlockOrphaned, VersionedBalance, StableHeightChanged, HasNonceResult, HasNonceParams, TransactionResponse } from './types.js';
3
- import { WS as BaseWS } from '../lib/websocket.js';
2
+ import { Block, GetInfoResult, GetPeersResult, RPCEventResult, TopoHeightRangeParams, P2PStatusResult, GetBalanceAtTopoHeightParams, GetBalanceResult, HeightRangeParams, BlockOrdered, GetBalanceParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceParams, GetNonceResult, GetAccountHistoryParams, AccounHistory, Peer, PeerPeerListUpdated, PeerPeerDisconnected, DevFee, DiskSize, AssetWithData, AssetData, GetAssetParams, HasBalanceParams, HasBalanceResult, IsTxExecutedInBlockParams, BlockOrphaned, VersionedBalance, StableHeightChanged, HasNonceResult, HasNonceParams, TransactionResponse, IsAccountRegisteredParams, GetMempoolCacheResult, GetDifficultyResult, ValidateAddressParams, ExtractKeyFromAddressParams, SubmitBlockParams, CreateMinerWorkParams, CreateMinerWorkResult } from './types';
3
+ import { WS as BaseWS } from '../lib/websocket';
4
4
  export declare class DaemonMethods {
5
5
  ws: BaseWS;
6
6
  prefix: string;
@@ -29,7 +29,7 @@ export declare class DaemonMethods {
29
29
  getBlocksAtHeight(params: GetBlocksAtHeightParams): Promise<Block[]>;
30
30
  getBlockByHash(params: GetBlockByHashParams): Promise<Block>;
31
31
  getTopBlock(params: GetTopBlockParams): Promise<Block>;
32
- submitBlock(blockTemplate: string): Promise<boolean>;
32
+ submitBlock(params: SubmitBlockParams): Promise<boolean>;
33
33
  getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
34
34
  hasBalance(params: HasBalanceParams): Promise<HasBalanceResult>;
35
35
  getBalanceAtTopoHeight(params: GetBalanceAtTopoHeightParams): Promise<VersionedBalance>;
@@ -58,6 +58,12 @@ export declare class DaemonMethods {
58
58
  getDevFeeThresholds(): Promise<DevFee[]>;
59
59
  getSizeOnDisk(): Promise<DiskSize>;
60
60
  getAccountRegistrationTopoheight(address: String): Promise<Number>;
61
+ isAccountRegistered(params: IsAccountRegisteredParams): Promise<boolean>;
62
+ getMempoolCacheResult(address: string): Promise<GetMempoolCacheResult>;
63
+ getDifficulty(): Promise<GetDifficultyResult>;
64
+ validateAddress(params: ValidateAddressParams): Promise<boolean>;
65
+ extractKeyFromAddress(params: ExtractKeyFromAddressParams): Promise<string | number[]>;
66
+ createMinerWork(params: CreateMinerWorkParams): Promise<CreateMinerWorkResult>;
61
67
  }
62
68
  export declare class WS extends BaseWS {
63
69
  methods: DaemonMethods;
@@ -1,4 +1,4 @@
1
- import { RPCResponse } from './types.js';
1
+ import { RPCResponse } from './types';
2
2
  export declare class RPC {
3
3
  endpoint: string;
4
4
  timeout: number;
@@ -2,7 +2,7 @@
2
2
  import { ClientOptions, MessageEvent } from 'ws';
3
3
  import WebSocket from 'isomorphic-ws';
4
4
  import { ClientRequestArgs } from 'http';
5
- import { RPCResponse } from './types.js';
5
+ import { RPCResponse } from './types';
6
6
  export declare class WS {
7
7
  endpoint: string;
8
8
  socket?: WebSocket;
@@ -1,7 +1,7 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { MessageEvent } from 'ws';
3
- import DaemonWS from '../daemon/websocket.js';
4
- import { RPCEvent } from '../daemon/types.js';
3
+ import DaemonWS from '../daemon/websocket';
4
+ import { RPCEvent } from '../daemon/types';
5
5
  export declare const INITIATING = -1;
6
6
  interface NodeSocket {
7
7
  daemon: DaemonWS;
@@ -1,7 +1,7 @@
1
- import { GetAssetParams, HasBalanceResult, TransactionData } from '../daemon/types.js';
2
- import { GetAddressParams, SplitAddressParams, SplitAddressResult, BuildTransactionParams, BuildTransactionResult, ListTransactionParams, Signature, TransactionEntry } from './types.js';
3
- import { RPC as BaseRPC } from '../lib/rpc.js';
4
- import { RPCResponse } from '../lib/types.js';
1
+ import { GetAssetParams, HasBalanceResult } from '../daemon/types';
2
+ import { GetAddressParams, SplitAddressParams, SplitAddressResult, BuildTransactionParams, BuildTransactionResult, ListTransactionParams, Signature, TransactionEntry, RescanParams, SetOnlineModeParams, EstimateFeesParams } from './types';
3
+ import { RPC as BaseRPC } from '../lib/rpc';
4
+ import { RPCResponse } from '../lib/types';
5
5
  export declare class RPC extends BaseRPC {
6
6
  auth: string;
7
7
  constructor(endpoint: string, username: string, password: string);
@@ -12,7 +12,7 @@ export declare class RPC extends BaseRPC {
12
12
  getTopoheight(): Promise<RPCResponse<number>>;
13
13
  getAddress(params?: GetAddressParams): Promise<RPCResponse<string>>;
14
14
  splitAddress(params: SplitAddressParams): Promise<RPCResponse<SplitAddressResult>>;
15
- rescan(): Promise<RPCResponse<void>>;
15
+ rescan(params: RescanParams): Promise<RPCResponse<boolean>>;
16
16
  getBalance(asset?: string): Promise<RPCResponse<number>>;
17
17
  hasBalance(asset?: string): Promise<RPCResponse<HasBalanceResult>>;
18
18
  getTrackedAssets(): Promise<RPCResponse<string[]>>;
@@ -22,6 +22,8 @@ export declare class RPC extends BaseRPC {
22
22
  listTransactions(params?: ListTransactionParams): Promise<RPCResponse<TransactionEntry[]>>;
23
23
  isOnline(): Promise<RPCResponse<boolean>>;
24
24
  signData(data: any): Promise<RPCResponse<Signature>>;
25
- estimateFees(txData: TransactionData): Promise<RPCResponse<number>>;
25
+ estimateFees(params: EstimateFeesParams): Promise<RPCResponse<number>>;
26
+ setOnlineMode(params: SetOnlineModeParams): Promise<RPCResponse<boolean>>;
27
+ setOfflineMode(): Promise<RPCResponse<boolean>>;
26
28
  }
27
29
  export default RPC;
@@ -1,4 +1,4 @@
1
- import { TransactionData, Transaction } from '../daemon/types.js';
1
+ import { Transaction } from '../daemon/types';
2
2
  export interface GetAddressParams {
3
3
  integrated_data?: string;
4
4
  }
@@ -9,14 +9,21 @@ export interface SplitAddressResult {
9
9
  address: string;
10
10
  integrated_data: string;
11
11
  }
12
+ export interface FeeBuilder {
13
+ multiplier?: number;
14
+ value?: number;
15
+ }
12
16
  export interface BuildTransactionParams {
13
- tx_type: TransactionData;
17
+ transfers: TransferOut[];
18
+ burn?: TxBurn;
14
19
  broadcast: boolean;
15
- fee?: number;
20
+ fee?: FeeBuilder;
21
+ tx_as_hex: boolean;
16
22
  }
17
23
  export interface BuildTransactionResult {
18
24
  hash: string;
19
25
  data: Transaction;
26
+ txt_as_hex?: string;
20
27
  }
21
28
  export interface ListTransactionParams {
22
29
  min_topoheight?: number;
@@ -38,12 +45,23 @@ export interface TxBurn {
38
45
  asset: string;
39
46
  amount: number;
40
47
  }
48
+ export interface TransferIn {
49
+ asset: string;
50
+ amount: number;
51
+ extra_data?: any;
52
+ }
41
53
  export interface TxIncoming {
42
54
  from: string;
43
- transfers: any;
55
+ transfers: TransferIn[];
56
+ }
57
+ export interface TransferOut {
58
+ destination: string;
59
+ asset: string;
60
+ amount: number;
61
+ extra_data?: any;
44
62
  }
45
63
  export interface TxOutgoing {
46
- transfers: any;
64
+ transfers: TransferOut;
47
65
  fees: number;
48
66
  nonce: number;
49
67
  }
@@ -52,6 +70,18 @@ export interface TransactionEntry {
52
70
  topoheight: number;
53
71
  entry: TxCoinbase | TxBurn | TxIncoming | TxOutgoing;
54
72
  }
73
+ export interface RescanParams {
74
+ until_topoheight?: number;
75
+ auto_reconnect: boolean;
76
+ }
77
+ export interface SetOnlineModeParams {
78
+ daemon_address: string;
79
+ auto_reconnect: boolean;
80
+ }
81
+ export interface EstimateFeesParams {
82
+ transfers: TransferOut[];
83
+ burn?: TxBurn;
84
+ }
55
85
  export declare enum RPCMethod {
56
86
  GetVersion = "get_version",
57
87
  GetNetwork = "get_network",
@@ -68,6 +98,8 @@ export declare enum RPCMethod {
68
98
  BuildTransaction = "build_transaction",
69
99
  ListTransactions = "list_transactions",
70
100
  IsOnline = "is_online",
101
+ SetOnlineMode = "set_online_mode",
102
+ SetOfflineMode = "set_offline_mode",
71
103
  SignData = "sign_data",
72
104
  EstimateFees = "estimate_fees"
73
105
  }