@waves/node-api-js 1.3.10-beta.2 → 1.3.10-beta.3
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/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 -143
- package/cjs/api-node/blocks/index.js +209 -209
- 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 -1238
- package/cjs/create.js +115 -115
- 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 +2300 -2300
- 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/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 -143
- package/es/api-node/blocks/index.js +178 -178
- 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 -1238
- package/es/create.js +89 -89
- 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/api-node/consensus/index.d.ts +0 -39
- package/cjs/api-node/consensus/index.js +0 -37
- package/cjs/api-node/consensus/index.js.map +0 -1
- package/es/api-node/consensus/index.d.ts +0 -39
- package/es/api-node/consensus/index.js +0 -27
- package/es/api-node/consensus/index.js.map +0 -1
|
@@ -1,245 +1,245 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.debugValidate = exports.debugStateWaves = exports.debugStateHash = exports.debugState = exports.debugRollbackTo = exports.debugRollback = exports.debugPrint = exports.fetchPortfolios = exports.fetchMinerInfo = exports.fetchDebugInfo = exports.fetchConfigInfo = exports.postPeerToTheBanList = exports.fetchStateChangesByTxId = exports.fetchStateChangesByAddress = exports.fetchBalanceHistory = void 0;
|
|
26
|
-
var request_1 = __importStar(require("../../tools/request"));
|
|
27
|
-
var query_1 = __importDefault(require("../../tools/query"));
|
|
28
|
-
/**
|
|
29
|
-
* Waves balance history
|
|
30
|
-
* @param base
|
|
31
|
-
* @param address
|
|
32
|
-
*/
|
|
33
|
-
function fetchBalanceHistory(base, address, options) {
|
|
34
|
-
if (options === void 0) { options = Object.create(null); }
|
|
35
|
-
return request_1.default({
|
|
36
|
-
base: base,
|
|
37
|
-
url: "/debug/balances/history/" + address,
|
|
38
|
-
options: options
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
exports.fetchBalanceHistory = fetchBalanceHistory;
|
|
42
|
-
/**
|
|
43
|
-
* Get list of transactions with state changes where specified address has been involved
|
|
44
|
-
* @param base
|
|
45
|
-
* @param address
|
|
46
|
-
* @param limit
|
|
47
|
-
* @param after
|
|
48
|
-
*/
|
|
49
|
-
function fetchStateChangesByAddress(base, address, limit, after, options) {
|
|
50
|
-
if (options === void 0) { options = Object.create(null); }
|
|
51
|
-
return request_1.default({
|
|
52
|
-
base: base,
|
|
53
|
-
url: "/debug/stateChanges/address/" + address + "/limit/" + limit + query_1.default({ after: after }),
|
|
54
|
-
options: options
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
exports.fetchStateChangesByAddress = fetchStateChangesByAddress;
|
|
58
|
-
/**
|
|
59
|
-
* Get invokeScript transaction state changes
|
|
60
|
-
* @param base
|
|
61
|
-
* @param txId
|
|
62
|
-
*/
|
|
63
|
-
function fetchStateChangesByTxId(base, txId, options) {
|
|
64
|
-
if (options === void 0) { options = Object.create(null); }
|
|
65
|
-
return request_1.default({
|
|
66
|
-
base: base,
|
|
67
|
-
url: "/transactions/info/" + txId,
|
|
68
|
-
options: options
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
exports.fetchStateChangesByTxId = fetchStateChangesByTxId;
|
|
72
|
-
function postPeerToTheBanList(base, peer) {
|
|
73
|
-
return fetch(base + "/debug/blacklist", {
|
|
74
|
-
method: "POST",
|
|
75
|
-
body: peer,
|
|
76
|
-
headers: {
|
|
77
|
-
"Content-Type": "application/json"
|
|
78
|
-
}
|
|
79
|
-
}).then(request_1.parseResponse);
|
|
80
|
-
}
|
|
81
|
-
exports.postPeerToTheBanList = postPeerToTheBanList;
|
|
82
|
-
function fetchConfigInfo(base, apiKey) {
|
|
83
|
-
return fetch(base + "/debug/configInfo", {
|
|
84
|
-
method: "GET",
|
|
85
|
-
headers: {
|
|
86
|
-
"X-API-Key": apiKey,
|
|
87
|
-
"Content-Type": "application/json"
|
|
88
|
-
}
|
|
89
|
-
}).then(request_1.parseResponse);
|
|
90
|
-
}
|
|
91
|
-
exports.fetchConfigInfo = fetchConfigInfo;
|
|
92
|
-
function fetchDebugInfo(base, apiKey) {
|
|
93
|
-
return fetch(base + "/debug/info", {
|
|
94
|
-
method: "GET",
|
|
95
|
-
headers: {
|
|
96
|
-
"X-API-Key": apiKey,
|
|
97
|
-
"Content-Type": "application/json"
|
|
98
|
-
}
|
|
99
|
-
}).then(request_1.parseResponse);
|
|
100
|
-
}
|
|
101
|
-
exports.fetchDebugInfo = fetchDebugInfo;
|
|
102
|
-
function fetchMinerInfo(base, apiKey) {
|
|
103
|
-
return fetch(base + "/debug/minerInfo", {
|
|
104
|
-
method: "GET",
|
|
105
|
-
headers: {
|
|
106
|
-
"X-API-Key": apiKey,
|
|
107
|
-
"Content-Type": "application/json"
|
|
108
|
-
}
|
|
109
|
-
}).then(request_1.parseResponse);
|
|
110
|
-
}
|
|
111
|
-
exports.fetchMinerInfo = fetchMinerInfo;
|
|
112
|
-
function fetchPortfolios(base, address, apiKey) {
|
|
113
|
-
return fetch(base + "/debug/portfolios/" + address, {
|
|
114
|
-
method: "GET",
|
|
115
|
-
headers: {
|
|
116
|
-
"X-API-Key": apiKey,
|
|
117
|
-
"Content-Type": "application/json"
|
|
118
|
-
}
|
|
119
|
-
}).then(request_1.parseResponse);
|
|
120
|
-
}
|
|
121
|
-
exports.fetchPortfolios = fetchPortfolios;
|
|
122
|
-
function debugPrint(base, message, apiKey) {
|
|
123
|
-
return fetch(base + "/debug/print", {
|
|
124
|
-
method: "POST",
|
|
125
|
-
headers: {
|
|
126
|
-
"X-API-Key": apiKey,
|
|
127
|
-
"Content-Type": "application/json"
|
|
128
|
-
},
|
|
129
|
-
body: JSON.stringify({ message: message })
|
|
130
|
-
}).then(request_1.parseResponse);
|
|
131
|
-
}
|
|
132
|
-
exports.debugPrint = debugPrint;
|
|
133
|
-
/**
|
|
134
|
-
* 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
|
-
* @param base
|
|
136
|
-
* @param height
|
|
137
|
-
* @param returnTransactionsToUtx
|
|
138
|
-
* @param apiKey
|
|
139
|
-
*/
|
|
140
|
-
function debugRollback(base, height, returnTransactionsToUtx, apiKey) {
|
|
141
|
-
return fetch(base + "/debug/rollback", {
|
|
142
|
-
method: "POST",
|
|
143
|
-
headers: {
|
|
144
|
-
"X-API-Key": apiKey,
|
|
145
|
-
"Content-Type": "application/json"
|
|
146
|
-
},
|
|
147
|
-
body: JSON.stringify({
|
|
148
|
-
rollbackTo: height,
|
|
149
|
-
returnTransactionsToUtx: returnTransactionsToUtx
|
|
150
|
-
})
|
|
151
|
-
}).then(request_1.parseResponse);
|
|
152
|
-
}
|
|
153
|
-
exports.debugRollback = debugRollback;
|
|
154
|
-
/**
|
|
155
|
-
* Rollback the state to the block with a given ID
|
|
156
|
-
* @param base
|
|
157
|
-
* @param height
|
|
158
|
-
* @param returnTransactionsToUtx
|
|
159
|
-
* @param apiKey
|
|
160
|
-
*/
|
|
161
|
-
function debugRollbackTo(base, id, apiKey) {
|
|
162
|
-
return fetch(base + "/debug/rollback-to/" + id, {
|
|
163
|
-
method: "DELETE",
|
|
164
|
-
headers: {
|
|
165
|
-
"X-API-Key": apiKey,
|
|
166
|
-
"Content-Type": "application/json"
|
|
167
|
-
},
|
|
168
|
-
}).then(request_1.parseResponse);
|
|
169
|
-
}
|
|
170
|
-
exports.debugRollbackTo = debugRollbackTo;
|
|
171
|
-
/**
|
|
172
|
-
* Regular address balance at the current height
|
|
173
|
-
* @param base
|
|
174
|
-
* @param apiKey
|
|
175
|
-
*/
|
|
176
|
-
function debugState(base, apiKey) {
|
|
177
|
-
return fetch(base + "/debug/state", {
|
|
178
|
-
method: "GET",
|
|
179
|
-
headers: {
|
|
180
|
-
"X-API-Key": apiKey,
|
|
181
|
-
"Content-Type": "application/json"
|
|
182
|
-
},
|
|
183
|
-
}).then(request_1.parseResponse);
|
|
184
|
-
}
|
|
185
|
-
exports.debugState = debugState;
|
|
186
|
-
/**
|
|
187
|
-
* Get state hash at height. Available only if node configuration contains waves.db.store-state-hashes = true option
|
|
188
|
-
* @param base
|
|
189
|
-
* @param height
|
|
190
|
-
*/
|
|
191
|
-
function debugStateHash(base, height, options) {
|
|
192
|
-
if (options === void 0) { options = Object.create(null); }
|
|
193
|
-
return request_1.default({
|
|
194
|
-
base: base,
|
|
195
|
-
url: "/debug/stateHash/" + height,
|
|
196
|
-
options: options
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
exports.debugStateHash = debugStateHash;
|
|
200
|
-
/**
|
|
201
|
-
* 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
|
-
* @param base
|
|
203
|
-
* @param height
|
|
204
|
-
* @param apiKey
|
|
205
|
-
*/
|
|
206
|
-
function debugStateWaves(base, height, apiKey) {
|
|
207
|
-
return fetch(base + "/debug/stateWaves/" + height, {
|
|
208
|
-
method: "GET",
|
|
209
|
-
headers: {
|
|
210
|
-
"X-API-Key": apiKey,
|
|
211
|
-
"Content-Type": "application/json"
|
|
212
|
-
},
|
|
213
|
-
}).then(request_1.parseResponse);
|
|
214
|
-
}
|
|
215
|
-
exports.debugStateWaves = debugStateWaves;
|
|
216
|
-
/**
|
|
217
|
-
* Validates a transaction and measures time spent in milliseconds. You should use the JSON transaction format with proofs
|
|
218
|
-
* @param base
|
|
219
|
-
* @param transaction
|
|
220
|
-
*/
|
|
221
|
-
function debugValidate(base, transaction) {
|
|
222
|
-
return fetch(base + "/debug/validate", {
|
|
223
|
-
method: "POST",
|
|
224
|
-
headers: {
|
|
225
|
-
"Content-Type": "application/json"
|
|
226
|
-
},
|
|
227
|
-
body: transaction
|
|
228
|
-
}).then(request_1.parseResponse);
|
|
229
|
-
}
|
|
230
|
-
exports.debugValidate = debugValidate;
|
|
231
|
-
// @TODO need API key:
|
|
232
|
-
// GET /debug/stateWaves/{height}
|
|
233
|
-
// POST /debug/rollback
|
|
234
|
-
// DELETE /debug/rollback-to/{id}
|
|
235
|
-
// GET /debug/portfolios/{address}
|
|
236
|
-
// GET /debug/minerInfo
|
|
237
|
-
// GET /debug/historyInfo
|
|
238
|
-
// GET /debug/historyInfo
|
|
239
|
-
// GET /debug/info
|
|
240
|
-
// POST /debug/validate
|
|
241
|
-
// GET /debug/blocks/{howMany}
|
|
242
|
-
// POST /debug/blacklist
|
|
243
|
-
// POST /debug/print
|
|
244
|
-
// GET /debug/state
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.debugValidate = exports.debugStateWaves = exports.debugStateHash = exports.debugState = exports.debugRollbackTo = exports.debugRollback = exports.debugPrint = exports.fetchPortfolios = exports.fetchMinerInfo = exports.fetchDebugInfo = exports.fetchConfigInfo = exports.postPeerToTheBanList = exports.fetchStateChangesByTxId = exports.fetchStateChangesByAddress = exports.fetchBalanceHistory = void 0;
|
|
26
|
+
var request_1 = __importStar(require("../../tools/request"));
|
|
27
|
+
var query_1 = __importDefault(require("../../tools/query"));
|
|
28
|
+
/**
|
|
29
|
+
* Waves balance history
|
|
30
|
+
* @param base
|
|
31
|
+
* @param address
|
|
32
|
+
*/
|
|
33
|
+
function fetchBalanceHistory(base, address, options) {
|
|
34
|
+
if (options === void 0) { options = Object.create(null); }
|
|
35
|
+
return request_1.default({
|
|
36
|
+
base: base,
|
|
37
|
+
url: "/debug/balances/history/" + address,
|
|
38
|
+
options: options
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.fetchBalanceHistory = fetchBalanceHistory;
|
|
42
|
+
/**
|
|
43
|
+
* Get list of transactions with state changes where specified address has been involved
|
|
44
|
+
* @param base
|
|
45
|
+
* @param address
|
|
46
|
+
* @param limit
|
|
47
|
+
* @param after
|
|
48
|
+
*/
|
|
49
|
+
function fetchStateChangesByAddress(base, address, limit, after, options) {
|
|
50
|
+
if (options === void 0) { options = Object.create(null); }
|
|
51
|
+
return request_1.default({
|
|
52
|
+
base: base,
|
|
53
|
+
url: "/debug/stateChanges/address/" + address + "/limit/" + limit + query_1.default({ after: after }),
|
|
54
|
+
options: options
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
exports.fetchStateChangesByAddress = fetchStateChangesByAddress;
|
|
58
|
+
/**
|
|
59
|
+
* Get invokeScript transaction state changes
|
|
60
|
+
* @param base
|
|
61
|
+
* @param txId
|
|
62
|
+
*/
|
|
63
|
+
function fetchStateChangesByTxId(base, txId, options) {
|
|
64
|
+
if (options === void 0) { options = Object.create(null); }
|
|
65
|
+
return request_1.default({
|
|
66
|
+
base: base,
|
|
67
|
+
url: "/transactions/info/" + txId,
|
|
68
|
+
options: options
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.fetchStateChangesByTxId = fetchStateChangesByTxId;
|
|
72
|
+
function postPeerToTheBanList(base, peer) {
|
|
73
|
+
return fetch(base + "/debug/blacklist", {
|
|
74
|
+
method: "POST",
|
|
75
|
+
body: peer,
|
|
76
|
+
headers: {
|
|
77
|
+
"Content-Type": "application/json"
|
|
78
|
+
}
|
|
79
|
+
}).then(request_1.parseResponse);
|
|
80
|
+
}
|
|
81
|
+
exports.postPeerToTheBanList = postPeerToTheBanList;
|
|
82
|
+
function fetchConfigInfo(base, apiKey) {
|
|
83
|
+
return fetch(base + "/debug/configInfo", {
|
|
84
|
+
method: "GET",
|
|
85
|
+
headers: {
|
|
86
|
+
"X-API-Key": apiKey,
|
|
87
|
+
"Content-Type": "application/json"
|
|
88
|
+
}
|
|
89
|
+
}).then(request_1.parseResponse);
|
|
90
|
+
}
|
|
91
|
+
exports.fetchConfigInfo = fetchConfigInfo;
|
|
92
|
+
function fetchDebugInfo(base, apiKey) {
|
|
93
|
+
return fetch(base + "/debug/info", {
|
|
94
|
+
method: "GET",
|
|
95
|
+
headers: {
|
|
96
|
+
"X-API-Key": apiKey,
|
|
97
|
+
"Content-Type": "application/json"
|
|
98
|
+
}
|
|
99
|
+
}).then(request_1.parseResponse);
|
|
100
|
+
}
|
|
101
|
+
exports.fetchDebugInfo = fetchDebugInfo;
|
|
102
|
+
function fetchMinerInfo(base, apiKey) {
|
|
103
|
+
return fetch(base + "/debug/minerInfo", {
|
|
104
|
+
method: "GET",
|
|
105
|
+
headers: {
|
|
106
|
+
"X-API-Key": apiKey,
|
|
107
|
+
"Content-Type": "application/json"
|
|
108
|
+
}
|
|
109
|
+
}).then(request_1.parseResponse);
|
|
110
|
+
}
|
|
111
|
+
exports.fetchMinerInfo = fetchMinerInfo;
|
|
112
|
+
function fetchPortfolios(base, address, apiKey) {
|
|
113
|
+
return fetch(base + "/debug/portfolios/" + address, {
|
|
114
|
+
method: "GET",
|
|
115
|
+
headers: {
|
|
116
|
+
"X-API-Key": apiKey,
|
|
117
|
+
"Content-Type": "application/json"
|
|
118
|
+
}
|
|
119
|
+
}).then(request_1.parseResponse);
|
|
120
|
+
}
|
|
121
|
+
exports.fetchPortfolios = fetchPortfolios;
|
|
122
|
+
function debugPrint(base, message, apiKey) {
|
|
123
|
+
return fetch(base + "/debug/print", {
|
|
124
|
+
method: "POST",
|
|
125
|
+
headers: {
|
|
126
|
+
"X-API-Key": apiKey,
|
|
127
|
+
"Content-Type": "application/json"
|
|
128
|
+
},
|
|
129
|
+
body: JSON.stringify({ message: message })
|
|
130
|
+
}).then(request_1.parseResponse);
|
|
131
|
+
}
|
|
132
|
+
exports.debugPrint = debugPrint;
|
|
133
|
+
/**
|
|
134
|
+
* 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
|
+
* @param base
|
|
136
|
+
* @param height
|
|
137
|
+
* @param returnTransactionsToUtx
|
|
138
|
+
* @param apiKey
|
|
139
|
+
*/
|
|
140
|
+
function debugRollback(base, height, returnTransactionsToUtx, apiKey) {
|
|
141
|
+
return fetch(base + "/debug/rollback", {
|
|
142
|
+
method: "POST",
|
|
143
|
+
headers: {
|
|
144
|
+
"X-API-Key": apiKey,
|
|
145
|
+
"Content-Type": "application/json"
|
|
146
|
+
},
|
|
147
|
+
body: JSON.stringify({
|
|
148
|
+
rollbackTo: height,
|
|
149
|
+
returnTransactionsToUtx: returnTransactionsToUtx
|
|
150
|
+
})
|
|
151
|
+
}).then(request_1.parseResponse);
|
|
152
|
+
}
|
|
153
|
+
exports.debugRollback = debugRollback;
|
|
154
|
+
/**
|
|
155
|
+
* Rollback the state to the block with a given ID
|
|
156
|
+
* @param base
|
|
157
|
+
* @param height
|
|
158
|
+
* @param returnTransactionsToUtx
|
|
159
|
+
* @param apiKey
|
|
160
|
+
*/
|
|
161
|
+
function debugRollbackTo(base, id, apiKey) {
|
|
162
|
+
return fetch(base + "/debug/rollback-to/" + id, {
|
|
163
|
+
method: "DELETE",
|
|
164
|
+
headers: {
|
|
165
|
+
"X-API-Key": apiKey,
|
|
166
|
+
"Content-Type": "application/json"
|
|
167
|
+
},
|
|
168
|
+
}).then(request_1.parseResponse);
|
|
169
|
+
}
|
|
170
|
+
exports.debugRollbackTo = debugRollbackTo;
|
|
171
|
+
/**
|
|
172
|
+
* Regular address balance at the current height
|
|
173
|
+
* @param base
|
|
174
|
+
* @param apiKey
|
|
175
|
+
*/
|
|
176
|
+
function debugState(base, apiKey) {
|
|
177
|
+
return fetch(base + "/debug/state", {
|
|
178
|
+
method: "GET",
|
|
179
|
+
headers: {
|
|
180
|
+
"X-API-Key": apiKey,
|
|
181
|
+
"Content-Type": "application/json"
|
|
182
|
+
},
|
|
183
|
+
}).then(request_1.parseResponse);
|
|
184
|
+
}
|
|
185
|
+
exports.debugState = debugState;
|
|
186
|
+
/**
|
|
187
|
+
* Get state hash at height. Available only if node configuration contains waves.db.store-state-hashes = true option
|
|
188
|
+
* @param base
|
|
189
|
+
* @param height
|
|
190
|
+
*/
|
|
191
|
+
function debugStateHash(base, height, options) {
|
|
192
|
+
if (options === void 0) { options = Object.create(null); }
|
|
193
|
+
return request_1.default({
|
|
194
|
+
base: base,
|
|
195
|
+
url: "/debug/stateHash/" + height,
|
|
196
|
+
options: options
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
exports.debugStateHash = debugStateHash;
|
|
200
|
+
/**
|
|
201
|
+
* 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
|
+
* @param base
|
|
203
|
+
* @param height
|
|
204
|
+
* @param apiKey
|
|
205
|
+
*/
|
|
206
|
+
function debugStateWaves(base, height, apiKey) {
|
|
207
|
+
return fetch(base + "/debug/stateWaves/" + height, {
|
|
208
|
+
method: "GET",
|
|
209
|
+
headers: {
|
|
210
|
+
"X-API-Key": apiKey,
|
|
211
|
+
"Content-Type": "application/json"
|
|
212
|
+
},
|
|
213
|
+
}).then(request_1.parseResponse);
|
|
214
|
+
}
|
|
215
|
+
exports.debugStateWaves = debugStateWaves;
|
|
216
|
+
/**
|
|
217
|
+
* Validates a transaction and measures time spent in milliseconds. You should use the JSON transaction format with proofs
|
|
218
|
+
* @param base
|
|
219
|
+
* @param transaction
|
|
220
|
+
*/
|
|
221
|
+
function debugValidate(base, transaction) {
|
|
222
|
+
return fetch(base + "/debug/validate", {
|
|
223
|
+
method: "POST",
|
|
224
|
+
headers: {
|
|
225
|
+
"Content-Type": "application/json"
|
|
226
|
+
},
|
|
227
|
+
body: transaction
|
|
228
|
+
}).then(request_1.parseResponse);
|
|
229
|
+
}
|
|
230
|
+
exports.debugValidate = debugValidate;
|
|
231
|
+
// @TODO need API key:
|
|
232
|
+
// GET /debug/stateWaves/{height}
|
|
233
|
+
// POST /debug/rollback
|
|
234
|
+
// DELETE /debug/rollback-to/{id}
|
|
235
|
+
// GET /debug/portfolios/{address}
|
|
236
|
+
// GET /debug/minerInfo
|
|
237
|
+
// GET /debug/historyInfo
|
|
238
|
+
// GET /debug/historyInfo
|
|
239
|
+
// GET /debug/info
|
|
240
|
+
// POST /debug/validate
|
|
241
|
+
// GET /debug/blocks/{howMany}
|
|
242
|
+
// POST /debug/blacklist
|
|
243
|
+
// POST /debug/print
|
|
244
|
+
// GET /debug/state
|
|
245
245
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TAssetDetails } from "../assets";
|
|
2
|
-
export declare function fetchEthAssetDetails(base: string, ethAssetId: string, options?: RequestInit): Promise<TAssetDetails>;
|
|
3
|
-
export declare function fetchEthAssetDetails(base: string, ethAssetId: Array<string>, options?: RequestInit): Promise<Array<TAssetDetails>>;
|
|
1
|
+
import { TAssetDetails } from "../assets";
|
|
2
|
+
export declare function fetchEthAssetDetails(base: string, ethAssetId: string, options?: RequestInit): Promise<TAssetDetails>;
|
|
3
|
+
export declare function fetchEthAssetDetails(base: string, ethAssetId: Array<string>, options?: RequestInit): Promise<Array<TAssetDetails>>;
|
|
@@ -1,15 +1,15 @@
|
|
|
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.fetchEthAssetDetails = void 0;
|
|
7
|
-
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
|
-
var utils_1 = require("../../tools/utils");
|
|
9
|
-
var query_1 = __importDefault(require("../../tools/query"));
|
|
10
|
-
function fetchEthAssetDetails(base, ethAssetId) {
|
|
11
|
-
var id = utils_1.toArray(ethAssetId);
|
|
12
|
-
return request_1.default({ base: base, url: "/eth/assets?" + query_1.default({ id: id }) }).then(function (list) { return Array.isArray(ethAssetId) ? list : list[0]; });
|
|
13
|
-
}
|
|
14
|
-
exports.fetchEthAssetDetails = fetchEthAssetDetails;
|
|
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.fetchEthAssetDetails = void 0;
|
|
7
|
+
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
|
+
var utils_1 = require("../../tools/utils");
|
|
9
|
+
var query_1 = __importDefault(require("../../tools/query"));
|
|
10
|
+
function fetchEthAssetDetails(base, ethAssetId) {
|
|
11
|
+
var id = utils_1.toArray(ethAssetId);
|
|
12
|
+
return request_1.default({ base: base, url: "/eth/assets?" + query_1.default({ id: id }) }).then(function (list) { return Array.isArray(ethAssetId) ? list : list[0]; });
|
|
13
|
+
}
|
|
14
|
+
exports.fetchEthAssetDetails = fetchEthAssetDetails;
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { TLong } from '../../interface';
|
|
2
|
-
/**
|
|
3
|
-
* GET /leasing/active/{address}
|
|
4
|
-
* Get all active leases for an address
|
|
5
|
-
*/
|
|
6
|
-
export declare function fetchActive(base: string, address: string, options?: RequestInit): Promise<Array<ILeaseInfo>>;
|
|
7
|
-
/**
|
|
8
|
-
* GET /leasing/info/
|
|
9
|
-
* Get lease transactions info.
|
|
10
|
-
*/
|
|
11
|
-
export declare function fetchLeasingInfo(base: string, ids: string[], options?: RequestInit): Promise<Array<ILeaseInfo>>;
|
|
12
|
-
export interface ILeaseInfo {
|
|
13
|
-
id: string;
|
|
14
|
-
originTransactionId: string;
|
|
15
|
-
sender: string;
|
|
16
|
-
recipient: string;
|
|
17
|
-
amount: TLong;
|
|
18
|
-
height: number;
|
|
19
|
-
status: string;
|
|
20
|
-
cancelHeight: number | null;
|
|
21
|
-
cancelTransactionId: string | null;
|
|
22
|
-
}
|
|
1
|
+
import { TLong } from '../../interface';
|
|
2
|
+
/**
|
|
3
|
+
* GET /leasing/active/{address}
|
|
4
|
+
* Get all active leases for an address
|
|
5
|
+
*/
|
|
6
|
+
export declare function fetchActive(base: string, address: string, options?: RequestInit): Promise<Array<ILeaseInfo>>;
|
|
7
|
+
/**
|
|
8
|
+
* GET /leasing/info/
|
|
9
|
+
* Get lease transactions info.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fetchLeasingInfo(base: string, ids: string[], options?: RequestInit): Promise<Array<ILeaseInfo>>;
|
|
12
|
+
export interface ILeaseInfo {
|
|
13
|
+
id: string;
|
|
14
|
+
originTransactionId: string;
|
|
15
|
+
sender: string;
|
|
16
|
+
recipient: string;
|
|
17
|
+
amount: TLong;
|
|
18
|
+
height: number;
|
|
19
|
+
status: string;
|
|
20
|
+
cancelHeight: number | null;
|
|
21
|
+
cancelTransactionId: string | null;
|
|
22
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.fetchLeasingInfo = exports.fetchActive = void 0;
|
|
18
|
-
var request_1 = __importDefault(require("../../tools/request"));
|
|
19
|
-
/**
|
|
20
|
-
* GET /leasing/active/{address}
|
|
21
|
-
* Get all active leases for an address
|
|
22
|
-
*/
|
|
23
|
-
function fetchActive(base, address, options) {
|
|
24
|
-
if (options === void 0) { options = Object.create(null); }
|
|
25
|
-
return request_1.default({ base: base, url: "/leasing/active/" + address, options: options });
|
|
26
|
-
}
|
|
27
|
-
exports.fetchActive = fetchActive;
|
|
28
|
-
/**
|
|
29
|
-
* GET /leasing/info/
|
|
30
|
-
* Get lease transactions info.
|
|
31
|
-
*/
|
|
32
|
-
function fetchLeasingInfo(base, ids, options) {
|
|
33
|
-
if (options === void 0) { options = Object.create(null); }
|
|
34
|
-
var searchParams = "{\"ids\":[" + ids.map(function (id) { return "\"" + id + "\""; }).join(',') + "]}";
|
|
35
|
-
return request_1.default({
|
|
36
|
-
base: base, url: "/leasing/info/", options: __assign(__assign({}, options), { body: searchParams, method: 'POST', headers: {
|
|
37
|
-
'Content-Type': 'application/json'
|
|
38
|
-
} })
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
exports.fetchLeasingInfo = fetchLeasingInfo;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.fetchLeasingInfo = exports.fetchActive = void 0;
|
|
18
|
+
var request_1 = __importDefault(require("../../tools/request"));
|
|
19
|
+
/**
|
|
20
|
+
* GET /leasing/active/{address}
|
|
21
|
+
* Get all active leases for an address
|
|
22
|
+
*/
|
|
23
|
+
function fetchActive(base, address, options) {
|
|
24
|
+
if (options === void 0) { options = Object.create(null); }
|
|
25
|
+
return request_1.default({ base: base, url: "/leasing/active/" + address, options: options });
|
|
26
|
+
}
|
|
27
|
+
exports.fetchActive = fetchActive;
|
|
28
|
+
/**
|
|
29
|
+
* GET /leasing/info/
|
|
30
|
+
* Get lease transactions info.
|
|
31
|
+
*/
|
|
32
|
+
function fetchLeasingInfo(base, ids, options) {
|
|
33
|
+
if (options === void 0) { options = Object.create(null); }
|
|
34
|
+
var searchParams = "{\"ids\":[" + ids.map(function (id) { return "\"" + id + "\""; }).join(',') + "]}";
|
|
35
|
+
return request_1.default({
|
|
36
|
+
base: base, url: "/leasing/info/", options: __assign(__assign({}, options), { body: searchParams, method: 'POST', headers: {
|
|
37
|
+
'Content-Type': 'application/json'
|
|
38
|
+
} })
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.fetchLeasingInfo = fetchLeasingInfo;
|
|
42
42
|
//# sourceMappingURL=index.js.map
|