@waves/node-api-js 1.3.0 → 1.3.10-beta.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/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,201 +1,201 @@
|
|
|
1
|
-
import request, { parseResponse } from '../../tools/request';
|
|
2
|
-
import query from '../../tools/query';
|
|
3
|
-
/**
|
|
4
|
-
* Waves balance history
|
|
5
|
-
* @param base
|
|
6
|
-
* @param address
|
|
7
|
-
*/
|
|
8
|
-
export function fetchBalanceHistory(base, address, options = Object.create(null)) {
|
|
9
|
-
return request({
|
|
10
|
-
base,
|
|
11
|
-
url: `/debug/balances/history/${address}`,
|
|
12
|
-
options
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Get list of transactions with state changes where specified address has been involved
|
|
17
|
-
* @param base
|
|
18
|
-
* @param address
|
|
19
|
-
* @param limit
|
|
20
|
-
* @param after
|
|
21
|
-
*/
|
|
22
|
-
export function fetchStateChangesByAddress(base, address, limit, after, options = Object.create(null)) {
|
|
23
|
-
return request({
|
|
24
|
-
base,
|
|
25
|
-
url: `/debug/stateChanges/address/${address}/limit/${limit}${query({ after })}`,
|
|
26
|
-
options
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get invokeScript transaction state changes
|
|
31
|
-
* @param base
|
|
32
|
-
* @param txId
|
|
33
|
-
*/
|
|
34
|
-
export function fetchStateChangesByTxId(base, txId, options = Object.create(null)) {
|
|
35
|
-
return request({
|
|
36
|
-
base,
|
|
37
|
-
url: `/transactions/info/${txId}`,
|
|
38
|
-
options
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
export function postPeerToTheBanList(base, peer) {
|
|
42
|
-
return fetch(`${base}/debug/blacklist`, {
|
|
43
|
-
method: "POST",
|
|
44
|
-
body: peer,
|
|
45
|
-
headers: {
|
|
46
|
-
"Content-Type": "application/json"
|
|
47
|
-
}
|
|
48
|
-
}).then(parseResponse);
|
|
49
|
-
}
|
|
50
|
-
export function fetchConfigInfo(base, apiKey) {
|
|
51
|
-
return fetch(`${base}/debug/configInfo`, {
|
|
52
|
-
method: "GET",
|
|
53
|
-
headers: {
|
|
54
|
-
"X-API-Key": apiKey,
|
|
55
|
-
"Content-Type": "application/json"
|
|
56
|
-
}
|
|
57
|
-
}).then(parseResponse);
|
|
58
|
-
}
|
|
59
|
-
export function fetchDebugInfo(base, apiKey) {
|
|
60
|
-
return fetch(`${base}/debug/info`, {
|
|
61
|
-
method: "GET",
|
|
62
|
-
headers: {
|
|
63
|
-
"X-API-Key": apiKey,
|
|
64
|
-
"Content-Type": "application/json"
|
|
65
|
-
}
|
|
66
|
-
}).then(parseResponse);
|
|
67
|
-
}
|
|
68
|
-
export function fetchMinerInfo(base, apiKey) {
|
|
69
|
-
return fetch(`${base}/debug/minerInfo`, {
|
|
70
|
-
method: "GET",
|
|
71
|
-
headers: {
|
|
72
|
-
"X-API-Key": apiKey,
|
|
73
|
-
"Content-Type": "application/json"
|
|
74
|
-
}
|
|
75
|
-
}).then(parseResponse);
|
|
76
|
-
}
|
|
77
|
-
export function fetchPortfolios(base, address, apiKey) {
|
|
78
|
-
return fetch(`${base}/debug/portfolios/${address}`, {
|
|
79
|
-
method: "GET",
|
|
80
|
-
headers: {
|
|
81
|
-
"X-API-Key": apiKey,
|
|
82
|
-
"Content-Type": "application/json"
|
|
83
|
-
}
|
|
84
|
-
}).then(parseResponse);
|
|
85
|
-
}
|
|
86
|
-
export function debugPrint(base, message, apiKey) {
|
|
87
|
-
return fetch(`${base}/debug/print`, {
|
|
88
|
-
method: "POST",
|
|
89
|
-
headers: {
|
|
90
|
-
"X-API-Key": apiKey,
|
|
91
|
-
"Content-Type": "application/json"
|
|
92
|
-
},
|
|
93
|
-
body: JSON.stringify({ message })
|
|
94
|
-
}).then(parseResponse);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* 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
|
|
98
|
-
* @param base
|
|
99
|
-
* @param height
|
|
100
|
-
* @param returnTransactionsToUtx
|
|
101
|
-
* @param apiKey
|
|
102
|
-
*/
|
|
103
|
-
export function debugRollback(base, height, returnTransactionsToUtx, apiKey) {
|
|
104
|
-
return fetch(`${base}/debug/rollback`, {
|
|
105
|
-
method: "POST",
|
|
106
|
-
headers: {
|
|
107
|
-
"X-API-Key": apiKey,
|
|
108
|
-
"Content-Type": "application/json"
|
|
109
|
-
},
|
|
110
|
-
body: JSON.stringify({
|
|
111
|
-
rollbackTo: height,
|
|
112
|
-
returnTransactionsToUtx
|
|
113
|
-
})
|
|
114
|
-
}).then(parseResponse);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Rollback the state to the block with a given ID
|
|
118
|
-
* @param base
|
|
119
|
-
* @param height
|
|
120
|
-
* @param returnTransactionsToUtx
|
|
121
|
-
* @param apiKey
|
|
122
|
-
*/
|
|
123
|
-
export function debugRollbackTo(base, id, apiKey) {
|
|
124
|
-
return fetch(`${base}/debug/rollback-to/${id}`, {
|
|
125
|
-
method: "DELETE",
|
|
126
|
-
headers: {
|
|
127
|
-
"X-API-Key": apiKey,
|
|
128
|
-
"Content-Type": "application/json"
|
|
129
|
-
},
|
|
130
|
-
}).then(parseResponse);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Regular address balance at the current height
|
|
134
|
-
* @param base
|
|
135
|
-
* @param apiKey
|
|
136
|
-
*/
|
|
137
|
-
export function debugState(base, apiKey) {
|
|
138
|
-
return fetch(`${base}/debug/state`, {
|
|
139
|
-
method: "GET",
|
|
140
|
-
headers: {
|
|
141
|
-
"X-API-Key": apiKey,
|
|
142
|
-
"Content-Type": "application/json"
|
|
143
|
-
},
|
|
144
|
-
}).then(parseResponse);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Get state hash at height. Available only if node configuration contains waves.db.store-state-hashes = true option
|
|
148
|
-
* @param base
|
|
149
|
-
* @param height
|
|
150
|
-
*/
|
|
151
|
-
export function debugStateHash(base, height, options = Object.create(null)) {
|
|
152
|
-
return request({
|
|
153
|
-
base,
|
|
154
|
-
url: `/debug/stateHash/${height}`,
|
|
155
|
-
options
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* 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
|
|
160
|
-
* @param base
|
|
161
|
-
* @param height
|
|
162
|
-
* @param apiKey
|
|
163
|
-
*/
|
|
164
|
-
export function debugStateWaves(base, height, apiKey) {
|
|
165
|
-
return fetch(`${base}/debug/stateWaves/${height}`, {
|
|
166
|
-
method: "GET",
|
|
167
|
-
headers: {
|
|
168
|
-
"X-API-Key": apiKey,
|
|
169
|
-
"Content-Type": "application/json"
|
|
170
|
-
},
|
|
171
|
-
}).then(parseResponse);
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Validates a transaction and measures time spent in milliseconds. You should use the JSON transaction format with proofs
|
|
175
|
-
* @param base
|
|
176
|
-
* @param transaction
|
|
177
|
-
*/
|
|
178
|
-
export function debugValidate(base, transaction) {
|
|
179
|
-
return fetch(`${base}/debug/validate`, {
|
|
180
|
-
method: "POST",
|
|
181
|
-
headers: {
|
|
182
|
-
"Content-Type": "application/json"
|
|
183
|
-
},
|
|
184
|
-
body: transaction
|
|
185
|
-
}).then(parseResponse);
|
|
186
|
-
}
|
|
187
|
-
// @TODO need API key:
|
|
188
|
-
// GET /debug/stateWaves/{height}
|
|
189
|
-
// POST /debug/rollback
|
|
190
|
-
// DELETE /debug/rollback-to/{id}
|
|
191
|
-
// GET /debug/portfolios/{address}
|
|
192
|
-
// GET /debug/minerInfo
|
|
193
|
-
// GET /debug/historyInfo
|
|
194
|
-
// GET /debug/historyInfo
|
|
195
|
-
// GET /debug/info
|
|
196
|
-
// POST /debug/validate
|
|
197
|
-
// GET /debug/blocks/{howMany}
|
|
198
|
-
// POST /debug/blacklist
|
|
199
|
-
// POST /debug/print
|
|
200
|
-
// GET /debug/state
|
|
1
|
+
import request, { parseResponse } from '../../tools/request';
|
|
2
|
+
import query from '../../tools/query';
|
|
3
|
+
/**
|
|
4
|
+
* Waves balance history
|
|
5
|
+
* @param base
|
|
6
|
+
* @param address
|
|
7
|
+
*/
|
|
8
|
+
export function fetchBalanceHistory(base, address, options = Object.create(null)) {
|
|
9
|
+
return request({
|
|
10
|
+
base,
|
|
11
|
+
url: `/debug/balances/history/${address}`,
|
|
12
|
+
options
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get list of transactions with state changes where specified address has been involved
|
|
17
|
+
* @param base
|
|
18
|
+
* @param address
|
|
19
|
+
* @param limit
|
|
20
|
+
* @param after
|
|
21
|
+
*/
|
|
22
|
+
export function fetchStateChangesByAddress(base, address, limit, after, options = Object.create(null)) {
|
|
23
|
+
return request({
|
|
24
|
+
base,
|
|
25
|
+
url: `/debug/stateChanges/address/${address}/limit/${limit}${query({ after })}`,
|
|
26
|
+
options
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get invokeScript transaction state changes
|
|
31
|
+
* @param base
|
|
32
|
+
* @param txId
|
|
33
|
+
*/
|
|
34
|
+
export function fetchStateChangesByTxId(base, txId, options = Object.create(null)) {
|
|
35
|
+
return request({
|
|
36
|
+
base,
|
|
37
|
+
url: `/transactions/info/${txId}`,
|
|
38
|
+
options
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export function postPeerToTheBanList(base, peer) {
|
|
42
|
+
return fetch(`${base}/debug/blacklist`, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
body: peer,
|
|
45
|
+
headers: {
|
|
46
|
+
"Content-Type": "application/json"
|
|
47
|
+
}
|
|
48
|
+
}).then(parseResponse);
|
|
49
|
+
}
|
|
50
|
+
export function fetchConfigInfo(base, apiKey) {
|
|
51
|
+
return fetch(`${base}/debug/configInfo`, {
|
|
52
|
+
method: "GET",
|
|
53
|
+
headers: {
|
|
54
|
+
"X-API-Key": apiKey,
|
|
55
|
+
"Content-Type": "application/json"
|
|
56
|
+
}
|
|
57
|
+
}).then(parseResponse);
|
|
58
|
+
}
|
|
59
|
+
export function fetchDebugInfo(base, apiKey) {
|
|
60
|
+
return fetch(`${base}/debug/info`, {
|
|
61
|
+
method: "GET",
|
|
62
|
+
headers: {
|
|
63
|
+
"X-API-Key": apiKey,
|
|
64
|
+
"Content-Type": "application/json"
|
|
65
|
+
}
|
|
66
|
+
}).then(parseResponse);
|
|
67
|
+
}
|
|
68
|
+
export function fetchMinerInfo(base, apiKey) {
|
|
69
|
+
return fetch(`${base}/debug/minerInfo`, {
|
|
70
|
+
method: "GET",
|
|
71
|
+
headers: {
|
|
72
|
+
"X-API-Key": apiKey,
|
|
73
|
+
"Content-Type": "application/json"
|
|
74
|
+
}
|
|
75
|
+
}).then(parseResponse);
|
|
76
|
+
}
|
|
77
|
+
export function fetchPortfolios(base, address, apiKey) {
|
|
78
|
+
return fetch(`${base}/debug/portfolios/${address}`, {
|
|
79
|
+
method: "GET",
|
|
80
|
+
headers: {
|
|
81
|
+
"X-API-Key": apiKey,
|
|
82
|
+
"Content-Type": "application/json"
|
|
83
|
+
}
|
|
84
|
+
}).then(parseResponse);
|
|
85
|
+
}
|
|
86
|
+
export function debugPrint(base, message, apiKey) {
|
|
87
|
+
return fetch(`${base}/debug/print`, {
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers: {
|
|
90
|
+
"X-API-Key": apiKey,
|
|
91
|
+
"Content-Type": "application/json"
|
|
92
|
+
},
|
|
93
|
+
body: JSON.stringify({ message })
|
|
94
|
+
}).then(parseResponse);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 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
|
|
98
|
+
* @param base
|
|
99
|
+
* @param height
|
|
100
|
+
* @param returnTransactionsToUtx
|
|
101
|
+
* @param apiKey
|
|
102
|
+
*/
|
|
103
|
+
export function debugRollback(base, height, returnTransactionsToUtx, apiKey) {
|
|
104
|
+
return fetch(`${base}/debug/rollback`, {
|
|
105
|
+
method: "POST",
|
|
106
|
+
headers: {
|
|
107
|
+
"X-API-Key": apiKey,
|
|
108
|
+
"Content-Type": "application/json"
|
|
109
|
+
},
|
|
110
|
+
body: JSON.stringify({
|
|
111
|
+
rollbackTo: height,
|
|
112
|
+
returnTransactionsToUtx
|
|
113
|
+
})
|
|
114
|
+
}).then(parseResponse);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Rollback the state to the block with a given ID
|
|
118
|
+
* @param base
|
|
119
|
+
* @param height
|
|
120
|
+
* @param returnTransactionsToUtx
|
|
121
|
+
* @param apiKey
|
|
122
|
+
*/
|
|
123
|
+
export function debugRollbackTo(base, id, apiKey) {
|
|
124
|
+
return fetch(`${base}/debug/rollback-to/${id}`, {
|
|
125
|
+
method: "DELETE",
|
|
126
|
+
headers: {
|
|
127
|
+
"X-API-Key": apiKey,
|
|
128
|
+
"Content-Type": "application/json"
|
|
129
|
+
},
|
|
130
|
+
}).then(parseResponse);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Regular address balance at the current height
|
|
134
|
+
* @param base
|
|
135
|
+
* @param apiKey
|
|
136
|
+
*/
|
|
137
|
+
export function debugState(base, apiKey) {
|
|
138
|
+
return fetch(`${base}/debug/state`, {
|
|
139
|
+
method: "GET",
|
|
140
|
+
headers: {
|
|
141
|
+
"X-API-Key": apiKey,
|
|
142
|
+
"Content-Type": "application/json"
|
|
143
|
+
},
|
|
144
|
+
}).then(parseResponse);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get state hash at height. Available only if node configuration contains waves.db.store-state-hashes = true option
|
|
148
|
+
* @param base
|
|
149
|
+
* @param height
|
|
150
|
+
*/
|
|
151
|
+
export function debugStateHash(base, height, options = Object.create(null)) {
|
|
152
|
+
return request({
|
|
153
|
+
base,
|
|
154
|
+
url: `/debug/stateHash/${height}`,
|
|
155
|
+
options
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* 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
|
|
160
|
+
* @param base
|
|
161
|
+
* @param height
|
|
162
|
+
* @param apiKey
|
|
163
|
+
*/
|
|
164
|
+
export function debugStateWaves(base, height, apiKey) {
|
|
165
|
+
return fetch(`${base}/debug/stateWaves/${height}`, {
|
|
166
|
+
method: "GET",
|
|
167
|
+
headers: {
|
|
168
|
+
"X-API-Key": apiKey,
|
|
169
|
+
"Content-Type": "application/json"
|
|
170
|
+
},
|
|
171
|
+
}).then(parseResponse);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Validates a transaction and measures time spent in milliseconds. You should use the JSON transaction format with proofs
|
|
175
|
+
* @param base
|
|
176
|
+
* @param transaction
|
|
177
|
+
*/
|
|
178
|
+
export function debugValidate(base, transaction) {
|
|
179
|
+
return fetch(`${base}/debug/validate`, {
|
|
180
|
+
method: "POST",
|
|
181
|
+
headers: {
|
|
182
|
+
"Content-Type": "application/json"
|
|
183
|
+
},
|
|
184
|
+
body: transaction
|
|
185
|
+
}).then(parseResponse);
|
|
186
|
+
}
|
|
187
|
+
// @TODO need API key:
|
|
188
|
+
// GET /debug/stateWaves/{height}
|
|
189
|
+
// POST /debug/rollback
|
|
190
|
+
// DELETE /debug/rollback-to/{id}
|
|
191
|
+
// GET /debug/portfolios/{address}
|
|
192
|
+
// GET /debug/minerInfo
|
|
193
|
+
// GET /debug/historyInfo
|
|
194
|
+
// GET /debug/historyInfo
|
|
195
|
+
// GET /debug/info
|
|
196
|
+
// POST /debug/validate
|
|
197
|
+
// GET /debug/blocks/{howMany}
|
|
198
|
+
// POST /debug/blacklist
|
|
199
|
+
// POST /debug/print
|
|
200
|
+
// GET /debug/state
|
|
201
201
|
//# 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>>;
|
package/es/api-node/eth/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import request from "../../tools/request";
|
|
2
|
-
import { toArray } from "../../tools/utils";
|
|
3
|
-
import query from "../../tools/query";
|
|
4
|
-
export function fetchEthAssetDetails(base, ethAssetId) {
|
|
5
|
-
const id = toArray(ethAssetId);
|
|
6
|
-
return request({ base, url: `/eth/assets?${query({ id })}` }).then(list => Array.isArray(ethAssetId) ? list : list[0]);
|
|
7
|
-
}
|
|
1
|
+
import request from "../../tools/request";
|
|
2
|
+
import { toArray } from "../../tools/utils";
|
|
3
|
+
import query from "../../tools/query";
|
|
4
|
+
export function fetchEthAssetDetails(base, ethAssetId) {
|
|
5
|
+
const id = toArray(ethAssetId);
|
|
6
|
+
return request({ base, url: `/eth/assets?${query({ id })}` }).then(list => Array.isArray(ethAssetId) ? list : list[0]);
|
|
7
|
+
}
|
|
8
8
|
//# 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,22 +1,22 @@
|
|
|
1
|
-
import request from '../../tools/request';
|
|
2
|
-
/**
|
|
3
|
-
* GET /leasing/active/{address}
|
|
4
|
-
* Get all active leases for an address
|
|
5
|
-
*/
|
|
6
|
-
export function fetchActive(base, address, options = Object.create(null)) {
|
|
7
|
-
return request({ base, url: `/leasing/active/${address}`, options });
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* GET /leasing/info/
|
|
11
|
-
* Get lease transactions info.
|
|
12
|
-
*/
|
|
13
|
-
export function fetchLeasingInfo(base, ids, options = Object.create(null)) {
|
|
14
|
-
const searchParams = `{\"ids\":[${ids.map(id => `\"${id}\"`).join(',')}]}`;
|
|
15
|
-
return request({
|
|
16
|
-
base, url: `/leasing/info/`,
|
|
17
|
-
options: Object.assign(Object.assign({}, options), { body: searchParams, method: 'POST', headers: {
|
|
18
|
-
'Content-Type': 'application/json'
|
|
19
|
-
} })
|
|
20
|
-
});
|
|
21
|
-
}
|
|
1
|
+
import request from '../../tools/request';
|
|
2
|
+
/**
|
|
3
|
+
* GET /leasing/active/{address}
|
|
4
|
+
* Get all active leases for an address
|
|
5
|
+
*/
|
|
6
|
+
export function fetchActive(base, address, options = Object.create(null)) {
|
|
7
|
+
return request({ base, url: `/leasing/active/${address}`, options });
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* GET /leasing/info/
|
|
11
|
+
* Get lease transactions info.
|
|
12
|
+
*/
|
|
13
|
+
export function fetchLeasingInfo(base, ids, options = Object.create(null)) {
|
|
14
|
+
const searchParams = `{\"ids\":[${ids.map(id => `\"${id}\"`).join(',')}]}`;
|
|
15
|
+
return request({
|
|
16
|
+
base, url: `/leasing/info/`,
|
|
17
|
+
options: Object.assign(Object.assign({}, options), { body: searchParams, method: 'POST', headers: {
|
|
18
|
+
'Content-Type': 'application/json'
|
|
19
|
+
} })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare function fetchNodeStatus(base: string, options?: RequestInit): Promise<INodeStatus>;
|
|
2
|
-
export declare function fetchNodeVersion(base: string, options?: RequestInit): Promise<INodeVersion>;
|
|
3
|
-
export interface INodeStatus {
|
|
4
|
-
blockchainHeight: number;
|
|
5
|
-
stateHeight: number;
|
|
6
|
-
updatedTimestamp: number;
|
|
7
|
-
updatedDate: string;
|
|
8
|
-
}
|
|
9
|
-
export interface INodeVersion {
|
|
10
|
-
version: string;
|
|
11
|
-
}
|
|
1
|
+
export declare function fetchNodeStatus(base: string, options?: RequestInit): Promise<INodeStatus>;
|
|
2
|
+
export declare function fetchNodeVersion(base: string, options?: RequestInit): Promise<INodeVersion>;
|
|
3
|
+
export interface INodeStatus {
|
|
4
|
+
blockchainHeight: number;
|
|
5
|
+
stateHeight: number;
|
|
6
|
+
updatedTimestamp: number;
|
|
7
|
+
updatedDate: string;
|
|
8
|
+
}
|
|
9
|
+
export interface INodeVersion {
|
|
10
|
+
version: string;
|
|
11
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import request from '../../tools/request';
|
|
2
|
-
// @TODO: When correct API key
|
|
3
|
-
// POST /node/stop
|
|
4
|
-
export function fetchNodeStatus(base, options = Object.create(null)) {
|
|
5
|
-
return request({ base, url: '/node/status', options });
|
|
6
|
-
}
|
|
7
|
-
export function fetchNodeVersion(base, options = Object.create(null)) {
|
|
8
|
-
return request({ base, url: '/node/version', options });
|
|
9
|
-
}
|
|
1
|
+
import request from '../../tools/request';
|
|
2
|
+
// @TODO: When correct API key
|
|
3
|
+
// POST /node/stop
|
|
4
|
+
export function fetchNodeStatus(base, options = Object.create(null)) {
|
|
5
|
+
return request({ base, url: '/node/status', options });
|
|
6
|
+
}
|
|
7
|
+
export function fetchNodeVersion(base, options = Object.create(null)) {
|
|
8
|
+
return request({ base, url: '/node/version', options });
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { TLong } from "../../interface";
|
|
2
|
-
/**
|
|
3
|
-
* GET /peers/all
|
|
4
|
-
* Peer list
|
|
5
|
-
*/
|
|
6
|
-
export declare function fetchAll(base: string, options?: RequestInit): Promise<IAllResponse>;
|
|
7
|
-
/**
|
|
8
|
-
* GET /peers/connected
|
|
9
|
-
* Connected peers list
|
|
10
|
-
*/
|
|
11
|
-
export declare function fetchConnected(base: string, options?: RequestInit): Promise<IAllConnectedResponse>;
|
|
12
|
-
/**
|
|
13
|
-
* GET /peers/blacklisted
|
|
14
|
-
* Blacklisted peers list
|
|
15
|
-
*/
|
|
16
|
-
export declare function fetchBlackListed(base: string, options?: RequestInit): Promise<Array<IBlackPeer>>;
|
|
17
|
-
/**
|
|
18
|
-
* GET /peers/suspended
|
|
19
|
-
* Suspended peers list
|
|
20
|
-
*/
|
|
21
|
-
export declare function fetchSuspended(base: string, options?: RequestInit): Promise<Array<ISuspendedPeer>>;
|
|
22
|
-
export interface IAllResponse {
|
|
23
|
-
peers: Array<IPeerAllResponse>;
|
|
24
|
-
}
|
|
25
|
-
export interface IAllConnectedResponse {
|
|
26
|
-
peers: Array<IPeerConnectedResponse>;
|
|
27
|
-
}
|
|
28
|
-
export interface IPeerAllResponse {
|
|
29
|
-
address: string;
|
|
30
|
-
lastSeen: TLong;
|
|
31
|
-
}
|
|
32
|
-
export interface IPeerConnectedResponse {
|
|
33
|
-
address: string;
|
|
34
|
-
declaredAddress: string;
|
|
35
|
-
peerName: string;
|
|
36
|
-
peerNonce: TLong;
|
|
37
|
-
applicationName: string;
|
|
38
|
-
applicationVersion: string;
|
|
39
|
-
}
|
|
40
|
-
export interface IBlackPeer extends ISuspendedPeer {
|
|
41
|
-
reason: string;
|
|
42
|
-
}
|
|
43
|
-
export interface ISuspendedPeer {
|
|
44
|
-
hostname: string;
|
|
45
|
-
timestamp: number;
|
|
46
|
-
}
|
|
1
|
+
import { TLong } from "../../interface";
|
|
2
|
+
/**
|
|
3
|
+
* GET /peers/all
|
|
4
|
+
* Peer list
|
|
5
|
+
*/
|
|
6
|
+
export declare function fetchAll(base: string, options?: RequestInit): Promise<IAllResponse>;
|
|
7
|
+
/**
|
|
8
|
+
* GET /peers/connected
|
|
9
|
+
* Connected peers list
|
|
10
|
+
*/
|
|
11
|
+
export declare function fetchConnected(base: string, options?: RequestInit): Promise<IAllConnectedResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* GET /peers/blacklisted
|
|
14
|
+
* Blacklisted peers list
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchBlackListed(base: string, options?: RequestInit): Promise<Array<IBlackPeer>>;
|
|
17
|
+
/**
|
|
18
|
+
* GET /peers/suspended
|
|
19
|
+
* Suspended peers list
|
|
20
|
+
*/
|
|
21
|
+
export declare function fetchSuspended(base: string, options?: RequestInit): Promise<Array<ISuspendedPeer>>;
|
|
22
|
+
export interface IAllResponse {
|
|
23
|
+
peers: Array<IPeerAllResponse>;
|
|
24
|
+
}
|
|
25
|
+
export interface IAllConnectedResponse {
|
|
26
|
+
peers: Array<IPeerConnectedResponse>;
|
|
27
|
+
}
|
|
28
|
+
export interface IPeerAllResponse {
|
|
29
|
+
address: string;
|
|
30
|
+
lastSeen: TLong;
|
|
31
|
+
}
|
|
32
|
+
export interface IPeerConnectedResponse {
|
|
33
|
+
address: string;
|
|
34
|
+
declaredAddress: string;
|
|
35
|
+
peerName: string;
|
|
36
|
+
peerNonce: TLong;
|
|
37
|
+
applicationName: string;
|
|
38
|
+
applicationVersion: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IBlackPeer extends ISuspendedPeer {
|
|
41
|
+
reason: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ISuspendedPeer {
|
|
44
|
+
hostname: string;
|
|
45
|
+
timestamp: number;
|
|
46
|
+
}
|