@waves/node-api-js 1.3.10 → 1.4.0-snapshot.1
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/cjs/api-node/activation/index.d.ts +2 -1
- package/cjs/api-node/activation/index.js +2 -3
- package/cjs/api-node/activation/index.js.map +1 -1
- package/cjs/api-node/addresses/index.d.ts +4 -4
- package/cjs/api-node/addresses/index.js +68 -55
- package/cjs/api-node/addresses/index.js.map +1 -1
- package/cjs/api-node/alias/index.d.ts +1 -1
- package/cjs/api-node/alias/index.js +6 -7
- package/cjs/api-node/alias/index.js.map +1 -1
- package/cjs/api-node/assets/index.d.ts +4 -4
- package/cjs/api-node/assets/index.js +24 -25
- package/cjs/api-node/assets/index.js.map +1 -1
- package/cjs/api-node/blocks/index.d.ts +14 -7
- package/cjs/api-node/blocks/index.js +36 -51
- package/cjs/api-node/blocks/index.js.map +1 -1
- package/cjs/api-node/debug/index.d.ts +2 -2
- package/cjs/api-node/debug/index.js +56 -43
- package/cjs/api-node/debug/index.js.map +1 -1
- package/cjs/api-node/eth/index.js +3 -4
- package/cjs/api-node/eth/index.js.map +1 -1
- package/cjs/api-node/finalization/index.d.ts +54 -0
- package/cjs/api-node/finalization/index.js +126 -0
- package/cjs/api-node/finalization/index.js.map +1 -0
- package/cjs/api-node/leasing/index.js +7 -7
- package/cjs/api-node/leasing/index.js.map +1 -1
- package/cjs/api-node/node/index.js +4 -5
- package/cjs/api-node/node/index.js.map +1 -1
- package/cjs/api-node/peers/index.js +8 -9
- package/cjs/api-node/peers/index.js.map +1 -1
- package/cjs/api-node/rewards/index.d.ts +1 -1
- package/cjs/api-node/rewards/index.js +3 -4
- package/cjs/api-node/rewards/index.js.map +1 -1
- package/cjs/api-node/transactions/index.d.ts +1 -1
- package/cjs/api-node/transactions/index.js +26 -27
- package/cjs/api-node/transactions/index.js.map +1 -1
- package/cjs/api-node/utils/index.js +29 -30
- package/cjs/api-node/utils/index.js.map +1 -1
- package/cjs/constants.d.ts +1 -1
- package/cjs/create.d.ts +17 -1168
- package/cjs/create.js +30 -10
- package/cjs/create.js.map +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +4 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interface.d.ts +6 -6
- package/cjs/interface.js +4 -2
- package/cjs/interface.js.map +1 -1
- package/cjs/nodeInteraction.d.ts +34 -0
- package/cjs/nodeInteraction.js +266 -0
- package/cjs/nodeInteraction.js.map +1 -0
- package/cjs/tools/adresses/availableSponsoredBalances.d.ts +1 -1
- package/cjs/tools/adresses/availableSponsoredBalances.js +2 -2
- package/cjs/tools/adresses/availableSponsoredBalances.js.map +1 -1
- package/cjs/tools/adresses/ethAddress2waves.js +15 -10
- package/cjs/tools/adresses/ethAddress2waves.js.map +1 -1
- package/cjs/tools/adresses/getAssetIdListByTx.js +12 -7
- package/cjs/tools/adresses/getAssetIdListByTx.js.map +1 -1
- package/cjs/tools/adresses/getAssetsByTransaction.js +3 -3
- package/cjs/tools/adresses/getAssetsByTransaction.js.map +1 -1
- package/cjs/tools/adresses/getTransactionsWithAssets.js +3 -3
- package/cjs/tools/adresses/getTransactionsWithAssets.js.map +1 -1
- package/cjs/tools/adresses/watch.d.ts +8 -5
- package/cjs/tools/adresses/watch.js +56 -16
- package/cjs/tools/adresses/watch.js.map +1 -1
- package/cjs/tools/adresses/wavesAddress2eth.js +3 -3
- package/cjs/tools/adresses/wavesAddress2eth.js.map +1 -1
- package/cjs/tools/assets/wavesAsset2eth.js +3 -3
- package/cjs/tools/assets/wavesAsset2eth.js.map +1 -1
- package/cjs/tools/blocks/detectInterval.js +3 -3
- package/cjs/tools/blocks/detectInterval.js.map +1 -1
- package/cjs/tools/blocks/getNetworkByte.js +2 -2
- package/cjs/tools/blocks/getNetworkByte.js.map +1 -1
- package/cjs/tools/blocks/getNetworkCode.js +2 -2
- package/cjs/tools/blocks/getNetworkCode.js.map +1 -1
- package/cjs/tools/blocks/waitHeight.js +5 -5
- package/cjs/tools/blocks/waitHeight.js.map +1 -1
- package/cjs/tools/matcher/order.d.ts +17 -0
- package/cjs/tools/matcher/order.js +27 -0
- package/cjs/tools/matcher/order.js.map +1 -0
- package/cjs/tools/parse.js +1 -1
- package/cjs/tools/parse.js.map +1 -1
- package/cjs/tools/query.d.ts +1 -1
- package/cjs/tools/query.js +3 -3
- package/cjs/tools/query.js.map +1 -1
- package/cjs/tools/request.d.ts +1 -57
- package/cjs/tools/request.js +48 -6
- package/cjs/tools/request.js.map +1 -1
- package/cjs/tools/resolve.js +1 -1
- package/cjs/tools/resolve.js.map +1 -1
- package/cjs/tools/stringify.js +3 -3
- package/cjs/tools/stringify.js.map +1 -1
- package/cjs/tools/transactions/broadcast.d.ts +2 -2
- package/cjs/tools/transactions/broadcast.js +8 -8
- package/cjs/tools/transactions/broadcast.js.map +1 -1
- package/cjs/tools/transactions/ethTxId2waves.js +2 -2
- package/cjs/tools/transactions/ethTxId2waves.js.map +1 -1
- package/cjs/tools/transactions/wait.js +5 -5
- package/cjs/tools/transactions/wait.js.map +1 -1
- package/cjs/tools/utils.d.ts +7 -7
- package/cjs/tools/utils.js +30 -23
- package/cjs/tools/utils.js.map +1 -1
- package/package.json +34 -35
- package/dist/node-api.js +0 -30492
- package/dist/node-api.min.js +0 -26
- package/es/api-node/activation/index.d.ts +0 -21
- package/es/api-node/activation/index.js +0 -13
- package/es/api-node/activation/index.js.map +0 -1
- package/es/api-node/addresses/index.d.ts +0 -81
- package/es/api-node/addresses/index.js +0 -111
- package/es/api-node/addresses/index.js.map +0 -1
- package/es/api-node/alias/index.d.ts +0 -6
- package/es/api-node/alias/index.js +0 -14
- package/es/api-node/alias/index.js.map +0 -1
- package/es/api-node/assets/index.d.ts +0 -79
- package/es/api-node/assets/index.js +0 -103
- package/es/api-node/assets/index.js.map +0 -1
- package/es/api-node/blocks/index.d.ts +0 -143
- package/es/api-node/blocks/index.js +0 -179
- package/es/api-node/blocks/index.js.map +0 -1
- package/es/api-node/debug/index.d.ts +0 -189
- package/es/api-node/debug/index.js +0 -201
- package/es/api-node/debug/index.js.map +0 -1
- package/es/api-node/eth/index.d.ts +0 -3
- package/es/api-node/eth/index.js +0 -8
- package/es/api-node/eth/index.js.map +0 -1
- package/es/api-node/leasing/index.d.ts +0 -22
- package/es/api-node/leasing/index.js +0 -22
- package/es/api-node/leasing/index.js.map +0 -1
- package/es/api-node/node/index.d.ts +0 -11
- package/es/api-node/node/index.js +0 -10
- package/es/api-node/node/index.js.map +0 -1
- package/es/api-node/peers/index.d.ts +0 -46
- package/es/api-node/peers/index.js +0 -46
- package/es/api-node/peers/index.js.map +0 -1
- package/es/api-node/rewards/index.d.ts +0 -21
- package/es/api-node/rewards/index.js +0 -13
- package/es/api-node/rewards/index.js.map +0 -1
- package/es/api-node/transactions/index.d.ts +0 -73
- package/es/api-node/transactions/index.js +0 -137
- package/es/api-node/transactions/index.js.map +0 -1
- package/es/api-node/utils/index.d.ts +0 -110
- package/es/api-node/utils/index.js +0 -193
- package/es/api-node/utils/index.js.map +0 -1
- package/es/api-node/wallet/index.d.ts +0 -5
- package/es/api-node/wallet/index.js +0 -7
- package/es/api-node/wallet/index.js.map +0 -1
- package/es/constants.d.ts +0 -40
- package/es/constants.js +0 -40
- package/es/constants.js.map +0 -1
- package/es/create.d.ts +0 -1238
- package/es/create.js +0 -90
- package/es/create.js.map +0 -1
- package/es/index.d.ts +0 -9
- package/es/index.js +0 -9
- package/es/index.js.map +0 -1
- package/es/interface.d.ts +0 -44
- package/es/interface.js +0 -3
- package/es/interface.js.map +0 -1
- package/es/tools/adresses/availableSponsoredBalances.d.ts +0 -7
- package/es/tools/adresses/availableSponsoredBalances.js +0 -27
- package/es/tools/adresses/availableSponsoredBalances.js.map +0 -1
- package/es/tools/adresses/ethAddress2waves.d.ts +0 -1
- package/es/tools/adresses/ethAddress2waves.js +0 -31
- package/es/tools/adresses/ethAddress2waves.js.map +0 -1
- package/es/tools/adresses/getAssetIdListByTx.d.ts +0 -2
- package/es/tools/adresses/getAssetIdListByTx.js +0 -24
- package/es/tools/adresses/getAssetIdListByTx.js.map +0 -1
- package/es/tools/adresses/getAssetsByTransaction.d.ts +0 -3
- package/es/tools/adresses/getAssetsByTransaction.js +0 -8
- package/es/tools/adresses/getAssetsByTransaction.js.map +0 -1
- package/es/tools/adresses/getTransactionsWithAssets.d.ts +0 -6
- package/es/tools/adresses/getTransactionsWithAssets.js +0 -7
- package/es/tools/adresses/getTransactionsWithAssets.js.map +0 -1
- package/es/tools/adresses/watch.d.ts +0 -24
- package/es/tools/adresses/watch.js +0 -134
- package/es/tools/adresses/watch.js.map +0 -1
- package/es/tools/adresses/wavesAddress2eth.d.ts +0 -1
- package/es/tools/adresses/wavesAddress2eth.js +0 -7
- package/es/tools/adresses/wavesAddress2eth.js.map +0 -1
- package/es/tools/assets/wavesAsset2eth.d.ts +0 -1
- package/es/tools/assets/wavesAsset2eth.js +0 -7
- package/es/tools/assets/wavesAsset2eth.js.map +0 -1
- package/es/tools/blocks/detectInterval.d.ts +0 -1
- package/es/tools/blocks/detectInterval.js +0 -9
- package/es/tools/blocks/detectInterval.js.map +0 -1
- package/es/tools/blocks/getNetworkByte.d.ts +0 -1
- package/es/tools/blocks/getNetworkByte.js +0 -51
- package/es/tools/blocks/getNetworkByte.js.map +0 -1
- package/es/tools/blocks/getNetworkCode.d.ts +0 -1
- package/es/tools/blocks/getNetworkCode.js +0 -5
- package/es/tools/blocks/getNetworkCode.js.map +0 -1
- package/es/tools/blocks/waitHeight.d.ts +0 -3
- package/es/tools/blocks/waitHeight.js +0 -36
- package/es/tools/blocks/waitHeight.js.map +0 -1
- package/es/tools/parse.d.ts +0 -1
- package/es/tools/parse.js +0 -5
- package/es/tools/parse.js.map +0 -1
- package/es/tools/query.d.ts +0 -4
- package/es/tools/query.js +0 -12
- package/es/tools/query.js.map +0 -1
- package/es/tools/request.d.ts +0 -64
- package/es/tools/request.js +0 -22
- package/es/tools/request.js.map +0 -1
- package/es/tools/resolve.d.ts +0 -1
- package/es/tools/resolve.js +0 -4
- package/es/tools/resolve.js.map +0 -1
- package/es/tools/stringify.d.ts +0 -1
- package/es/tools/stringify.js +0 -18
- package/es/tools/stringify.js.map +0 -1
- package/es/tools/transactions/broadcast.d.ts +0 -14
- package/es/tools/transactions/broadcast.js +0 -43
- package/es/tools/transactions/broadcast.js.map +0 -1
- package/es/tools/transactions/ethTxId2waves.d.ts +0 -1
- package/es/tools/transactions/ethTxId2waves.js +0 -8
- package/es/tools/transactions/ethTxId2waves.js.map +0 -1
- package/es/tools/transactions/wait.d.ts +0 -10
- package/es/tools/transactions/wait.js +0 -39
- package/es/tools/transactions/wait.js.map +0 -1
- package/es/tools/utils.d.ts +0 -32
- package/es/tools/utils.js +0 -73
- package/es/tools/utils.js.map +0 -1
|
@@ -3,7 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.fetchHeadersSeq = fetchHeadersSeq;
|
|
7
|
+
exports.fetchHeadersLast = fetchHeadersLast;
|
|
8
|
+
exports.fetchHeightById = fetchHeightById;
|
|
9
|
+
exports.fetchHeadersAt = fetchHeadersAt;
|
|
10
|
+
exports.fetchHeadersById = fetchHeadersById;
|
|
11
|
+
exports.fetchBlockAt = fetchBlockAt;
|
|
12
|
+
exports.fetchSeq = fetchSeq;
|
|
13
|
+
exports.fetchBlockById = fetchBlockById;
|
|
14
|
+
exports.fetchBlocksByAddress = fetchBlocksByAddress;
|
|
15
|
+
exports.fetchLast = fetchLast;
|
|
16
|
+
exports.fetchDelay = fetchDelay;
|
|
17
|
+
exports.fetchHeight = fetchHeight;
|
|
18
|
+
exports.fetchHeightByTimestamp = fetchHeightByTimestamp;
|
|
7
19
|
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
20
|
/**
|
|
9
21
|
* GET /blocks/headers/seq/{from}/{to}
|
|
@@ -14,13 +26,12 @@ var request_1 = __importDefault(require("../../tools/request"));
|
|
|
14
26
|
*/
|
|
15
27
|
function fetchHeadersSeq(base, from, to, options) {
|
|
16
28
|
if (options === void 0) { options = Object.create(null); }
|
|
17
|
-
return request_1.default({
|
|
29
|
+
return (0, request_1.default)({
|
|
18
30
|
base: base,
|
|
19
|
-
url: "/blocks/headers/seq/"
|
|
31
|
+
url: "/blocks/headers/seq/".concat(from, "/").concat(to),
|
|
20
32
|
options: options
|
|
21
33
|
});
|
|
22
34
|
}
|
|
23
|
-
exports.fetchHeadersSeq = fetchHeadersSeq;
|
|
24
35
|
/**
|
|
25
36
|
* GET /blocks/headers/last
|
|
26
37
|
* Last block header
|
|
@@ -28,13 +39,12 @@ exports.fetchHeadersSeq = fetchHeadersSeq;
|
|
|
28
39
|
*/
|
|
29
40
|
function fetchHeadersLast(base, options) {
|
|
30
41
|
if (options === void 0) { options = Object.create(null); }
|
|
31
|
-
return request_1.default({
|
|
42
|
+
return (0, request_1.default)({
|
|
32
43
|
base: base,
|
|
33
44
|
url: "/blocks/headers/last",
|
|
34
45
|
options: options
|
|
35
46
|
});
|
|
36
47
|
}
|
|
37
|
-
exports.fetchHeadersLast = fetchHeadersLast;
|
|
38
48
|
/**
|
|
39
49
|
* GET /blocks/height/{id}
|
|
40
50
|
* Height of a block by its id
|
|
@@ -42,12 +52,11 @@ exports.fetchHeadersLast = fetchHeadersLast;
|
|
|
42
52
|
* @param id
|
|
43
53
|
*/
|
|
44
54
|
function fetchHeightById(base, id) {
|
|
45
|
-
return request_1.default({
|
|
55
|
+
return (0, request_1.default)({
|
|
46
56
|
base: base,
|
|
47
|
-
url: "/blocks/height/"
|
|
57
|
+
url: "/blocks/height/".concat(id)
|
|
48
58
|
});
|
|
49
59
|
}
|
|
50
|
-
exports.fetchHeightById = fetchHeightById;
|
|
51
60
|
/**
|
|
52
61
|
* GET /blocks/headers/at/{height}
|
|
53
62
|
* Block header at height
|
|
@@ -56,13 +65,12 @@ exports.fetchHeightById = fetchHeightById;
|
|
|
56
65
|
*/
|
|
57
66
|
function fetchHeadersAt(base, height, options) {
|
|
58
67
|
if (options === void 0) { options = Object.create(null); }
|
|
59
|
-
return request_1.default({
|
|
68
|
+
return (0, request_1.default)({
|
|
60
69
|
base: base,
|
|
61
|
-
url: "/blocks/headers/at/"
|
|
70
|
+
url: "/blocks/headers/at/".concat(height),
|
|
62
71
|
options: options
|
|
63
72
|
});
|
|
64
73
|
}
|
|
65
|
-
exports.fetchHeadersAt = fetchHeadersAt;
|
|
66
74
|
/**
|
|
67
75
|
* GET /blocks/headers/{id}
|
|
68
76
|
* Get block at specified height
|
|
@@ -71,13 +79,12 @@ exports.fetchHeadersAt = fetchHeadersAt;
|
|
|
71
79
|
*/
|
|
72
80
|
function fetchHeadersById(base, id, options) {
|
|
73
81
|
if (options === void 0) { options = Object.create(null); }
|
|
74
|
-
return request_1.default({
|
|
82
|
+
return (0, request_1.default)({
|
|
75
83
|
base: base,
|
|
76
|
-
url: "/blocks/headers/"
|
|
84
|
+
url: "/blocks/headers/".concat(id),
|
|
77
85
|
options: options
|
|
78
86
|
});
|
|
79
87
|
}
|
|
80
|
-
exports.fetchHeadersById = fetchHeadersById;
|
|
81
88
|
/**
|
|
82
89
|
* GET /blocks/at/{height}
|
|
83
90
|
* Get block at specified height
|
|
@@ -86,13 +93,12 @@ exports.fetchHeadersById = fetchHeadersById;
|
|
|
86
93
|
*/
|
|
87
94
|
function fetchBlockAt(base, height, options) {
|
|
88
95
|
if (options === void 0) { options = Object.create(null); }
|
|
89
|
-
return request_1.default({
|
|
96
|
+
return (0, request_1.default)({
|
|
90
97
|
base: base,
|
|
91
|
-
url: "/blocks/at/"
|
|
98
|
+
url: "/blocks/at/".concat(height),
|
|
92
99
|
options: options
|
|
93
100
|
});
|
|
94
101
|
}
|
|
95
|
-
exports.fetchBlockAt = fetchBlockAt;
|
|
96
102
|
/**
|
|
97
103
|
* GET /blocks/seq/{from}/{to}
|
|
98
104
|
* Block range
|
|
@@ -102,13 +108,12 @@ exports.fetchBlockAt = fetchBlockAt;
|
|
|
102
108
|
*/
|
|
103
109
|
function fetchSeq(base, from, to, options) {
|
|
104
110
|
if (options === void 0) { options = Object.create(null); }
|
|
105
|
-
return request_1.default({
|
|
111
|
+
return (0, request_1.default)({
|
|
106
112
|
base: base,
|
|
107
|
-
url: "/blocks/seq/"
|
|
113
|
+
url: "/blocks/seq/".concat(from, "/").concat(to),
|
|
108
114
|
options: options
|
|
109
115
|
});
|
|
110
116
|
}
|
|
111
|
-
exports.fetchSeq = fetchSeq;
|
|
112
117
|
/**
|
|
113
118
|
* GET /blocks/{id}
|
|
114
119
|
* Get block by its id
|
|
@@ -117,27 +122,12 @@ exports.fetchSeq = fetchSeq;
|
|
|
117
122
|
*/
|
|
118
123
|
function fetchBlockById(base, id, options) {
|
|
119
124
|
if (options === void 0) { options = Object.create(null); }
|
|
120
|
-
return request_1.default({
|
|
125
|
+
return (0, request_1.default)({
|
|
121
126
|
base: base,
|
|
122
|
-
url: "/blocks/"
|
|
127
|
+
url: "/blocks/".concat(id),
|
|
123
128
|
options: options
|
|
124
129
|
});
|
|
125
130
|
}
|
|
126
|
-
exports.fetchBlockById = fetchBlockById;
|
|
127
|
-
/**
|
|
128
|
-
* GET /blocks/first
|
|
129
|
-
* Get genesis block
|
|
130
|
-
* @param base
|
|
131
|
-
*/
|
|
132
|
-
function fetchFirst(base, options) {
|
|
133
|
-
if (options === void 0) { options = Object.create(null); }
|
|
134
|
-
return request_1.default({
|
|
135
|
-
base: base,
|
|
136
|
-
url: "/blocks/first",
|
|
137
|
-
options: options
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
exports.fetchFirst = fetchFirst;
|
|
141
131
|
/**
|
|
142
132
|
* /blocks/address/{address}/{from}/{to}
|
|
143
133
|
* Get list of blocks generated by specified address
|
|
@@ -148,13 +138,12 @@ exports.fetchFirst = fetchFirst;
|
|
|
148
138
|
*/
|
|
149
139
|
function fetchBlocksByAddress(base, address, from, to, options) {
|
|
150
140
|
if (options === void 0) { options = Object.create(null); }
|
|
151
|
-
return request_1.default({
|
|
141
|
+
return (0, request_1.default)({
|
|
152
142
|
base: base,
|
|
153
|
-
url: "/blocks/address/"
|
|
143
|
+
url: "/blocks/address/".concat(address, "/").concat(from, "/").concat(to),
|
|
154
144
|
options: options
|
|
155
145
|
});
|
|
156
146
|
}
|
|
157
|
-
exports.fetchBlocksByAddress = fetchBlocksByAddress;
|
|
158
147
|
/**
|
|
159
148
|
* GET /blocks/last
|
|
160
149
|
* Last block
|
|
@@ -162,13 +151,12 @@ exports.fetchBlocksByAddress = fetchBlocksByAddress;
|
|
|
162
151
|
*/
|
|
163
152
|
function fetchLast(base, options) {
|
|
164
153
|
if (options === void 0) { options = Object.create(null); }
|
|
165
|
-
return request_1.default({
|
|
154
|
+
return (0, request_1.default)({
|
|
166
155
|
base: base,
|
|
167
156
|
url: '/blocks/last',
|
|
168
157
|
options: options
|
|
169
158
|
});
|
|
170
159
|
}
|
|
171
|
-
exports.fetchLast = fetchLast;
|
|
172
160
|
/**
|
|
173
161
|
* GET /blocks/delay/{id}/{blockNum}
|
|
174
162
|
* Average delay in milliseconds between last blockNum blocks starting from block with id
|
|
@@ -177,34 +165,31 @@ exports.fetchLast = fetchLast;
|
|
|
177
165
|
* @param blockNum
|
|
178
166
|
*/
|
|
179
167
|
function fetchDelay(base, id, blockNum) {
|
|
180
|
-
return request_1.default({
|
|
168
|
+
return (0, request_1.default)({
|
|
181
169
|
base: base,
|
|
182
|
-
url: "/blocks/delay/"
|
|
170
|
+
url: "/blocks/delay/".concat(id, "/").concat(blockNum)
|
|
183
171
|
});
|
|
184
172
|
}
|
|
185
|
-
exports.fetchDelay = fetchDelay;
|
|
186
173
|
/**
|
|
187
174
|
* GET /blocks/height
|
|
188
175
|
* @param base
|
|
189
176
|
*/
|
|
190
177
|
function fetchHeight(base) {
|
|
191
|
-
return request_1.default({
|
|
178
|
+
return (0, request_1.default)({
|
|
192
179
|
base: base,
|
|
193
180
|
url: '/blocks/height'
|
|
194
181
|
});
|
|
195
182
|
}
|
|
196
|
-
exports.fetchHeight = fetchHeight;
|
|
197
183
|
/**
|
|
198
184
|
* GET /blocks/heightByTimestamp
|
|
199
185
|
* @param base
|
|
200
186
|
*/
|
|
201
187
|
function fetchHeightByTimestamp(base, timestamp, options) {
|
|
202
188
|
if (options === void 0) { options = Object.create(null); }
|
|
203
|
-
return request_1.default({
|
|
189
|
+
return (0, request_1.default)({
|
|
204
190
|
base: base,
|
|
205
|
-
url: "/blocks/heightByTimestamp/"
|
|
191
|
+
url: "/blocks/heightByTimestamp/".concat(timestamp),
|
|
206
192
|
options: options
|
|
207
193
|
});
|
|
208
194
|
}
|
|
209
|
-
exports.fetchHeightByTimestamp = fetchHeightByTimestamp;
|
|
210
195
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/blocks/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/blocks/index.ts"],"names":[],"mappings":";;;;;AAWA,0CAMC;AAOD,4CAMC;AAQD,0CAKC;AAQD,wCAMC;AAQD,4CAMC;AAQD,oCAMC;AASD,4BAMC;AAQD,wCAMC;AAUD,oDAMC;AAOD,8BAMC;AASD,gCAKC;AAMD,kCAKC;AAMD,wDAMC;AAnLD,gEAA0C;AAG1C;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,IAAY,EAAE,IAAY,EAAE,EAAU,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9G,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,8BAAuB,IAAI,cAAI,EAAE,CAAE;QACxC,OAAO,SAAA;KACV,CAAC,CAAA;AACN,CAAC;AAED;;;;GAIG;AAC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AE,wBAAiB,EAAE,cAAI,QAAQ,CAAE;KACzC,CAAC,CAAA;AACN,CAAC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,IAAY;IACpC,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,gBAAgB;KACxB,CAAC,CAAC;AACP,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,IAAY,EAAE,SAAiB,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9G,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,oCAA6B,SAAS,CAAE;QAC7C,OAAO,SAAA;KACV,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -10,11 +10,11 @@ interface IBalanceHistory {
|
|
|
10
10
|
height: number;
|
|
11
11
|
balance: TLong;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type TPayment = {
|
|
14
14
|
assetId: string | null;
|
|
15
15
|
amount: TLong;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type TStateChanges = {
|
|
18
18
|
data: DataTransactionEntry[];
|
|
19
19
|
transfers: {
|
|
20
20
|
address: string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,18 +15,42 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11
15
|
}) : function(o, v) {
|
|
12
16
|
o["default"] = v;
|
|
13
17
|
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
21
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
37
|
};
|
|
24
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
39
|
+
exports.fetchBalanceHistory = fetchBalanceHistory;
|
|
40
|
+
exports.fetchStateChangesByAddress = fetchStateChangesByAddress;
|
|
41
|
+
exports.fetchStateChangesByTxId = fetchStateChangesByTxId;
|
|
42
|
+
exports.postPeerToTheBanList = postPeerToTheBanList;
|
|
43
|
+
exports.fetchConfigInfo = fetchConfigInfo;
|
|
44
|
+
exports.fetchDebugInfo = fetchDebugInfo;
|
|
45
|
+
exports.fetchMinerInfo = fetchMinerInfo;
|
|
46
|
+
exports.fetchPortfolios = fetchPortfolios;
|
|
47
|
+
exports.debugPrint = debugPrint;
|
|
48
|
+
exports.debugRollback = debugRollback;
|
|
49
|
+
exports.debugRollbackTo = debugRollbackTo;
|
|
50
|
+
exports.debugState = debugState;
|
|
51
|
+
exports.debugStateHash = debugStateHash;
|
|
52
|
+
exports.debugStateWaves = debugStateWaves;
|
|
53
|
+
exports.debugValidate = debugValidate;
|
|
26
54
|
var request_1 = __importStar(require("../../tools/request"));
|
|
27
55
|
var query_1 = __importDefault(require("../../tools/query"));
|
|
28
56
|
/**
|
|
@@ -32,13 +60,12 @@ var query_1 = __importDefault(require("../../tools/query"));
|
|
|
32
60
|
*/
|
|
33
61
|
function fetchBalanceHistory(base, address, options) {
|
|
34
62
|
if (options === void 0) { options = Object.create(null); }
|
|
35
|
-
return request_1.default({
|
|
63
|
+
return (0, request_1.default)({
|
|
36
64
|
base: base,
|
|
37
|
-
url: "/debug/balances/history/"
|
|
65
|
+
url: "/debug/balances/history/".concat(address),
|
|
38
66
|
options: options
|
|
39
67
|
});
|
|
40
68
|
}
|
|
41
|
-
exports.fetchBalanceHistory = fetchBalanceHistory;
|
|
42
69
|
/**
|
|
43
70
|
* Get list of transactions with state changes where specified address has been involved
|
|
44
71
|
* @param base
|
|
@@ -48,13 +75,12 @@ exports.fetchBalanceHistory = fetchBalanceHistory;
|
|
|
48
75
|
*/
|
|
49
76
|
function fetchStateChangesByAddress(base, address, limit, after, options) {
|
|
50
77
|
if (options === void 0) { options = Object.create(null); }
|
|
51
|
-
return request_1.default({
|
|
78
|
+
return (0, request_1.default)({
|
|
52
79
|
base: base,
|
|
53
|
-
url: "/debug/stateChanges/address/"
|
|
80
|
+
url: "/debug/stateChanges/address/".concat(address, "/limit/").concat(limit).concat((0, query_1.default)({ after: after })),
|
|
54
81
|
options: options
|
|
55
82
|
});
|
|
56
83
|
}
|
|
57
|
-
exports.fetchStateChangesByAddress = fetchStateChangesByAddress;
|
|
58
84
|
/**
|
|
59
85
|
* Get invokeScript transaction state changes
|
|
60
86
|
* @param base
|
|
@@ -62,15 +88,14 @@ exports.fetchStateChangesByAddress = fetchStateChangesByAddress;
|
|
|
62
88
|
*/
|
|
63
89
|
function fetchStateChangesByTxId(base, txId, options) {
|
|
64
90
|
if (options === void 0) { options = Object.create(null); }
|
|
65
|
-
return request_1.default({
|
|
91
|
+
return (0, request_1.default)({
|
|
66
92
|
base: base,
|
|
67
|
-
url: "/transactions/info/"
|
|
93
|
+
url: "/transactions/info/".concat(txId),
|
|
68
94
|
options: options
|
|
69
95
|
});
|
|
70
96
|
}
|
|
71
|
-
exports.fetchStateChangesByTxId = fetchStateChangesByTxId;
|
|
72
97
|
function postPeerToTheBanList(base, peer) {
|
|
73
|
-
return fetch(base
|
|
98
|
+
return fetch("".concat(base, "/debug/blacklist"), {
|
|
74
99
|
method: "POST",
|
|
75
100
|
body: peer,
|
|
76
101
|
headers: {
|
|
@@ -78,9 +103,8 @@ function postPeerToTheBanList(base, peer) {
|
|
|
78
103
|
}
|
|
79
104
|
}).then(request_1.parseResponse);
|
|
80
105
|
}
|
|
81
|
-
exports.postPeerToTheBanList = postPeerToTheBanList;
|
|
82
106
|
function fetchConfigInfo(base, apiKey) {
|
|
83
|
-
return fetch(base
|
|
107
|
+
return fetch("".concat(base, "/debug/configInfo"), {
|
|
84
108
|
method: "GET",
|
|
85
109
|
headers: {
|
|
86
110
|
"X-API-Key": apiKey,
|
|
@@ -88,9 +112,8 @@ function fetchConfigInfo(base, apiKey) {
|
|
|
88
112
|
}
|
|
89
113
|
}).then(request_1.parseResponse);
|
|
90
114
|
}
|
|
91
|
-
exports.fetchConfigInfo = fetchConfigInfo;
|
|
92
115
|
function fetchDebugInfo(base, apiKey) {
|
|
93
|
-
return fetch(base
|
|
116
|
+
return fetch("".concat(base, "/debug/info"), {
|
|
94
117
|
method: "GET",
|
|
95
118
|
headers: {
|
|
96
119
|
"X-API-Key": apiKey,
|
|
@@ -98,9 +121,8 @@ function fetchDebugInfo(base, apiKey) {
|
|
|
98
121
|
}
|
|
99
122
|
}).then(request_1.parseResponse);
|
|
100
123
|
}
|
|
101
|
-
exports.fetchDebugInfo = fetchDebugInfo;
|
|
102
124
|
function fetchMinerInfo(base, apiKey) {
|
|
103
|
-
return fetch(base
|
|
125
|
+
return fetch("".concat(base, "/debug/minerInfo"), {
|
|
104
126
|
method: "GET",
|
|
105
127
|
headers: {
|
|
106
128
|
"X-API-Key": apiKey,
|
|
@@ -108,9 +130,8 @@ function fetchMinerInfo(base, apiKey) {
|
|
|
108
130
|
}
|
|
109
131
|
}).then(request_1.parseResponse);
|
|
110
132
|
}
|
|
111
|
-
exports.fetchMinerInfo = fetchMinerInfo;
|
|
112
133
|
function fetchPortfolios(base, address, apiKey) {
|
|
113
|
-
return fetch(base
|
|
134
|
+
return fetch("".concat(base, "/debug/portfolios/").concat(address), {
|
|
114
135
|
method: "GET",
|
|
115
136
|
headers: {
|
|
116
137
|
"X-API-Key": apiKey,
|
|
@@ -118,9 +139,8 @@ function fetchPortfolios(base, address, apiKey) {
|
|
|
118
139
|
}
|
|
119
140
|
}).then(request_1.parseResponse);
|
|
120
141
|
}
|
|
121
|
-
exports.fetchPortfolios = fetchPortfolios;
|
|
122
142
|
function debugPrint(base, message, apiKey) {
|
|
123
|
-
return fetch(base
|
|
143
|
+
return fetch("".concat(base, "/debug/print"), {
|
|
124
144
|
method: "POST",
|
|
125
145
|
headers: {
|
|
126
146
|
"X-API-Key": apiKey,
|
|
@@ -129,7 +149,6 @@ function debugPrint(base, message, apiKey) {
|
|
|
129
149
|
body: JSON.stringify({ message: message })
|
|
130
150
|
}).then(request_1.parseResponse);
|
|
131
151
|
}
|
|
132
|
-
exports.debugPrint = debugPrint;
|
|
133
152
|
/**
|
|
134
153
|
* Removes all blocks after a given height. Max number of blocks back from the current height is set by waves.db.max-rollback-depth, 2000 by default
|
|
135
154
|
* @param base
|
|
@@ -138,7 +157,7 @@ exports.debugPrint = debugPrint;
|
|
|
138
157
|
* @param apiKey
|
|
139
158
|
*/
|
|
140
159
|
function debugRollback(base, height, returnTransactionsToUtx, apiKey) {
|
|
141
|
-
return fetch(base
|
|
160
|
+
return fetch("".concat(base, "/debug/rollback"), {
|
|
142
161
|
method: "POST",
|
|
143
162
|
headers: {
|
|
144
163
|
"X-API-Key": apiKey,
|
|
@@ -150,7 +169,6 @@ function debugRollback(base, height, returnTransactionsToUtx, apiKey) {
|
|
|
150
169
|
})
|
|
151
170
|
}).then(request_1.parseResponse);
|
|
152
171
|
}
|
|
153
|
-
exports.debugRollback = debugRollback;
|
|
154
172
|
/**
|
|
155
173
|
* Rollback the state to the block with a given ID
|
|
156
174
|
* @param base
|
|
@@ -159,7 +177,7 @@ exports.debugRollback = debugRollback;
|
|
|
159
177
|
* @param apiKey
|
|
160
178
|
*/
|
|
161
179
|
function debugRollbackTo(base, id, apiKey) {
|
|
162
|
-
return fetch(base
|
|
180
|
+
return fetch("".concat(base, "/debug/rollback-to/").concat(id), {
|
|
163
181
|
method: "DELETE",
|
|
164
182
|
headers: {
|
|
165
183
|
"X-API-Key": apiKey,
|
|
@@ -167,14 +185,13 @@ function debugRollbackTo(base, id, apiKey) {
|
|
|
167
185
|
},
|
|
168
186
|
}).then(request_1.parseResponse);
|
|
169
187
|
}
|
|
170
|
-
exports.debugRollbackTo = debugRollbackTo;
|
|
171
188
|
/**
|
|
172
189
|
* Regular address balance at the current height
|
|
173
190
|
* @param base
|
|
174
191
|
* @param apiKey
|
|
175
192
|
*/
|
|
176
193
|
function debugState(base, apiKey) {
|
|
177
|
-
return fetch(base
|
|
194
|
+
return fetch("".concat(base, "/debug/state"), {
|
|
178
195
|
method: "GET",
|
|
179
196
|
headers: {
|
|
180
197
|
"X-API-Key": apiKey,
|
|
@@ -182,7 +199,6 @@ function debugState(base, apiKey) {
|
|
|
182
199
|
},
|
|
183
200
|
}).then(request_1.parseResponse);
|
|
184
201
|
}
|
|
185
|
-
exports.debugState = debugState;
|
|
186
202
|
/**
|
|
187
203
|
* Get state hash at height. Available only if node configuration contains waves.db.store-state-hashes = true option
|
|
188
204
|
* @param base
|
|
@@ -190,13 +206,12 @@ exports.debugState = debugState;
|
|
|
190
206
|
*/
|
|
191
207
|
function debugStateHash(base, height, options) {
|
|
192
208
|
if (options === void 0) { options = Object.create(null); }
|
|
193
|
-
return request_1.default({
|
|
209
|
+
return (0, request_1.default)({
|
|
194
210
|
base: base,
|
|
195
|
-
url: "/debug/stateHash/"
|
|
211
|
+
url: "/debug/stateHash/".concat(height),
|
|
196
212
|
options: options
|
|
197
213
|
});
|
|
198
214
|
}
|
|
199
|
-
exports.debugStateHash = debugStateHash;
|
|
200
215
|
/**
|
|
201
216
|
* Regular address balance at the height. Max number of blocks back from the current height is set by waves.db.max-rollback-depth, 2000 by default
|
|
202
217
|
* @param base
|
|
@@ -204,7 +219,7 @@ exports.debugStateHash = debugStateHash;
|
|
|
204
219
|
* @param apiKey
|
|
205
220
|
*/
|
|
206
221
|
function debugStateWaves(base, height, apiKey) {
|
|
207
|
-
return fetch(base
|
|
222
|
+
return fetch("".concat(base, "/debug/stateWaves/").concat(height), {
|
|
208
223
|
method: "GET",
|
|
209
224
|
headers: {
|
|
210
225
|
"X-API-Key": apiKey,
|
|
@@ -212,14 +227,13 @@ function debugStateWaves(base, height, apiKey) {
|
|
|
212
227
|
},
|
|
213
228
|
}).then(request_1.parseResponse);
|
|
214
229
|
}
|
|
215
|
-
exports.debugStateWaves = debugStateWaves;
|
|
216
230
|
/**
|
|
217
231
|
* Validates a transaction and measures time spent in milliseconds. You should use the JSON transaction format with proofs
|
|
218
232
|
* @param base
|
|
219
233
|
* @param transaction
|
|
220
234
|
*/
|
|
221
235
|
function debugValidate(base, transaction) {
|
|
222
|
-
return fetch(base
|
|
236
|
+
return fetch("".concat(base, "/debug/validate"), {
|
|
223
237
|
method: "POST",
|
|
224
238
|
headers: {
|
|
225
239
|
"Content-Type": "application/json"
|
|
@@ -227,7 +241,6 @@ function debugValidate(base, transaction) {
|
|
|
227
241
|
body: transaction
|
|
228
242
|
}).then(request_1.parseResponse);
|
|
229
243
|
}
|
|
230
|
-
exports.debugValidate = debugValidate;
|
|
231
244
|
// @TODO need API key:
|
|
232
245
|
// GET /debug/stateWaves/{height}
|
|
233
246
|
// POST /debug/rollback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/debug/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/debug/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,kDAMC;AA0ED,gEAYC;AAQD,0DAMC;AAGD,oDAQC;AAGD,0CAQC;AAGD,wCAQC;AAED,wCAQC;AAED,0CAQC;AAED,gCASC;AASD,sCAYC;AASD,0CAQC;AAOD,gCAQC;AAQD,wCAMC;AASD,0CAQC;AAOD,sCAQC;AAvRD,6DAA2D;AAE3D,4DAAsC;AAGtC;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,IAAY,EAAE,OAAe,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACzG,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,kCAA2B,OAAO,CAAE;QACzC,OAAO,SAAA;KACV,CAAC,CAAC;AACP,CAAC;AAmED;;;;;;GAMG;AACH,SAAgB,0BAA0B,CACtC,IAAY,EACZ,OAAe,EACf,KAAa,EACb,KAAc,EACd,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE1C,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,sCAA+B,OAAO,oBAAU,KAAK,SAAG,IAAA,eAAK,EAAC,EAAC,KAAK,OAAA,EAAC,CAAC,CAAE;QAC7E,OAAO,SAAA;KACV,CAAC,CAAC;AACP,CAAC;AAGD;;;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AAiC;AACjC,uBAAuB;AACvB,iCAAiC;AACjC,kCAAkC;AAClC,uBAAuB;AACvB,yBAAyB;AACzB,yBAAyB;AACzB,kBAAkB;AAClB,uBAAuB;AACvB,8BAA8B;AAC9B,wBAAwB;AACxB,oBAAoB;AACpB,mBAAmB"}
|
|
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchEthAssetDetails =
|
|
6
|
+
exports.fetchEthAssetDetails = fetchEthAssetDetails;
|
|
7
7
|
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
8
|
var utils_1 = require("../../tools/utils");
|
|
9
9
|
var query_1 = __importDefault(require("../../tools/query"));
|
|
10
10
|
function fetchEthAssetDetails(base, ethAssetId) {
|
|
11
|
-
var id = utils_1.toArray(ethAssetId);
|
|
12
|
-
return request_1.default({ base: base, url: "/eth/assets?"
|
|
11
|
+
var id = (0, utils_1.toArray)(ethAssetId);
|
|
12
|
+
return (0, request_1.default)({ base: base, url: "/eth/assets?".concat((0, query_1.default)({ id: id })) }).then(function (list) { return Array.isArray(ethAssetId) ? list : list[0]; });
|
|
13
13
|
}
|
|
14
|
-
exports.fetchEthAssetDetails = fetchEthAssetDetails;
|
|
15
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/eth/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/eth/index.ts"],"names":[],"mappings":";;;;;AAOA,oDAIC;AAXD,gEAA0C;AAE1C,2CAA0C;AAC1C,4DAAsC;AAItC,SAAgB,oBAAoB,CAAC,IAAY,EAAE,UAA6B;IAC5E,IAAM,EAAE,GAAG,IAAA,eAAO,EAAC,UAAU,CAAC,CAAA;IAE9B,OAAO,IAAA,iBAAO,EAAuB,EAAC,IAAI,MAAA,EAAE,GAAG,EAAE,sBAAe,IAAA,eAAK,EAAC,EAAC,EAAE,IAAA,EAAC,CAAC,CAAE,EAAC,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAA1C,CAA0C,CAAC,CAAC;AAC7I,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TLong } from '../../interface';
|
|
2
|
+
import { IBlockHeader } from '../blocks';
|
|
3
|
+
/**
|
|
4
|
+
* GET /blocks/headers/finalized
|
|
5
|
+
* Last finalized block header
|
|
6
|
+
* @param base
|
|
7
|
+
*/
|
|
8
|
+
export declare function fetchFinalized(base: string, options?: RequestInit): Promise<IBlockHeader>;
|
|
9
|
+
/**
|
|
10
|
+
* GET last finalized block height
|
|
11
|
+
* @param base
|
|
12
|
+
*/
|
|
13
|
+
export declare function fetchFinalizedHeight(base: string): Promise<{
|
|
14
|
+
height: number;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* GET finalized block height at
|
|
18
|
+
* @param base
|
|
19
|
+
* @param height
|
|
20
|
+
*/
|
|
21
|
+
export declare function fetchFinalizedHeightAt(base: string, height: number): Promise<{
|
|
22
|
+
height: number;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* GET /generators/at/{height}
|
|
26
|
+
* Committed generators list at height
|
|
27
|
+
* @param base
|
|
28
|
+
* @param height
|
|
29
|
+
*/
|
|
30
|
+
export declare function fetchComittedGeneratorsAt(base: string, height: number, options?: RequestInit): Promise<Array<ICommittedGenerator>>;
|
|
31
|
+
/**
|
|
32
|
+
* Get committed generator index for provided address.
|
|
33
|
+
* Returns index from 0, or -1 when address is missing in the list.
|
|
34
|
+
* @param base
|
|
35
|
+
* @param height
|
|
36
|
+
* @param address
|
|
37
|
+
*/
|
|
38
|
+
export declare function fetchCommittedGeneratorIndex(base: string, height: number, address: string, options?: RequestInit): Promise<number>;
|
|
39
|
+
/**
|
|
40
|
+
* Calculates commitment period boundaries depends on feature 25 activation.
|
|
41
|
+
* @param base
|
|
42
|
+
* @param periodLength
|
|
43
|
+
*/
|
|
44
|
+
export declare function fetchCommitmentPeriodHeights(base: string, periodLength?: number): Promise<ICommitmentPeriodHeights>;
|
|
45
|
+
export interface ICommittedGenerator {
|
|
46
|
+
address: string;
|
|
47
|
+
balance: TLong;
|
|
48
|
+
transactionId: string;
|
|
49
|
+
conflictHeight?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface ICommitmentPeriodHeights {
|
|
52
|
+
currentPeriodStart: number;
|
|
53
|
+
nextPeriodStart: number;
|
|
54
|
+
}
|