@xelis/sdk 0.9.7 → 0.9.9
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/README.md +7 -0
- package/dist/cjs/daemon/rpc.js +16 -10
- package/dist/cjs/daemon/types.js +7 -5
- package/dist/cjs/daemon/websocket.js +13 -7
- package/dist/esm/daemon/rpc.js +16 -10
- package/dist/esm/daemon/types.js +7 -5
- package/dist/esm/daemon/websocket.js +13 -7
- package/dist/types/daemon/rpc.d.ts +10 -8
- package/dist/types/daemon/types.d.ts +30 -9
- package/dist/types/daemon/websocket.d.ts +6 -4
- package/dist/types/wallet/types.d.ts +1 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/daemon/rpc.js
CHANGED
|
@@ -29,17 +29,23 @@ var RPC = /** @class */ (function (_super) {
|
|
|
29
29
|
RPC.prototype.getHeight = function () {
|
|
30
30
|
return this.post(types_1.RPCMethod.GetHeight);
|
|
31
31
|
};
|
|
32
|
-
RPC.prototype.
|
|
33
|
-
return this.post(types_1.RPCMethod.
|
|
32
|
+
RPC.prototype.getTopoheight = function () {
|
|
33
|
+
return this.post(types_1.RPCMethod.GetTopoheight);
|
|
34
34
|
};
|
|
35
35
|
RPC.prototype.getStableHeight = function () {
|
|
36
36
|
return this.post(types_1.RPCMethod.GetStableHeight);
|
|
37
37
|
};
|
|
38
|
+
RPC.prototype.getStableTopoheight = function () {
|
|
39
|
+
return this.post(types_1.RPCMethod.GetStableTopoheight);
|
|
40
|
+
};
|
|
41
|
+
RPC.prototype.getStableBalance = function (params) {
|
|
42
|
+
return this.post(types_1.RPCMethod.GetStableBalance, params);
|
|
43
|
+
};
|
|
38
44
|
RPC.prototype.getBlockTemplate = function (address) {
|
|
39
45
|
return this.post(types_1.RPCMethod.GetBlockTemplate, { address: address });
|
|
40
46
|
};
|
|
41
|
-
RPC.prototype.
|
|
42
|
-
return this.post(types_1.RPCMethod.
|
|
47
|
+
RPC.prototype.getBlockAtTopoheight = function (params) {
|
|
48
|
+
return this.post(types_1.RPCMethod.GetBlockAtTopoheight, params);
|
|
43
49
|
};
|
|
44
50
|
RPC.prototype.getBlocksAtHeight = function (params) {
|
|
45
51
|
return this.post(types_1.RPCMethod.GetBlocksAtHeight, params);
|
|
@@ -59,8 +65,8 @@ var RPC = /** @class */ (function (_super) {
|
|
|
59
65
|
RPC.prototype.hasBalance = function (params) {
|
|
60
66
|
return this.post(types_1.RPCMethod.HasBalance, params);
|
|
61
67
|
};
|
|
62
|
-
RPC.prototype.
|
|
63
|
-
return this.post(types_1.RPCMethod.
|
|
68
|
+
RPC.prototype.getBalanceAtTopoheight = function (params) {
|
|
69
|
+
return this.post(types_1.RPCMethod.GetBalanceAtTopoheight, params);
|
|
64
70
|
};
|
|
65
71
|
RPC.prototype.getInfo = function () {
|
|
66
72
|
return this.post(types_1.RPCMethod.GetInfo);
|
|
@@ -77,8 +83,8 @@ var RPC = /** @class */ (function (_super) {
|
|
|
77
83
|
RPC.prototype.getAsset = function (params) {
|
|
78
84
|
return this.post(types_1.RPCMethod.GetAsset, params);
|
|
79
85
|
};
|
|
80
|
-
RPC.prototype.getAssets = function () {
|
|
81
|
-
return this.post(types_1.RPCMethod.GetAssets);
|
|
86
|
+
RPC.prototype.getAssets = function (params) {
|
|
87
|
+
return this.post(types_1.RPCMethod.GetAssets, params);
|
|
82
88
|
};
|
|
83
89
|
RPC.prototype.countAssets = function () {
|
|
84
90
|
return this.post(types_1.RPCMethod.CountAssets);
|
|
@@ -155,8 +161,8 @@ var RPC = /** @class */ (function (_super) {
|
|
|
155
161
|
RPC.prototype.extractKeyFromAddress = function (params) {
|
|
156
162
|
return this.post(types_1.RPCMethod.ExtractKeyFromAddress, params);
|
|
157
163
|
};
|
|
158
|
-
RPC.prototype.
|
|
159
|
-
return this.post(types_1.RPCMethod.
|
|
164
|
+
RPC.prototype.getMinerWork = function (params) {
|
|
165
|
+
return this.post(types_1.RPCMethod.GetMinerWork, params);
|
|
160
166
|
};
|
|
161
167
|
return RPC;
|
|
162
168
|
}(rpc_1.RPC));
|
package/dist/cjs/daemon/types.js
CHANGED
|
@@ -19,10 +19,12 @@ var RPCMethod;
|
|
|
19
19
|
RPCMethod["GetVersion"] = "get_version";
|
|
20
20
|
RPCMethod["GetInfo"] = "get_info";
|
|
21
21
|
RPCMethod["GetHeight"] = "get_height";
|
|
22
|
-
RPCMethod["
|
|
23
|
-
RPCMethod["GetStableHeight"] = "
|
|
22
|
+
RPCMethod["GetTopoheight"] = "get_topoheight";
|
|
23
|
+
RPCMethod["GetStableHeight"] = "get_stable_height";
|
|
24
|
+
RPCMethod["GetStableTopoheight"] = "get_stable_topoheight";
|
|
25
|
+
RPCMethod["GetStableBalance"] = "get_stable_balance";
|
|
24
26
|
RPCMethod["GetBlockTemplate"] = "get_block_template";
|
|
25
|
-
RPCMethod["
|
|
27
|
+
RPCMethod["GetBlockAtTopoheight"] = "get_block_at_topoheight";
|
|
26
28
|
RPCMethod["GetBlocksAtHeight"] = "get_blocks_at_height";
|
|
27
29
|
RPCMethod["GetBlockByHash"] = "get_block_by_hash";
|
|
28
30
|
RPCMethod["GetTopBlock"] = "get_top_block";
|
|
@@ -31,7 +33,7 @@ var RPCMethod;
|
|
|
31
33
|
RPCMethod["HasNonce"] = "has_nonce";
|
|
32
34
|
RPCMethod["GetBalance"] = "get_balance";
|
|
33
35
|
RPCMethod["HasBalance"] = "has_balance";
|
|
34
|
-
RPCMethod["
|
|
36
|
+
RPCMethod["GetBalanceAtTopoheight"] = "get_balance_at_topoheight";
|
|
35
37
|
RPCMethod["GetAsset"] = "get_asset";
|
|
36
38
|
RPCMethod["GetAssets"] = "get_assets";
|
|
37
39
|
RPCMethod["CountAssets"] = "count_assets";
|
|
@@ -60,7 +62,7 @@ var RPCMethod;
|
|
|
60
62
|
RPCMethod["GetDifficulty"] = "get_difficulty";
|
|
61
63
|
RPCMethod["ValidateAddress"] = "validate_address";
|
|
62
64
|
RPCMethod["ExtractKeyFromAddress"] = "extract_key_from_address";
|
|
63
|
-
RPCMethod["
|
|
65
|
+
RPCMethod["GetMinerWork"] = "get_miner_work";
|
|
64
66
|
})(RPCMethod = exports.RPCMethod || (exports.RPCMethod = {}));
|
|
65
67
|
var RPCEvent;
|
|
66
68
|
(function (RPCEvent) {
|
|
@@ -116,16 +116,22 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
116
116
|
return this.dataCall(types_1.RPCMethod.GetHeight);
|
|
117
117
|
};
|
|
118
118
|
DaemonMethods.prototype.getTopoHeight = function () {
|
|
119
|
-
return this.dataCall(types_1.RPCMethod.
|
|
119
|
+
return this.dataCall(types_1.RPCMethod.GetTopoheight);
|
|
120
120
|
};
|
|
121
121
|
DaemonMethods.prototype.getStableHeight = function () {
|
|
122
122
|
return this.dataCall(types_1.RPCMethod.GetStableHeight);
|
|
123
123
|
};
|
|
124
|
+
DaemonMethods.prototype.getStableTopoheight = function () {
|
|
125
|
+
return this.dataCall(types_1.RPCMethod.GetStableTopoheight);
|
|
126
|
+
};
|
|
127
|
+
DaemonMethods.prototype.getStableBalance = function (params) {
|
|
128
|
+
return this.dataCall(types_1.RPCMethod.GetStableBalance, params);
|
|
129
|
+
};
|
|
124
130
|
DaemonMethods.prototype.getBlockTemplate = function (address) {
|
|
125
131
|
return this.dataCall(types_1.RPCMethod.GetBlockTemplate, { address: address });
|
|
126
132
|
};
|
|
127
133
|
DaemonMethods.prototype.getBlockAtTopoHeight = function (params) {
|
|
128
|
-
return this.dataCall(types_1.RPCMethod.
|
|
134
|
+
return this.dataCall(types_1.RPCMethod.GetBlockAtTopoheight, params);
|
|
129
135
|
};
|
|
130
136
|
DaemonMethods.prototype.getBlocksAtHeight = function (params) {
|
|
131
137
|
return this.dataCall(types_1.RPCMethod.GetBlocksAtHeight, params);
|
|
@@ -146,7 +152,7 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
146
152
|
return this.dataCall(types_1.RPCMethod.HasBalance, params);
|
|
147
153
|
};
|
|
148
154
|
DaemonMethods.prototype.getBalanceAtTopoHeight = function (params) {
|
|
149
|
-
return this.dataCall(types_1.RPCMethod.
|
|
155
|
+
return this.dataCall(types_1.RPCMethod.GetBalanceAtTopoheight, params);
|
|
150
156
|
};
|
|
151
157
|
DaemonMethods.prototype.getInfo = function () {
|
|
152
158
|
return this.dataCall(types_1.RPCMethod.GetInfo);
|
|
@@ -160,8 +166,8 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
160
166
|
DaemonMethods.prototype.getAsset = function (params) {
|
|
161
167
|
return this.dataCall(types_1.RPCMethod.GetAsset, params);
|
|
162
168
|
};
|
|
163
|
-
DaemonMethods.prototype.getAssets = function () {
|
|
164
|
-
return this.dataCall(types_1.RPCMethod.GetAssets);
|
|
169
|
+
DaemonMethods.prototype.getAssets = function (params) {
|
|
170
|
+
return this.dataCall(types_1.RPCMethod.GetAssets, params);
|
|
165
171
|
};
|
|
166
172
|
DaemonMethods.prototype.countAssets = function () {
|
|
167
173
|
return this.dataCall(types_1.RPCMethod.CountAssets);
|
|
@@ -238,8 +244,8 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
238
244
|
DaemonMethods.prototype.extractKeyFromAddress = function (params) {
|
|
239
245
|
return this.dataCall(types_1.RPCMethod.ExtractKeyFromAddress, params);
|
|
240
246
|
};
|
|
241
|
-
DaemonMethods.prototype.
|
|
242
|
-
return this.dataCall(types_1.RPCMethod.
|
|
247
|
+
DaemonMethods.prototype.getMinerWork = function (params) {
|
|
248
|
+
return this.dataCall(types_1.RPCMethod.GetMinerWork, params);
|
|
243
249
|
};
|
|
244
250
|
return DaemonMethods;
|
|
245
251
|
}());
|
package/dist/esm/daemon/rpc.js
CHANGED
|
@@ -26,17 +26,23 @@ var RPC = /** @class */ (function (_super) {
|
|
|
26
26
|
RPC.prototype.getHeight = function () {
|
|
27
27
|
return this.post(RPCMethod.GetHeight);
|
|
28
28
|
};
|
|
29
|
-
RPC.prototype.
|
|
30
|
-
return this.post(RPCMethod.
|
|
29
|
+
RPC.prototype.getTopoheight = function () {
|
|
30
|
+
return this.post(RPCMethod.GetTopoheight);
|
|
31
31
|
};
|
|
32
32
|
RPC.prototype.getStableHeight = function () {
|
|
33
33
|
return this.post(RPCMethod.GetStableHeight);
|
|
34
34
|
};
|
|
35
|
+
RPC.prototype.getStableTopoheight = function () {
|
|
36
|
+
return this.post(RPCMethod.GetStableTopoheight);
|
|
37
|
+
};
|
|
38
|
+
RPC.prototype.getStableBalance = function (params) {
|
|
39
|
+
return this.post(RPCMethod.GetStableBalance, params);
|
|
40
|
+
};
|
|
35
41
|
RPC.prototype.getBlockTemplate = function (address) {
|
|
36
42
|
return this.post(RPCMethod.GetBlockTemplate, { address: address });
|
|
37
43
|
};
|
|
38
|
-
RPC.prototype.
|
|
39
|
-
return this.post(RPCMethod.
|
|
44
|
+
RPC.prototype.getBlockAtTopoheight = function (params) {
|
|
45
|
+
return this.post(RPCMethod.GetBlockAtTopoheight, params);
|
|
40
46
|
};
|
|
41
47
|
RPC.prototype.getBlocksAtHeight = function (params) {
|
|
42
48
|
return this.post(RPCMethod.GetBlocksAtHeight, params);
|
|
@@ -56,8 +62,8 @@ var RPC = /** @class */ (function (_super) {
|
|
|
56
62
|
RPC.prototype.hasBalance = function (params) {
|
|
57
63
|
return this.post(RPCMethod.HasBalance, params);
|
|
58
64
|
};
|
|
59
|
-
RPC.prototype.
|
|
60
|
-
return this.post(RPCMethod.
|
|
65
|
+
RPC.prototype.getBalanceAtTopoheight = function (params) {
|
|
66
|
+
return this.post(RPCMethod.GetBalanceAtTopoheight, params);
|
|
61
67
|
};
|
|
62
68
|
RPC.prototype.getInfo = function () {
|
|
63
69
|
return this.post(RPCMethod.GetInfo);
|
|
@@ -74,8 +80,8 @@ var RPC = /** @class */ (function (_super) {
|
|
|
74
80
|
RPC.prototype.getAsset = function (params) {
|
|
75
81
|
return this.post(RPCMethod.GetAsset, params);
|
|
76
82
|
};
|
|
77
|
-
RPC.prototype.getAssets = function () {
|
|
78
|
-
return this.post(RPCMethod.GetAssets);
|
|
83
|
+
RPC.prototype.getAssets = function (params) {
|
|
84
|
+
return this.post(RPCMethod.GetAssets, params);
|
|
79
85
|
};
|
|
80
86
|
RPC.prototype.countAssets = function () {
|
|
81
87
|
return this.post(RPCMethod.CountAssets);
|
|
@@ -152,8 +158,8 @@ var RPC = /** @class */ (function (_super) {
|
|
|
152
158
|
RPC.prototype.extractKeyFromAddress = function (params) {
|
|
153
159
|
return this.post(RPCMethod.ExtractKeyFromAddress, params);
|
|
154
160
|
};
|
|
155
|
-
RPC.prototype.
|
|
156
|
-
return this.post(RPCMethod.
|
|
161
|
+
RPC.prototype.getMinerWork = function (params) {
|
|
162
|
+
return this.post(RPCMethod.GetMinerWork, params);
|
|
157
163
|
};
|
|
158
164
|
return RPC;
|
|
159
165
|
}(BaseRPC));
|
package/dist/esm/daemon/types.js
CHANGED
|
@@ -16,10 +16,12 @@ export var RPCMethod;
|
|
|
16
16
|
RPCMethod["GetVersion"] = "get_version";
|
|
17
17
|
RPCMethod["GetInfo"] = "get_info";
|
|
18
18
|
RPCMethod["GetHeight"] = "get_height";
|
|
19
|
-
RPCMethod["
|
|
20
|
-
RPCMethod["GetStableHeight"] = "
|
|
19
|
+
RPCMethod["GetTopoheight"] = "get_topoheight";
|
|
20
|
+
RPCMethod["GetStableHeight"] = "get_stable_height";
|
|
21
|
+
RPCMethod["GetStableTopoheight"] = "get_stable_topoheight";
|
|
22
|
+
RPCMethod["GetStableBalance"] = "get_stable_balance";
|
|
21
23
|
RPCMethod["GetBlockTemplate"] = "get_block_template";
|
|
22
|
-
RPCMethod["
|
|
24
|
+
RPCMethod["GetBlockAtTopoheight"] = "get_block_at_topoheight";
|
|
23
25
|
RPCMethod["GetBlocksAtHeight"] = "get_blocks_at_height";
|
|
24
26
|
RPCMethod["GetBlockByHash"] = "get_block_by_hash";
|
|
25
27
|
RPCMethod["GetTopBlock"] = "get_top_block";
|
|
@@ -28,7 +30,7 @@ export var RPCMethod;
|
|
|
28
30
|
RPCMethod["HasNonce"] = "has_nonce";
|
|
29
31
|
RPCMethod["GetBalance"] = "get_balance";
|
|
30
32
|
RPCMethod["HasBalance"] = "has_balance";
|
|
31
|
-
RPCMethod["
|
|
33
|
+
RPCMethod["GetBalanceAtTopoheight"] = "get_balance_at_topoheight";
|
|
32
34
|
RPCMethod["GetAsset"] = "get_asset";
|
|
33
35
|
RPCMethod["GetAssets"] = "get_assets";
|
|
34
36
|
RPCMethod["CountAssets"] = "count_assets";
|
|
@@ -57,7 +59,7 @@ export var RPCMethod;
|
|
|
57
59
|
RPCMethod["GetDifficulty"] = "get_difficulty";
|
|
58
60
|
RPCMethod["ValidateAddress"] = "validate_address";
|
|
59
61
|
RPCMethod["ExtractKeyFromAddress"] = "extract_key_from_address";
|
|
60
|
-
RPCMethod["
|
|
62
|
+
RPCMethod["GetMinerWork"] = "get_miner_work";
|
|
61
63
|
})(RPCMethod || (RPCMethod = {}));
|
|
62
64
|
export var RPCEvent;
|
|
63
65
|
(function (RPCEvent) {
|
|
@@ -113,16 +113,22 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
113
113
|
return this.dataCall(RPCMethod.GetHeight);
|
|
114
114
|
};
|
|
115
115
|
DaemonMethods.prototype.getTopoHeight = function () {
|
|
116
|
-
return this.dataCall(RPCMethod.
|
|
116
|
+
return this.dataCall(RPCMethod.GetTopoheight);
|
|
117
117
|
};
|
|
118
118
|
DaemonMethods.prototype.getStableHeight = function () {
|
|
119
119
|
return this.dataCall(RPCMethod.GetStableHeight);
|
|
120
120
|
};
|
|
121
|
+
DaemonMethods.prototype.getStableTopoheight = function () {
|
|
122
|
+
return this.dataCall(RPCMethod.GetStableTopoheight);
|
|
123
|
+
};
|
|
124
|
+
DaemonMethods.prototype.getStableBalance = function (params) {
|
|
125
|
+
return this.dataCall(RPCMethod.GetStableBalance, params);
|
|
126
|
+
};
|
|
121
127
|
DaemonMethods.prototype.getBlockTemplate = function (address) {
|
|
122
128
|
return this.dataCall(RPCMethod.GetBlockTemplate, { address: address });
|
|
123
129
|
};
|
|
124
130
|
DaemonMethods.prototype.getBlockAtTopoHeight = function (params) {
|
|
125
|
-
return this.dataCall(RPCMethod.
|
|
131
|
+
return this.dataCall(RPCMethod.GetBlockAtTopoheight, params);
|
|
126
132
|
};
|
|
127
133
|
DaemonMethods.prototype.getBlocksAtHeight = function (params) {
|
|
128
134
|
return this.dataCall(RPCMethod.GetBlocksAtHeight, params);
|
|
@@ -143,7 +149,7 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
143
149
|
return this.dataCall(RPCMethod.HasBalance, params);
|
|
144
150
|
};
|
|
145
151
|
DaemonMethods.prototype.getBalanceAtTopoHeight = function (params) {
|
|
146
|
-
return this.dataCall(RPCMethod.
|
|
152
|
+
return this.dataCall(RPCMethod.GetBalanceAtTopoheight, params);
|
|
147
153
|
};
|
|
148
154
|
DaemonMethods.prototype.getInfo = function () {
|
|
149
155
|
return this.dataCall(RPCMethod.GetInfo);
|
|
@@ -157,8 +163,8 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
157
163
|
DaemonMethods.prototype.getAsset = function (params) {
|
|
158
164
|
return this.dataCall(RPCMethod.GetAsset, params);
|
|
159
165
|
};
|
|
160
|
-
DaemonMethods.prototype.getAssets = function () {
|
|
161
|
-
return this.dataCall(RPCMethod.GetAssets);
|
|
166
|
+
DaemonMethods.prototype.getAssets = function (params) {
|
|
167
|
+
return this.dataCall(RPCMethod.GetAssets, params);
|
|
162
168
|
};
|
|
163
169
|
DaemonMethods.prototype.countAssets = function () {
|
|
164
170
|
return this.dataCall(RPCMethod.CountAssets);
|
|
@@ -235,8 +241,8 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
235
241
|
DaemonMethods.prototype.extractKeyFromAddress = function (params) {
|
|
236
242
|
return this.dataCall(RPCMethod.ExtractKeyFromAddress, params);
|
|
237
243
|
};
|
|
238
|
-
DaemonMethods.prototype.
|
|
239
|
-
return this.dataCall(RPCMethod.
|
|
244
|
+
DaemonMethods.prototype.getMinerWork = function (params) {
|
|
245
|
+
return this.dataCall(RPCMethod.GetMinerWork, params);
|
|
240
246
|
};
|
|
241
247
|
return DaemonMethods;
|
|
242
248
|
}());
|
|
@@ -1,25 +1,27 @@
|
|
|
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,
|
|
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, GetMinerWorkParams, GetMinerWorkResult, ValidateAddressResult, GetStableBalanceResult, GetAssetsParams } from './types';
|
|
2
2
|
import { RPC as BaseRPC } from '../lib/rpc';
|
|
3
3
|
export declare class RPC extends BaseRPC {
|
|
4
4
|
getVersion(): Promise<import("../lib/types").RPCResponse<string>>;
|
|
5
5
|
getHeight(): Promise<import("../lib/types").RPCResponse<number>>;
|
|
6
|
-
|
|
6
|
+
getTopoheight(): Promise<import("../lib/types").RPCResponse<number>>;
|
|
7
7
|
getStableHeight(): Promise<import("../lib/types").RPCResponse<number>>;
|
|
8
|
+
getStableTopoheight(): Promise<import("../lib/types").RPCResponse<number>>;
|
|
9
|
+
getStableBalance(params: GetBalanceParams): Promise<import("../lib/types").RPCResponse<GetStableBalanceResult>>;
|
|
8
10
|
getBlockTemplate(address: string): Promise<import("../lib/types").RPCResponse<GetBlockTemplateResult>>;
|
|
9
|
-
|
|
11
|
+
getBlockAtTopoheight(params: GetBlockAtTopoHeightParams): Promise<import("../lib/types").RPCResponse<Block>>;
|
|
10
12
|
getBlocksAtHeight(params: GetBlocksAtHeightParams): Promise<import("../lib/types").RPCResponse<Block[]>>;
|
|
11
13
|
getBlockByHash(params: GetBlockByHashParams): Promise<import("../lib/types").RPCResponse<Block>>;
|
|
12
|
-
getTopBlock(params
|
|
14
|
+
getTopBlock(params?: GetTopBlockParams): Promise<import("../lib/types").RPCResponse<Block>>;
|
|
13
15
|
submitBlock(params: SubmitBlockParams): Promise<import("../lib/types").RPCResponse<boolean>>;
|
|
14
16
|
getBalance(params: GetBalanceParams): Promise<import("../lib/types").RPCResponse<GetBalanceResult>>;
|
|
15
17
|
hasBalance(params: HasBalanceParams): Promise<import("../lib/types").RPCResponse<HasBalanceResult>>;
|
|
16
|
-
|
|
18
|
+
getBalanceAtTopoheight(params: GetBalanceAtTopoHeightParams): Promise<import("../lib/types").RPCResponse<VersionedBalance>>;
|
|
17
19
|
getInfo(): Promise<import("../lib/types").RPCResponse<GetInfoResult>>;
|
|
18
20
|
getNonce(params: GetNonceParams): Promise<import("../lib/types").RPCResponse<GetNonceResult>>;
|
|
19
21
|
hasNonce(params: HasNonceParams): Promise<import("../lib/types").RPCResponse<HasNonceResult>>;
|
|
20
22
|
getNonceAtTopoheight(params: GetNonceAtTopoheightParams): Promise<import("../lib/types").RPCResponse<VersionedNonce>>;
|
|
21
23
|
getAsset(params: GetAssetParams): Promise<import("../lib/types").RPCResponse<AssetData>>;
|
|
22
|
-
getAssets(): Promise<import("../lib/types").RPCResponse<string[]>>;
|
|
24
|
+
getAssets(params: GetAssetsParams): Promise<import("../lib/types").RPCResponse<string[]>>;
|
|
23
25
|
countAssets(): Promise<import("../lib/types").RPCResponse<number>>;
|
|
24
26
|
countAccounts(): Promise<import("../lib/types").RPCResponse<number>>;
|
|
25
27
|
countTransactions(): Promise<import("../lib/types").RPCResponse<number>>;
|
|
@@ -29,7 +31,7 @@ export declare class RPC extends BaseRPC {
|
|
|
29
31
|
getPeers(): Promise<import("../lib/types").RPCResponse<GetPeersResult>>;
|
|
30
32
|
getMemPool(): Promise<import("../lib/types").RPCResponse<TransactionResponse[]>>;
|
|
31
33
|
getTips(): Promise<import("../lib/types").RPCResponse<string[]>>;
|
|
32
|
-
getDAGOrder(params
|
|
34
|
+
getDAGOrder(params?: TopoHeightRangeParams): Promise<import("../lib/types").RPCResponse<string[]>>;
|
|
33
35
|
getBlocksRangeByTopoheight(params: TopoHeightRangeParams): Promise<import("../lib/types").RPCResponse<Block[]>>;
|
|
34
36
|
getBlocksRangeByHeight(params: HeightRangeParams): Promise<import("../lib/types").RPCResponse<Block[]>>;
|
|
35
37
|
getTransactions(txHashes: string[]): Promise<import("../lib/types").RPCResponse<TransactionResponse[]>>;
|
|
@@ -45,6 +47,6 @@ export declare class RPC extends BaseRPC {
|
|
|
45
47
|
getDifficulty(): Promise<import("../lib/types").RPCResponse<GetDifficultyResult>>;
|
|
46
48
|
validateAddress(params: ValidateAddressParams): Promise<import("../lib/types").RPCResponse<ValidateAddressResult>>;
|
|
47
49
|
extractKeyFromAddress(params: ExtractKeyFromAddressParams): Promise<import("../lib/types").RPCResponse<string | number[]>>;
|
|
48
|
-
|
|
50
|
+
getMinerWork(params: GetMinerWorkParams): Promise<import("../lib/types").RPCResponse<GetMinerWorkResult>>;
|
|
49
51
|
}
|
|
50
52
|
export default RPC;
|
|
@@ -45,9 +45,13 @@ export interface GetBalanceAtTopoHeightParams {
|
|
|
45
45
|
asset: string;
|
|
46
46
|
topoheight: number;
|
|
47
47
|
}
|
|
48
|
+
export interface GetStableBalanceResult {
|
|
49
|
+
stable_topoheight: number;
|
|
50
|
+
stable_block_hash: string;
|
|
51
|
+
version: VersionedBalance;
|
|
52
|
+
}
|
|
48
53
|
export interface GetNonceParams {
|
|
49
54
|
address: string;
|
|
50
|
-
topoheight: number;
|
|
51
55
|
}
|
|
52
56
|
export interface VersionedNonce {
|
|
53
57
|
nonce: number;
|
|
@@ -182,6 +186,7 @@ export interface Transaction {
|
|
|
182
186
|
range_proof: number[];
|
|
183
187
|
signature: string;
|
|
184
188
|
reference: Reference;
|
|
189
|
+
size: number;
|
|
185
190
|
}
|
|
186
191
|
export interface TransactionResponse extends Transaction {
|
|
187
192
|
blocks: string[];
|
|
@@ -189,6 +194,15 @@ export interface TransactionResponse extends Transaction {
|
|
|
189
194
|
in_mempool: boolean;
|
|
190
195
|
first_seen?: number;
|
|
191
196
|
}
|
|
197
|
+
export interface TransactionExecuted {
|
|
198
|
+
tx_hash: string;
|
|
199
|
+
block_hash: string;
|
|
200
|
+
topoheight: number;
|
|
201
|
+
}
|
|
202
|
+
export interface GetAssetsParams {
|
|
203
|
+
skip?: number;
|
|
204
|
+
maximum?: number;
|
|
205
|
+
}
|
|
192
206
|
export interface GetAccountsParams {
|
|
193
207
|
skip?: number;
|
|
194
208
|
maximum?: number;
|
|
@@ -260,7 +274,7 @@ export interface AssetWithData {
|
|
|
260
274
|
export interface HasBalanceParams {
|
|
261
275
|
address: string;
|
|
262
276
|
asset: string;
|
|
263
|
-
topoheight
|
|
277
|
+
topoheight?: number;
|
|
264
278
|
}
|
|
265
279
|
export interface HasBalanceResult {
|
|
266
280
|
exists: boolean;
|
|
@@ -291,6 +305,7 @@ export interface GetBlockTemplateResult {
|
|
|
291
305
|
height: number;
|
|
292
306
|
topoheight: number;
|
|
293
307
|
difficulty: string;
|
|
308
|
+
algorithm: string;
|
|
294
309
|
}
|
|
295
310
|
export interface HasNonceParams {
|
|
296
311
|
address: string;
|
|
@@ -327,21 +342,27 @@ export interface SubmitBlockParams {
|
|
|
327
342
|
block_template: string;
|
|
328
343
|
miner_work?: string;
|
|
329
344
|
}
|
|
330
|
-
export interface
|
|
345
|
+
export interface GetMinerWorkParams {
|
|
331
346
|
template: string;
|
|
332
347
|
address?: string;
|
|
333
348
|
}
|
|
334
|
-
export interface
|
|
349
|
+
export interface GetMinerWorkResult {
|
|
335
350
|
miner_work: string;
|
|
351
|
+
algorithm: string;
|
|
352
|
+
height: number;
|
|
353
|
+
difficulty: string;
|
|
354
|
+
topoheight: number;
|
|
336
355
|
}
|
|
337
356
|
export declare enum RPCMethod {
|
|
338
357
|
GetVersion = "get_version",
|
|
339
358
|
GetInfo = "get_info",
|
|
340
359
|
GetHeight = "get_height",
|
|
341
|
-
|
|
342
|
-
GetStableHeight = "
|
|
360
|
+
GetTopoheight = "get_topoheight",
|
|
361
|
+
GetStableHeight = "get_stable_height",
|
|
362
|
+
GetStableTopoheight = "get_stable_topoheight",
|
|
363
|
+
GetStableBalance = "get_stable_balance",
|
|
343
364
|
GetBlockTemplate = "get_block_template",
|
|
344
|
-
|
|
365
|
+
GetBlockAtTopoheight = "get_block_at_topoheight",
|
|
345
366
|
GetBlocksAtHeight = "get_blocks_at_height",
|
|
346
367
|
GetBlockByHash = "get_block_by_hash",
|
|
347
368
|
GetTopBlock = "get_top_block",
|
|
@@ -350,7 +371,7 @@ export declare enum RPCMethod {
|
|
|
350
371
|
HasNonce = "has_nonce",
|
|
351
372
|
GetBalance = "get_balance",
|
|
352
373
|
HasBalance = "has_balance",
|
|
353
|
-
|
|
374
|
+
GetBalanceAtTopoheight = "get_balance_at_topoheight",
|
|
354
375
|
GetAsset = "get_asset",
|
|
355
376
|
GetAssets = "get_assets",
|
|
356
377
|
CountAssets = "count_assets",
|
|
@@ -379,7 +400,7 @@ export declare enum RPCMethod {
|
|
|
379
400
|
GetDifficulty = "get_difficulty",
|
|
380
401
|
ValidateAddress = "validate_address",
|
|
381
402
|
ExtractKeyFromAddress = "extract_key_from_address",
|
|
382
|
-
|
|
403
|
+
GetMinerWork = "get_miner_work"
|
|
383
404
|
}
|
|
384
405
|
export declare enum RPCEvent {
|
|
385
406
|
NewBlock = "new_block",
|
|
@@ -1,5 +1,5 @@
|
|
|
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, IsAccountRegisteredParams, GetMempoolCacheResult, GetDifficultyResult, ValidateAddressParams, ExtractKeyFromAddressParams, SubmitBlockParams,
|
|
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, GetMinerWorkParams, GetMinerWorkResult, ValidateAddressResult, TransactionExecuted, GetStableBalanceResult, GetAssetsParams } from './types';
|
|
3
3
|
import { WS as BaseWS } from '../lib/websocket';
|
|
4
4
|
export declare class DaemonMethods {
|
|
5
5
|
ws: BaseWS;
|
|
@@ -9,7 +9,7 @@ export declare class DaemonMethods {
|
|
|
9
9
|
dataCall<T>(method: string, params?: any): Promise<T>;
|
|
10
10
|
onNewBlock(onData: (msgEvent: MessageEvent, data?: Block & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
11
11
|
onTransactionAddedInMempool(onData: (msgEvent: MessageEvent, data?: TransactionResponse & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
12
|
-
onTransactionExecuted(onData: (msgEvent: MessageEvent, data?:
|
|
12
|
+
onTransactionExecuted(onData: (msgEvent: MessageEvent, data?: TransactionExecuted & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
13
13
|
onBlockOrdered(onData: (msgEvent: MessageEvent, data?: BlockOrdered & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
14
14
|
onPeerConnected(onData: (msgEvent: MessageEvent, data?: Peer & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
15
15
|
onPeerDisconnected(onData: (msgEvent: MessageEvent, data?: number & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
@@ -24,6 +24,8 @@ export declare class DaemonMethods {
|
|
|
24
24
|
getHeight(): Promise<number>;
|
|
25
25
|
getTopoHeight(): Promise<number>;
|
|
26
26
|
getStableHeight(): Promise<number>;
|
|
27
|
+
getStableTopoheight(): Promise<number>;
|
|
28
|
+
getStableBalance(params: GetBalanceParams): Promise<GetStableBalanceResult>;
|
|
27
29
|
getBlockTemplate(address: string): Promise<string>;
|
|
28
30
|
getBlockAtTopoHeight(params: GetBlockAtTopoHeightParams): Promise<Block>;
|
|
29
31
|
getBlocksAtHeight(params: GetBlocksAtHeightParams): Promise<Block[]>;
|
|
@@ -37,7 +39,7 @@ export declare class DaemonMethods {
|
|
|
37
39
|
getNonce(params: GetNonceParams): Promise<GetNonceResult>;
|
|
38
40
|
hasNonce(params: HasNonceParams): Promise<HasNonceResult>;
|
|
39
41
|
getAsset(params: GetAssetParams): Promise<AssetData>;
|
|
40
|
-
getAssets(): Promise<string[]>;
|
|
42
|
+
getAssets(params?: GetAssetsParams): Promise<string[]>;
|
|
41
43
|
countAssets(): Promise<number>;
|
|
42
44
|
countAccounts(): Promise<number>;
|
|
43
45
|
countTransactions(): Promise<number>;
|
|
@@ -63,7 +65,7 @@ export declare class DaemonMethods {
|
|
|
63
65
|
getDifficulty(): Promise<GetDifficultyResult>;
|
|
64
66
|
validateAddress(params: ValidateAddressParams): Promise<ValidateAddressResult>;
|
|
65
67
|
extractKeyFromAddress(params: ExtractKeyFromAddressParams): Promise<string | number[]>;
|
|
66
|
-
|
|
68
|
+
getMinerWork(params: GetMinerWorkParams): Promise<GetMinerWorkResult>;
|
|
67
69
|
}
|
|
68
70
|
export declare class WS extends BaseWS {
|
|
69
71
|
methods: DaemonMethods;
|
|
@@ -20,9 +20,7 @@ export interface BuildTransactionParams {
|
|
|
20
20
|
fee?: FeeBuilder;
|
|
21
21
|
tx_as_hex: boolean;
|
|
22
22
|
}
|
|
23
|
-
export interface BuildTransactionResult {
|
|
24
|
-
hash: string;
|
|
25
|
-
data: Transaction;
|
|
23
|
+
export interface BuildTransactionResult extends Transaction {
|
|
26
24
|
txt_as_hex?: string;
|
|
27
25
|
}
|
|
28
26
|
export interface ListTransactionParams {
|
package/package.json
CHANGED