@waves/node-api-js 1.3.0 → 1.3.10-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cjs/api-node/activation/index.d.ts +21 -21
- package/cjs/api-node/activation/index.js +19 -19
- package/cjs/api-node/addresses/index.d.ts +81 -81
- package/cjs/api-node/addresses/index.js +173 -173
- package/cjs/api-node/addresses/index.js.map +1 -1
- package/cjs/api-node/alias/index.d.ts +6 -6
- package/cjs/api-node/alias/index.js +21 -21
- package/cjs/api-node/assets/index.d.ts +79 -79
- package/cjs/api-node/assets/index.js +171 -171
- package/cjs/api-node/blocks/index.d.ts +143 -131
- package/cjs/api-node/blocks/index.js +209 -209
- package/cjs/api-node/consensus/index.d.ts +39 -39
- package/cjs/api-node/consensus/index.js +36 -36
- package/cjs/api-node/debug/index.d.ts +189 -189
- package/cjs/api-node/debug/index.js +244 -244
- package/cjs/api-node/eth/index.d.ts +3 -3
- package/cjs/api-node/eth/index.js +14 -14
- package/cjs/api-node/leasing/index.d.ts +22 -22
- package/cjs/api-node/leasing/index.js +41 -41
- package/cjs/api-node/node/index.d.ts +11 -11
- package/cjs/api-node/node/index.js +19 -19
- package/cjs/api-node/peers/index.d.ts +46 -46
- package/cjs/api-node/peers/index.js +59 -59
- package/cjs/api-node/rewards/index.d.ts +21 -21
- package/cjs/api-node/rewards/index.js +20 -20
- package/cjs/api-node/transactions/index.d.ts +73 -73
- package/cjs/api-node/transactions/index.js +192 -192
- package/cjs/api-node/utils/index.d.ts +110 -110
- package/cjs/api-node/utils/index.js +210 -210
- package/cjs/api-node/wallet/index.d.ts +5 -5
- package/cjs/api-node/wallet/index.js +6 -6
- package/cjs/constants.d.ts +40 -40
- package/cjs/constants.js +42 -42
- package/cjs/create.d.ts +1238 -1240
- package/cjs/create.js +115 -118
- package/cjs/create.js.map +1 -1
- package/cjs/index.d.ts +9 -9
- package/cjs/index.js +17 -17
- package/cjs/interface.d.ts +44 -44
- package/cjs/interface.js +9 -9
- package/cjs/tools/adresses/availableSponsoredBalances.d.ts +7 -7
- package/cjs/tools/adresses/availableSponsoredBalances.js +29 -29
- package/cjs/tools/adresses/ethAddress2waves.d.ts +1 -1
- package/cjs/tools/adresses/ethAddress2waves.js +46 -46
- package/cjs/tools/adresses/getAssetIdListByTx.d.ts +2 -2
- package/cjs/tools/adresses/getAssetIdListByTx.js +47 -47
- package/cjs/tools/adresses/getAssetsByTransaction.d.ts +3 -3
- package/cjs/tools/adresses/getAssetsByTransaction.js +13 -13
- package/cjs/tools/adresses/getTransactionsWithAssets.d.ts +6 -6
- package/cjs/tools/adresses/getTransactionsWithAssets.js +12 -12
- package/cjs/tools/adresses/watch.d.ts +24 -24
- package/cjs/tools/adresses/watch.js +167 -167
- package/cjs/tools/adresses/wavesAddress2eth.d.ts +1 -1
- package/cjs/tools/adresses/wavesAddress2eth.js +9 -9
- package/cjs/tools/assets/wavesAsset2eth.d.ts +1 -1
- package/cjs/tools/assets/wavesAsset2eth.js +9 -9
- package/cjs/tools/blocks/detectInterval.d.ts +1 -1
- package/cjs/tools/blocks/detectInterval.js +11 -11
- package/cjs/tools/blocks/getNetworkByte.d.ts +1 -1
- package/cjs/tools/blocks/getNetworkByte.js +53 -53
- package/cjs/tools/blocks/getNetworkCode.d.ts +1 -1
- package/cjs/tools/blocks/getNetworkCode.js +10 -10
- package/cjs/tools/blocks/waitHeight.d.ts +3 -3
- package/cjs/tools/blocks/waitHeight.js +64 -64
- package/cjs/tools/parse.d.ts +1 -1
- package/cjs/tools/parse.js +7 -7
- package/cjs/tools/query.d.ts +4 -4
- package/cjs/tools/query.js +40 -40
- package/cjs/tools/request.d.ts +64 -64
- package/cjs/tools/request.js +41 -41
- package/cjs/tools/resolve.d.ts +1 -1
- package/cjs/tools/resolve.js +6 -6
- package/cjs/tools/stringify.d.ts +1 -1
- package/cjs/tools/stringify.js +20 -20
- package/cjs/tools/transactions/broadcast.d.ts +14 -14
- package/cjs/tools/transactions/broadcast.js +59 -59
- package/cjs/tools/transactions/ethTxId2waves.d.ts +1 -1
- package/cjs/tools/transactions/ethTxId2waves.js +10 -10
- package/cjs/tools/transactions/wait.d.ts +10 -10
- package/cjs/tools/transactions/wait.js +41 -41
- package/cjs/tools/utils.d.ts +32 -32
- package/cjs/tools/utils.js +117 -117
- package/dist/node-api.js +2368 -2420
- package/dist/node-api.min.js +2 -2
- package/es/api-node/activation/index.d.ts +21 -21
- package/es/api-node/activation/index.js +12 -12
- package/es/api-node/addresses/index.d.ts +81 -81
- package/es/api-node/addresses/index.js +110 -110
- package/es/api-node/addresses/index.js.map +1 -1
- package/es/api-node/alias/index.d.ts +6 -6
- package/es/api-node/alias/index.js +13 -13
- package/es/api-node/assets/index.d.ts +79 -79
- package/es/api-node/assets/index.js +102 -102
- package/es/api-node/blocks/index.d.ts +143 -131
- package/es/api-node/blocks/index.js +178 -178
- package/es/api-node/consensus/index.d.ts +39 -39
- package/es/api-node/consensus/index.js +26 -26
- package/es/api-node/debug/index.d.ts +189 -189
- package/es/api-node/debug/index.js +200 -200
- package/es/api-node/eth/index.d.ts +3 -3
- package/es/api-node/eth/index.js +7 -7
- package/es/api-node/leasing/index.d.ts +22 -22
- package/es/api-node/leasing/index.js +21 -21
- package/es/api-node/node/index.d.ts +11 -11
- package/es/api-node/node/index.js +9 -9
- package/es/api-node/peers/index.d.ts +46 -46
- package/es/api-node/peers/index.js +45 -45
- package/es/api-node/rewards/index.d.ts +21 -21
- package/es/api-node/rewards/index.js +12 -12
- package/es/api-node/transactions/index.d.ts +73 -73
- package/es/api-node/transactions/index.js +136 -136
- package/es/api-node/utils/index.d.ts +110 -110
- package/es/api-node/utils/index.js +192 -192
- package/es/api-node/wallet/index.d.ts +5 -5
- package/es/api-node/wallet/index.js +6 -6
- package/es/constants.d.ts +40 -40
- package/es/constants.js +39 -39
- package/es/create.d.ts +1238 -1240
- package/es/create.js +89 -92
- package/es/create.js.map +1 -1
- package/es/index.d.ts +9 -9
- package/es/index.js +8 -8
- package/es/interface.d.ts +44 -44
- package/es/interface.js +2 -2
- package/es/tools/adresses/availableSponsoredBalances.d.ts +7 -7
- package/es/tools/adresses/availableSponsoredBalances.js +26 -26
- package/es/tools/adresses/ethAddress2waves.d.ts +1 -1
- package/es/tools/adresses/ethAddress2waves.js +30 -30
- package/es/tools/adresses/getAssetIdListByTx.d.ts +2 -2
- package/es/tools/adresses/getAssetIdListByTx.js +23 -23
- package/es/tools/adresses/getAssetsByTransaction.d.ts +3 -3
- package/es/tools/adresses/getAssetsByTransaction.js +7 -7
- package/es/tools/adresses/getTransactionsWithAssets.d.ts +6 -6
- package/es/tools/adresses/getTransactionsWithAssets.js +6 -6
- package/es/tools/adresses/watch.d.ts +24 -24
- package/es/tools/adresses/watch.js +133 -133
- package/es/tools/adresses/wavesAddress2eth.d.ts +1 -1
- package/es/tools/adresses/wavesAddress2eth.js +6 -6
- package/es/tools/assets/wavesAsset2eth.d.ts +1 -1
- package/es/tools/assets/wavesAsset2eth.js +6 -6
- package/es/tools/blocks/detectInterval.d.ts +1 -1
- package/es/tools/blocks/detectInterval.js +8 -8
- package/es/tools/blocks/getNetworkByte.d.ts +1 -1
- package/es/tools/blocks/getNetworkByte.js +50 -50
- package/es/tools/blocks/getNetworkCode.d.ts +1 -1
- package/es/tools/blocks/getNetworkCode.js +4 -4
- package/es/tools/blocks/waitHeight.d.ts +3 -3
- package/es/tools/blocks/waitHeight.js +35 -35
- package/es/tools/parse.d.ts +1 -1
- package/es/tools/parse.js +4 -4
- package/es/tools/query.d.ts +4 -4
- package/es/tools/query.js +11 -11
- package/es/tools/request.d.ts +64 -64
- package/es/tools/request.js +21 -21
- package/es/tools/resolve.d.ts +1 -1
- package/es/tools/resolve.js +3 -3
- package/es/tools/stringify.d.ts +1 -1
- package/es/tools/stringify.js +17 -17
- package/es/tools/transactions/broadcast.d.ts +14 -14
- package/es/tools/transactions/broadcast.js +42 -42
- package/es/tools/transactions/ethTxId2waves.d.ts +1 -1
- package/es/tools/transactions/ethTxId2waves.js +7 -7
- package/es/tools/transactions/wait.d.ts +10 -10
- package/es/tools/transactions/wait.js +38 -38
- package/es/tools/utils.d.ts +32 -32
- package/es/tools/utils.js +72 -72
- package/package.json +66 -66
- package/cjs/tools/transactions/transactions.d.ts +0 -0
- package/cjs/tools/transactions/transactions.js +0 -2
- package/cjs/tools/transactions/transactions.js.map +0 -1
- package/dist/0.node-api.js +0 -467
- package/dist/node-api.min.js.LICENSE.txt +0 -17
- package/dist/node_fs-node_path.node-api.js +0 -23
- package/dist/vendors-node_modules_node-fetch_src_utils_multipart-parser_js.node-api.js +0 -599
- package/es/tools/transactions/transactions.d.ts +0 -0
- package/es/tools/transactions/transactions.js +0 -2
- package/es/tools/transactions/transactions.js.map +0 -1
|
@@ -1,210 +1,210 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchHeightByTimestamp = exports.fetchHeight = exports.fetchDelay = exports.fetchLast = exports.fetchBlocksByAddress = exports.fetchFirst = exports.fetchBlockById = exports.fetchSeq = exports.fetchBlockAt = exports.fetchHeadersById = exports.fetchHeadersAt = exports.fetchHeightById = exports.fetchHeadersLast = exports.fetchHeadersSeq = void 0;
|
|
7
|
-
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
|
-
/**
|
|
9
|
-
* GET /blocks/headers/seq/{from}/{to}
|
|
10
|
-
* Get block headers at specified heights
|
|
11
|
-
* @param base
|
|
12
|
-
* @param from
|
|
13
|
-
* @param to
|
|
14
|
-
*/
|
|
15
|
-
function fetchHeadersSeq(base, from, to, options) {
|
|
16
|
-
if (options === void 0) { options = Object.create(null); }
|
|
17
|
-
return request_1.default({
|
|
18
|
-
base: base,
|
|
19
|
-
url: "/blocks/headers/seq/" + from + "/" + to,
|
|
20
|
-
options: options
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.fetchHeadersSeq = fetchHeadersSeq;
|
|
24
|
-
/**
|
|
25
|
-
* GET /blocks/headers/last
|
|
26
|
-
* Last block header
|
|
27
|
-
* @param base
|
|
28
|
-
*/
|
|
29
|
-
function fetchHeadersLast(base, options) {
|
|
30
|
-
if (options === void 0) { options = Object.create(null); }
|
|
31
|
-
return request_1.default({
|
|
32
|
-
base: base,
|
|
33
|
-
url: "/blocks/headers/last",
|
|
34
|
-
options: options
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
exports.fetchHeadersLast = fetchHeadersLast;
|
|
38
|
-
/**
|
|
39
|
-
* GET /blocks/height/{id}
|
|
40
|
-
* Height of a block by its id
|
|
41
|
-
* @param base
|
|
42
|
-
* @param id
|
|
43
|
-
*/
|
|
44
|
-
function fetchHeightById(base, id) {
|
|
45
|
-
return request_1.default({
|
|
46
|
-
base: base,
|
|
47
|
-
url: "/blocks/height/" + id
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
exports.fetchHeightById = fetchHeightById;
|
|
51
|
-
/**
|
|
52
|
-
* GET /blocks/headers/at/{height}
|
|
53
|
-
* Block header at height
|
|
54
|
-
* @param base
|
|
55
|
-
* @param height
|
|
56
|
-
*/
|
|
57
|
-
function fetchHeadersAt(base, height, options) {
|
|
58
|
-
if (options === void 0) { options = Object.create(null); }
|
|
59
|
-
return request_1.default({
|
|
60
|
-
base: base,
|
|
61
|
-
url: "/blocks/headers/at/" + height,
|
|
62
|
-
options: options
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
exports.fetchHeadersAt = fetchHeadersAt;
|
|
66
|
-
/**
|
|
67
|
-
* GET /blocks/headers/{id}
|
|
68
|
-
* Get block at specified height
|
|
69
|
-
* @param base
|
|
70
|
-
* @param height
|
|
71
|
-
*/
|
|
72
|
-
function fetchHeadersById(base, id, options) {
|
|
73
|
-
if (options === void 0) { options = Object.create(null); }
|
|
74
|
-
return request_1.default({
|
|
75
|
-
base: base,
|
|
76
|
-
url: "/blocks/headers/" + id,
|
|
77
|
-
options: options
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
exports.fetchHeadersById = fetchHeadersById;
|
|
81
|
-
/**
|
|
82
|
-
* GET /blocks/at/{height}
|
|
83
|
-
* Get block at specified height
|
|
84
|
-
* @param base
|
|
85
|
-
* @param height
|
|
86
|
-
*/
|
|
87
|
-
function fetchBlockAt(base, height, options) {
|
|
88
|
-
if (options === void 0) { options = Object.create(null); }
|
|
89
|
-
return request_1.default({
|
|
90
|
-
base: base,
|
|
91
|
-
url: "/blocks/at/" + height,
|
|
92
|
-
options: options
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
exports.fetchBlockAt = fetchBlockAt;
|
|
96
|
-
/**
|
|
97
|
-
* GET /blocks/seq/{from}/{to}
|
|
98
|
-
* Block range
|
|
99
|
-
* @param base
|
|
100
|
-
* @param from
|
|
101
|
-
* @param to
|
|
102
|
-
*/
|
|
103
|
-
function fetchSeq(base, from, to, options) {
|
|
104
|
-
if (options === void 0) { options = Object.create(null); }
|
|
105
|
-
return request_1.default({
|
|
106
|
-
base: base,
|
|
107
|
-
url: "/blocks/seq/" + from + "/" + to,
|
|
108
|
-
options: options
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
exports.fetchSeq = fetchSeq;
|
|
112
|
-
/**
|
|
113
|
-
* GET /blocks/{id}
|
|
114
|
-
* Get block by its id
|
|
115
|
-
* @param base
|
|
116
|
-
* @param id
|
|
117
|
-
*/
|
|
118
|
-
function fetchBlockById(base, id, options) {
|
|
119
|
-
if (options === void 0) { options = Object.create(null); }
|
|
120
|
-
return request_1.default({
|
|
121
|
-
base: base,
|
|
122
|
-
url: "/blocks/" + id,
|
|
123
|
-
options: options
|
|
124
|
-
});
|
|
125
|
-
}
|
|
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
|
-
/**
|
|
142
|
-
* /blocks/address/{address}/{from}/{to}
|
|
143
|
-
* Get list of blocks generated by specified address
|
|
144
|
-
* @param base
|
|
145
|
-
* @param address
|
|
146
|
-
* @param from
|
|
147
|
-
* @param to
|
|
148
|
-
*/
|
|
149
|
-
function fetchBlocksByAddress(base, address, from, to, options) {
|
|
150
|
-
if (options === void 0) { options = Object.create(null); }
|
|
151
|
-
return request_1.default({
|
|
152
|
-
base: base,
|
|
153
|
-
url: "/blocks/address/" + address + "/" + from + "/" + to,
|
|
154
|
-
options: options
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
exports.fetchBlocksByAddress = fetchBlocksByAddress;
|
|
158
|
-
/**
|
|
159
|
-
* GET /blocks/last
|
|
160
|
-
* Last block
|
|
161
|
-
* @param base
|
|
162
|
-
*/
|
|
163
|
-
function fetchLast(base, options) {
|
|
164
|
-
if (options === void 0) { options = Object.create(null); }
|
|
165
|
-
return request_1.default({
|
|
166
|
-
base: base,
|
|
167
|
-
url: '/blocks/last',
|
|
168
|
-
options: options
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
exports.fetchLast = fetchLast;
|
|
172
|
-
/**
|
|
173
|
-
* GET /blocks/delay/{id}/{blockNum}
|
|
174
|
-
* Average delay in milliseconds between last blockNum blocks starting from block with id
|
|
175
|
-
* @param base
|
|
176
|
-
* @param id
|
|
177
|
-
* @param blockNum
|
|
178
|
-
*/
|
|
179
|
-
function fetchDelay(base, id, blockNum) {
|
|
180
|
-
return request_1.default({
|
|
181
|
-
base: base,
|
|
182
|
-
url: "/blocks/delay/" + id + "/" + blockNum
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
exports.fetchDelay = fetchDelay;
|
|
186
|
-
/**
|
|
187
|
-
* GET /blocks/height
|
|
188
|
-
* @param base
|
|
189
|
-
*/
|
|
190
|
-
function fetchHeight(base) {
|
|
191
|
-
return request_1.default({
|
|
192
|
-
base: base,
|
|
193
|
-
url: '/blocks/height'
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
exports.fetchHeight = fetchHeight;
|
|
197
|
-
/**
|
|
198
|
-
* GET /blocks/heightByTimestamp
|
|
199
|
-
* @param base
|
|
200
|
-
*/
|
|
201
|
-
function fetchHeightByTimestamp(base, timestamp, options) {
|
|
202
|
-
if (options === void 0) { options = Object.create(null); }
|
|
203
|
-
return request_1.default({
|
|
204
|
-
base: base,
|
|
205
|
-
url: "/blocks/heightByTimestamp/" + timestamp,
|
|
206
|
-
options: options
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
exports.fetchHeightByTimestamp = fetchHeightByTimestamp;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchHeightByTimestamp = exports.fetchHeight = exports.fetchDelay = exports.fetchLast = exports.fetchBlocksByAddress = exports.fetchFirst = exports.fetchBlockById = exports.fetchSeq = exports.fetchBlockAt = exports.fetchHeadersById = exports.fetchHeadersAt = exports.fetchHeightById = exports.fetchHeadersLast = exports.fetchHeadersSeq = void 0;
|
|
7
|
+
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
|
+
/**
|
|
9
|
+
* GET /blocks/headers/seq/{from}/{to}
|
|
10
|
+
* Get block headers at specified heights
|
|
11
|
+
* @param base
|
|
12
|
+
* @param from
|
|
13
|
+
* @param to
|
|
14
|
+
*/
|
|
15
|
+
function fetchHeadersSeq(base, from, to, options) {
|
|
16
|
+
if (options === void 0) { options = Object.create(null); }
|
|
17
|
+
return request_1.default({
|
|
18
|
+
base: base,
|
|
19
|
+
url: "/blocks/headers/seq/" + from + "/" + to,
|
|
20
|
+
options: options
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.fetchHeadersSeq = fetchHeadersSeq;
|
|
24
|
+
/**
|
|
25
|
+
* GET /blocks/headers/last
|
|
26
|
+
* Last block header
|
|
27
|
+
* @param base
|
|
28
|
+
*/
|
|
29
|
+
function fetchHeadersLast(base, options) {
|
|
30
|
+
if (options === void 0) { options = Object.create(null); }
|
|
31
|
+
return request_1.default({
|
|
32
|
+
base: base,
|
|
33
|
+
url: "/blocks/headers/last",
|
|
34
|
+
options: options
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.fetchHeadersLast = fetchHeadersLast;
|
|
38
|
+
/**
|
|
39
|
+
* GET /blocks/height/{id}
|
|
40
|
+
* Height of a block by its id
|
|
41
|
+
* @param base
|
|
42
|
+
* @param id
|
|
43
|
+
*/
|
|
44
|
+
function fetchHeightById(base, id) {
|
|
45
|
+
return request_1.default({
|
|
46
|
+
base: base,
|
|
47
|
+
url: "/blocks/height/" + id
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
exports.fetchHeightById = fetchHeightById;
|
|
51
|
+
/**
|
|
52
|
+
* GET /blocks/headers/at/{height}
|
|
53
|
+
* Block header at height
|
|
54
|
+
* @param base
|
|
55
|
+
* @param height
|
|
56
|
+
*/
|
|
57
|
+
function fetchHeadersAt(base, height, options) {
|
|
58
|
+
if (options === void 0) { options = Object.create(null); }
|
|
59
|
+
return request_1.default({
|
|
60
|
+
base: base,
|
|
61
|
+
url: "/blocks/headers/at/" + height,
|
|
62
|
+
options: options
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
exports.fetchHeadersAt = fetchHeadersAt;
|
|
66
|
+
/**
|
|
67
|
+
* GET /blocks/headers/{id}
|
|
68
|
+
* Get block at specified height
|
|
69
|
+
* @param base
|
|
70
|
+
* @param height
|
|
71
|
+
*/
|
|
72
|
+
function fetchHeadersById(base, id, options) {
|
|
73
|
+
if (options === void 0) { options = Object.create(null); }
|
|
74
|
+
return request_1.default({
|
|
75
|
+
base: base,
|
|
76
|
+
url: "/blocks/headers/" + id,
|
|
77
|
+
options: options
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
exports.fetchHeadersById = fetchHeadersById;
|
|
81
|
+
/**
|
|
82
|
+
* GET /blocks/at/{height}
|
|
83
|
+
* Get block at specified height
|
|
84
|
+
* @param base
|
|
85
|
+
* @param height
|
|
86
|
+
*/
|
|
87
|
+
function fetchBlockAt(base, height, options) {
|
|
88
|
+
if (options === void 0) { options = Object.create(null); }
|
|
89
|
+
return request_1.default({
|
|
90
|
+
base: base,
|
|
91
|
+
url: "/blocks/at/" + height,
|
|
92
|
+
options: options
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
exports.fetchBlockAt = fetchBlockAt;
|
|
96
|
+
/**
|
|
97
|
+
* GET /blocks/seq/{from}/{to}
|
|
98
|
+
* Block range
|
|
99
|
+
* @param base
|
|
100
|
+
* @param from
|
|
101
|
+
* @param to
|
|
102
|
+
*/
|
|
103
|
+
function fetchSeq(base, from, to, options) {
|
|
104
|
+
if (options === void 0) { options = Object.create(null); }
|
|
105
|
+
return request_1.default({
|
|
106
|
+
base: base,
|
|
107
|
+
url: "/blocks/seq/" + from + "/" + to,
|
|
108
|
+
options: options
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
exports.fetchSeq = fetchSeq;
|
|
112
|
+
/**
|
|
113
|
+
* GET /blocks/{id}
|
|
114
|
+
* Get block by its id
|
|
115
|
+
* @param base
|
|
116
|
+
* @param id
|
|
117
|
+
*/
|
|
118
|
+
function fetchBlockById(base, id, options) {
|
|
119
|
+
if (options === void 0) { options = Object.create(null); }
|
|
120
|
+
return request_1.default({
|
|
121
|
+
base: base,
|
|
122
|
+
url: "/blocks/" + id,
|
|
123
|
+
options: options
|
|
124
|
+
});
|
|
125
|
+
}
|
|
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
|
+
/**
|
|
142
|
+
* /blocks/address/{address}/{from}/{to}
|
|
143
|
+
* Get list of blocks generated by specified address
|
|
144
|
+
* @param base
|
|
145
|
+
* @param address
|
|
146
|
+
* @param from
|
|
147
|
+
* @param to
|
|
148
|
+
*/
|
|
149
|
+
function fetchBlocksByAddress(base, address, from, to, options) {
|
|
150
|
+
if (options === void 0) { options = Object.create(null); }
|
|
151
|
+
return request_1.default({
|
|
152
|
+
base: base,
|
|
153
|
+
url: "/blocks/address/" + address + "/" + from + "/" + to,
|
|
154
|
+
options: options
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
exports.fetchBlocksByAddress = fetchBlocksByAddress;
|
|
158
|
+
/**
|
|
159
|
+
* GET /blocks/last
|
|
160
|
+
* Last block
|
|
161
|
+
* @param base
|
|
162
|
+
*/
|
|
163
|
+
function fetchLast(base, options) {
|
|
164
|
+
if (options === void 0) { options = Object.create(null); }
|
|
165
|
+
return request_1.default({
|
|
166
|
+
base: base,
|
|
167
|
+
url: '/blocks/last',
|
|
168
|
+
options: options
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
exports.fetchLast = fetchLast;
|
|
172
|
+
/**
|
|
173
|
+
* GET /blocks/delay/{id}/{blockNum}
|
|
174
|
+
* Average delay in milliseconds between last blockNum blocks starting from block with id
|
|
175
|
+
* @param base
|
|
176
|
+
* @param id
|
|
177
|
+
* @param blockNum
|
|
178
|
+
*/
|
|
179
|
+
function fetchDelay(base, id, blockNum) {
|
|
180
|
+
return request_1.default({
|
|
181
|
+
base: base,
|
|
182
|
+
url: "/blocks/delay/" + id + "/" + blockNum
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
exports.fetchDelay = fetchDelay;
|
|
186
|
+
/**
|
|
187
|
+
* GET /blocks/height
|
|
188
|
+
* @param base
|
|
189
|
+
*/
|
|
190
|
+
function fetchHeight(base) {
|
|
191
|
+
return request_1.default({
|
|
192
|
+
base: base,
|
|
193
|
+
url: '/blocks/height'
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
exports.fetchHeight = fetchHeight;
|
|
197
|
+
/**
|
|
198
|
+
* GET /blocks/heightByTimestamp
|
|
199
|
+
* @param base
|
|
200
|
+
*/
|
|
201
|
+
function fetchHeightByTimestamp(base, timestamp, options) {
|
|
202
|
+
if (options === void 0) { options = Object.create(null); }
|
|
203
|
+
return request_1.default({
|
|
204
|
+
base: base,
|
|
205
|
+
url: "/blocks/heightByTimestamp/" + timestamp,
|
|
206
|
+
options: options
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
exports.fetchHeightByTimestamp = fetchHeightByTimestamp;
|
|
210
210
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { TLong } from '../../interface';
|
|
2
|
-
/**
|
|
3
|
-
* GET /consensus/generatingbalance/{address}
|
|
4
|
-
* Generating balance
|
|
5
|
-
* @param base
|
|
6
|
-
* @param address
|
|
7
|
-
*/
|
|
8
|
-
export declare function fetchGeneratingBalance(base: string, address: string, options?: RequestInit): Promise<IGeneratingBalance<TLong>>;
|
|
9
|
-
/**
|
|
10
|
-
* GET /consensus/basetarget
|
|
11
|
-
* Base target last
|
|
12
|
-
* @param base
|
|
13
|
-
*/
|
|
14
|
-
export declare function fetchBasetarget(base: string): Promise<IBasetarget>;
|
|
15
|
-
/**
|
|
16
|
-
* GET /consensus/algo
|
|
17
|
-
* Consensus algo
|
|
18
|
-
* @param base
|
|
19
|
-
*/
|
|
20
|
-
export declare function fetchConsensusAlgo(base: string): Promise<IConsensusAlgo>;
|
|
21
|
-
export interface IGeneratingBalance<LONG> {
|
|
22
|
-
address: string;
|
|
23
|
-
balance: LONG;
|
|
24
|
-
}
|
|
25
|
-
export interface IBasetarget {
|
|
26
|
-
baseTarget: number;
|
|
27
|
-
}
|
|
28
|
-
export interface IConsensusAlgo {
|
|
29
|
-
consensusAlgo: string;
|
|
30
|
-
}
|
|
31
|
-
export interface IGeneraationSignatureBlockId {
|
|
32
|
-
generationSignature: string;
|
|
33
|
-
}
|
|
34
|
-
export interface IBaseTargetBlockId {
|
|
35
|
-
baseTarget: number;
|
|
36
|
-
}
|
|
37
|
-
export interface IGenerationSignature {
|
|
38
|
-
generationSignature: string;
|
|
39
|
-
}
|
|
1
|
+
import { TLong } from '../../interface';
|
|
2
|
+
/**
|
|
3
|
+
* GET /consensus/generatingbalance/{address}
|
|
4
|
+
* Generating balance
|
|
5
|
+
* @param base
|
|
6
|
+
* @param address
|
|
7
|
+
*/
|
|
8
|
+
export declare function fetchGeneratingBalance(base: string, address: string, options?: RequestInit): Promise<IGeneratingBalance<TLong>>;
|
|
9
|
+
/**
|
|
10
|
+
* GET /consensus/basetarget
|
|
11
|
+
* Base target last
|
|
12
|
+
* @param base
|
|
13
|
+
*/
|
|
14
|
+
export declare function fetchBasetarget(base: string): Promise<IBasetarget>;
|
|
15
|
+
/**
|
|
16
|
+
* GET /consensus/algo
|
|
17
|
+
* Consensus algo
|
|
18
|
+
* @param base
|
|
19
|
+
*/
|
|
20
|
+
export declare function fetchConsensusAlgo(base: string): Promise<IConsensusAlgo>;
|
|
21
|
+
export interface IGeneratingBalance<LONG> {
|
|
22
|
+
address: string;
|
|
23
|
+
balance: LONG;
|
|
24
|
+
}
|
|
25
|
+
export interface IBasetarget {
|
|
26
|
+
baseTarget: number;
|
|
27
|
+
}
|
|
28
|
+
export interface IConsensusAlgo {
|
|
29
|
+
consensusAlgo: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IGeneraationSignatureBlockId {
|
|
32
|
+
generationSignature: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IBaseTargetBlockId {
|
|
35
|
+
baseTarget: number;
|
|
36
|
+
}
|
|
37
|
+
export interface IGenerationSignature {
|
|
38
|
+
generationSignature: string;
|
|
39
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchConsensusAlgo = exports.fetchBasetarget = exports.fetchGeneratingBalance = void 0;
|
|
7
|
-
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
|
-
/**
|
|
9
|
-
* GET /consensus/generatingbalance/{address}
|
|
10
|
-
* Generating balance
|
|
11
|
-
* @param base
|
|
12
|
-
* @param address
|
|
13
|
-
*/
|
|
14
|
-
function fetchGeneratingBalance(base, address, options) {
|
|
15
|
-
if (options === void 0) { options = Object.create(null); }
|
|
16
|
-
return request_1.default({ base: base, url: "/consensus/generatingbalance/" + address });
|
|
17
|
-
}
|
|
18
|
-
exports.fetchGeneratingBalance = fetchGeneratingBalance;
|
|
19
|
-
/**
|
|
20
|
-
* GET /consensus/basetarget
|
|
21
|
-
* Base target last
|
|
22
|
-
* @param base
|
|
23
|
-
*/
|
|
24
|
-
function fetchBasetarget(base) {
|
|
25
|
-
return request_1.default({ base: base, url: '/consensus/basetarget' });
|
|
26
|
-
}
|
|
27
|
-
exports.fetchBasetarget = fetchBasetarget;
|
|
28
|
-
/**
|
|
29
|
-
* GET /consensus/algo
|
|
30
|
-
* Consensus algo
|
|
31
|
-
* @param base
|
|
32
|
-
*/
|
|
33
|
-
function fetchConsensusAlgo(base) {
|
|
34
|
-
return request_1.default({ base: base, url: '/consensus/algo' });
|
|
35
|
-
}
|
|
36
|
-
exports.fetchConsensusAlgo = fetchConsensusAlgo;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchConsensusAlgo = exports.fetchBasetarget = exports.fetchGeneratingBalance = void 0;
|
|
7
|
+
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
|
+
/**
|
|
9
|
+
* GET /consensus/generatingbalance/{address}
|
|
10
|
+
* Generating balance
|
|
11
|
+
* @param base
|
|
12
|
+
* @param address
|
|
13
|
+
*/
|
|
14
|
+
function fetchGeneratingBalance(base, address, options) {
|
|
15
|
+
if (options === void 0) { options = Object.create(null); }
|
|
16
|
+
return request_1.default({ base: base, url: "/consensus/generatingbalance/" + address });
|
|
17
|
+
}
|
|
18
|
+
exports.fetchGeneratingBalance = fetchGeneratingBalance;
|
|
19
|
+
/**
|
|
20
|
+
* GET /consensus/basetarget
|
|
21
|
+
* Base target last
|
|
22
|
+
* @param base
|
|
23
|
+
*/
|
|
24
|
+
function fetchBasetarget(base) {
|
|
25
|
+
return request_1.default({ base: base, url: '/consensus/basetarget' });
|
|
26
|
+
}
|
|
27
|
+
exports.fetchBasetarget = fetchBasetarget;
|
|
28
|
+
/**
|
|
29
|
+
* GET /consensus/algo
|
|
30
|
+
* Consensus algo
|
|
31
|
+
* @param base
|
|
32
|
+
*/
|
|
33
|
+
function fetchConsensusAlgo(base) {
|
|
34
|
+
return request_1.default({ base: base, url: '/consensus/algo' });
|
|
35
|
+
}
|
|
36
|
+
exports.fetchConsensusAlgo = fetchConsensusAlgo;
|
|
37
37
|
//# sourceMappingURL=index.js.map
|