@waves/node-api-js 1.3.11-beta.1 → 1.4.0-snapshot.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/api-node/activation/index.d.ts +2 -1
- package/cjs/api-node/activation/index.js +2 -3
- package/cjs/api-node/activation/index.js.map +1 -1
- package/cjs/api-node/addresses/index.d.ts +5 -5
- package/cjs/api-node/addresses/index.js +74 -61
- package/cjs/api-node/addresses/index.js.map +1 -1
- package/cjs/api-node/alias/index.d.ts +1 -1
- package/cjs/api-node/alias/index.js +6 -7
- package/cjs/api-node/alias/index.js.map +1 -1
- package/cjs/api-node/assets/index.d.ts +4 -4
- package/cjs/api-node/assets/index.js +68 -27
- package/cjs/api-node/assets/index.js.map +1 -1
- package/cjs/api-node/blocks/index.d.ts +26 -7
- package/cjs/api-node/blocks/index.js +36 -51
- package/cjs/api-node/blocks/index.js.map +1 -1
- package/cjs/api-node/debug/index.d.ts +3 -3
- package/cjs/api-node/debug/index.js +56 -43
- package/cjs/api-node/debug/index.js.map +1 -1
- package/cjs/api-node/eth/index.js +3 -4
- package/cjs/api-node/eth/index.js.map +1 -1
- package/cjs/api-node/finalization/index.d.ts +54 -0
- package/cjs/api-node/finalization/index.js +126 -0
- package/cjs/api-node/finalization/index.js.map +1 -0
- package/cjs/api-node/leasing/index.js +7 -7
- package/cjs/api-node/leasing/index.js.map +1 -1
- package/cjs/api-node/node/index.js +4 -5
- package/cjs/api-node/node/index.js.map +1 -1
- package/cjs/api-node/peers/index.js +8 -9
- package/cjs/api-node/peers/index.js.map +1 -1
- package/cjs/api-node/rewards/index.d.ts +1 -1
- package/cjs/api-node/rewards/index.js +3 -4
- package/cjs/api-node/rewards/index.js.map +1 -1
- package/cjs/api-node/transactions/index.d.ts +1 -1
- package/cjs/api-node/transactions/index.js +26 -27
- package/cjs/api-node/transactions/index.js.map +1 -1
- package/cjs/api-node/utils/index.js +29 -30
- package/cjs/api-node/utils/index.js.map +1 -1
- package/cjs/constants.d.ts +1 -1
- package/cjs/create.d.ts +17 -1170
- package/cjs/create.js +30 -13
- package/cjs/create.js.map +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +4 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interface.d.ts +6 -6
- package/cjs/interface.js +4 -2
- package/cjs/interface.js.map +1 -1
- package/cjs/nodeInteraction.d.ts +34 -0
- package/cjs/nodeInteraction.js +266 -0
- package/cjs/nodeInteraction.js.map +1 -0
- package/cjs/tools/adresses/availableSponsoredBalances.d.ts +1 -1
- package/cjs/tools/adresses/availableSponsoredBalances.js +2 -2
- package/cjs/tools/adresses/availableSponsoredBalances.js.map +1 -1
- package/cjs/tools/adresses/ethAddress2waves.js +15 -10
- package/cjs/tools/adresses/ethAddress2waves.js.map +1 -1
- package/cjs/tools/adresses/getAssetIdListByTx.js +12 -7
- package/cjs/tools/adresses/getAssetIdListByTx.js.map +1 -1
- package/cjs/tools/adresses/getAssetsByTransaction.js +3 -3
- package/cjs/tools/adresses/getAssetsByTransaction.js.map +1 -1
- package/cjs/tools/adresses/getTransactionsWithAssets.js +3 -3
- package/cjs/tools/adresses/getTransactionsWithAssets.js.map +1 -1
- package/cjs/tools/adresses/watch.d.ts +8 -5
- package/cjs/tools/adresses/watch.js +56 -16
- package/cjs/tools/adresses/watch.js.map +1 -1
- package/cjs/tools/adresses/wavesAddress2eth.js +3 -3
- package/cjs/tools/adresses/wavesAddress2eth.js.map +1 -1
- package/cjs/tools/assets/wavesAsset2eth.js +3 -3
- package/cjs/tools/assets/wavesAsset2eth.js.map +1 -1
- package/cjs/tools/blocks/detectInterval.js +3 -3
- package/cjs/tools/blocks/detectInterval.js.map +1 -1
- package/cjs/tools/blocks/getNetworkByte.js +2 -2
- package/cjs/tools/blocks/getNetworkByte.js.map +1 -1
- package/cjs/tools/blocks/getNetworkCode.js +2 -2
- package/cjs/tools/blocks/getNetworkCode.js.map +1 -1
- package/cjs/tools/blocks/waitHeight.js +5 -5
- package/cjs/tools/blocks/waitHeight.js.map +1 -1
- package/cjs/tools/matcher/order.d.ts +17 -0
- package/cjs/tools/matcher/order.js +27 -0
- package/cjs/tools/matcher/order.js.map +1 -0
- package/cjs/tools/parse.js +1 -1
- package/cjs/tools/parse.js.map +1 -1
- package/cjs/tools/query.d.ts +1 -1
- package/cjs/tools/query.js +3 -3
- package/cjs/tools/query.js.map +1 -1
- package/cjs/tools/request.d.ts +1 -57
- package/cjs/tools/request.js +48 -6
- package/cjs/tools/request.js.map +1 -1
- package/cjs/tools/resolve.js +1 -1
- package/cjs/tools/resolve.js.map +1 -1
- package/cjs/tools/stringify.js +3 -3
- package/cjs/tools/stringify.js.map +1 -1
- package/cjs/tools/transactions/broadcast.d.ts +2 -2
- package/cjs/tools/transactions/broadcast.js +8 -8
- package/cjs/tools/transactions/broadcast.js.map +1 -1
- package/cjs/tools/transactions/ethTxId2waves.js +2 -2
- package/cjs/tools/transactions/ethTxId2waves.js.map +1 -1
- package/cjs/tools/transactions/wait.js +5 -5
- package/cjs/tools/transactions/wait.js.map +1 -1
- package/cjs/tools/utils.d.ts +7 -7
- package/cjs/tools/utils.js +30 -23
- package/cjs/tools/utils.js.map +1 -1
- package/package.json +34 -35
- package/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/dist/node-api.js +0 -30395
- package/dist/node-api.min.js +0 -26
- package/es/api-node/activation/index.d.ts +0 -21
- package/es/api-node/activation/index.js +0 -13
- package/es/api-node/activation/index.js.map +0 -1
- package/es/api-node/addresses/index.d.ts +0 -81
- package/es/api-node/addresses/index.js +0 -111
- package/es/api-node/addresses/index.js.map +0 -1
- package/es/api-node/alias/index.d.ts +0 -6
- package/es/api-node/alias/index.js +0 -14
- package/es/api-node/alias/index.js.map +0 -1
- package/es/api-node/assets/index.d.ts +0 -79
- package/es/api-node/assets/index.js +0 -63
- package/es/api-node/assets/index.js.map +0 -1
- package/es/api-node/blocks/index.d.ts +0 -131
- package/es/api-node/blocks/index.js +0 -179
- package/es/api-node/blocks/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
- package/es/api-node/debug/index.d.ts +0 -189
- package/es/api-node/debug/index.js +0 -201
- package/es/api-node/debug/index.js.map +0 -1
- package/es/api-node/eth/index.d.ts +0 -3
- package/es/api-node/eth/index.js +0 -8
- package/es/api-node/eth/index.js.map +0 -1
- package/es/api-node/leasing/index.d.ts +0 -22
- package/es/api-node/leasing/index.js +0 -22
- package/es/api-node/leasing/index.js.map +0 -1
- package/es/api-node/node/index.d.ts +0 -11
- package/es/api-node/node/index.js +0 -10
- package/es/api-node/node/index.js.map +0 -1
- package/es/api-node/peers/index.d.ts +0 -46
- package/es/api-node/peers/index.js +0 -46
- package/es/api-node/peers/index.js.map +0 -1
- package/es/api-node/rewards/index.d.ts +0 -21
- package/es/api-node/rewards/index.js +0 -13
- package/es/api-node/rewards/index.js.map +0 -1
- package/es/api-node/transactions/index.d.ts +0 -73
- package/es/api-node/transactions/index.js +0 -137
- package/es/api-node/transactions/index.js.map +0 -1
- package/es/api-node/utils/index.d.ts +0 -110
- package/es/api-node/utils/index.js +0 -193
- package/es/api-node/utils/index.js.map +0 -1
- package/es/api-node/wallet/index.d.ts +0 -5
- package/es/api-node/wallet/index.js +0 -7
- package/es/api-node/wallet/index.js.map +0 -1
- package/es/constants.d.ts +0 -40
- package/es/constants.js +0 -40
- package/es/constants.js.map +0 -1
- package/es/create.d.ts +0 -1240
- package/es/create.js +0 -93
- package/es/create.js.map +0 -1
- package/es/index.d.ts +0 -9
- package/es/index.js +0 -9
- package/es/index.js.map +0 -1
- package/es/interface.d.ts +0 -44
- package/es/interface.js +0 -3
- package/es/interface.js.map +0 -1
- package/es/tools/adresses/availableSponsoredBalances.d.ts +0 -7
- package/es/tools/adresses/availableSponsoredBalances.js +0 -27
- package/es/tools/adresses/availableSponsoredBalances.js.map +0 -1
- package/es/tools/adresses/ethAddress2waves.d.ts +0 -1
- package/es/tools/adresses/ethAddress2waves.js +0 -31
- package/es/tools/adresses/ethAddress2waves.js.map +0 -1
- package/es/tools/adresses/getAssetIdListByTx.d.ts +0 -2
- package/es/tools/adresses/getAssetIdListByTx.js +0 -24
- package/es/tools/adresses/getAssetIdListByTx.js.map +0 -1
- package/es/tools/adresses/getAssetsByTransaction.d.ts +0 -3
- package/es/tools/adresses/getAssetsByTransaction.js +0 -8
- package/es/tools/adresses/getAssetsByTransaction.js.map +0 -1
- package/es/tools/adresses/getTransactionsWithAssets.d.ts +0 -6
- package/es/tools/adresses/getTransactionsWithAssets.js +0 -7
- package/es/tools/adresses/getTransactionsWithAssets.js.map +0 -1
- package/es/tools/adresses/watch.d.ts +0 -24
- package/es/tools/adresses/watch.js +0 -134
- package/es/tools/adresses/watch.js.map +0 -1
- package/es/tools/adresses/wavesAddress2eth.d.ts +0 -1
- package/es/tools/adresses/wavesAddress2eth.js +0 -7
- package/es/tools/adresses/wavesAddress2eth.js.map +0 -1
- package/es/tools/assets/wavesAsset2eth.d.ts +0 -1
- package/es/tools/assets/wavesAsset2eth.js +0 -7
- package/es/tools/assets/wavesAsset2eth.js.map +0 -1
- package/es/tools/blocks/detectInterval.d.ts +0 -1
- package/es/tools/blocks/detectInterval.js +0 -9
- package/es/tools/blocks/detectInterval.js.map +0 -1
- package/es/tools/blocks/getNetworkByte.d.ts +0 -1
- package/es/tools/blocks/getNetworkByte.js +0 -51
- package/es/tools/blocks/getNetworkByte.js.map +0 -1
- package/es/tools/blocks/getNetworkCode.d.ts +0 -1
- package/es/tools/blocks/getNetworkCode.js +0 -5
- package/es/tools/blocks/getNetworkCode.js.map +0 -1
- package/es/tools/blocks/waitHeight.d.ts +0 -3
- package/es/tools/blocks/waitHeight.js +0 -36
- package/es/tools/blocks/waitHeight.js.map +0 -1
- package/es/tools/parse.d.ts +0 -1
- package/es/tools/parse.js +0 -5
- package/es/tools/parse.js.map +0 -1
- package/es/tools/query.d.ts +0 -4
- package/es/tools/query.js +0 -12
- package/es/tools/query.js.map +0 -1
- package/es/tools/request.d.ts +0 -64
- package/es/tools/request.js +0 -22
- package/es/tools/request.js.map +0 -1
- package/es/tools/resolve.d.ts +0 -1
- package/es/tools/resolve.js +0 -4
- package/es/tools/resolve.js.map +0 -1
- package/es/tools/stringify.d.ts +0 -1
- package/es/tools/stringify.js +0 -18
- package/es/tools/stringify.js.map +0 -1
- package/es/tools/transactions/broadcast.d.ts +0 -14
- package/es/tools/transactions/broadcast.js +0 -43
- package/es/tools/transactions/broadcast.js.map +0 -1
- package/es/tools/transactions/ethTxId2waves.d.ts +0 -1
- package/es/tools/transactions/ethTxId2waves.js +0 -8
- package/es/tools/transactions/ethTxId2waves.js.map +0 -1
- package/es/tools/transactions/wait.d.ts +0 -10
- package/es/tools/transactions/wait.js +0 -39
- package/es/tools/transactions/wait.js.map +0 -1
- package/es/tools/utils.d.ts +0 -32
- package/es/tools/utils.js +0 -73
- package/es/tools/utils.js.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.fetchFinalized = fetchFinalized;
|
|
23
|
+
exports.fetchFinalizedHeight = fetchFinalizedHeight;
|
|
24
|
+
exports.fetchFinalizedHeightAt = fetchFinalizedHeightAt;
|
|
25
|
+
exports.fetchComittedGeneratorsAt = fetchComittedGeneratorsAt;
|
|
26
|
+
exports.fetchCommittedGeneratorIndex = fetchCommittedGeneratorIndex;
|
|
27
|
+
exports.fetchCommitmentPeriodHeights = fetchCommitmentPeriodHeights;
|
|
28
|
+
var request_1 = __importDefault(require("../../tools/request"));
|
|
29
|
+
var activation_1 = require("../activation");
|
|
30
|
+
var blocks_1 = require("../blocks");
|
|
31
|
+
/**
|
|
32
|
+
* GET /blocks/headers/finalized
|
|
33
|
+
* Last finalized block header
|
|
34
|
+
* @param base
|
|
35
|
+
*/
|
|
36
|
+
function fetchFinalized(base, options) {
|
|
37
|
+
if (options === void 0) { options = Object.create(null); }
|
|
38
|
+
return (0, request_1.default)({
|
|
39
|
+
base: base,
|
|
40
|
+
url: "/blocks/headers/finalized",
|
|
41
|
+
options: options
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* GET last finalized block height
|
|
46
|
+
* @param base
|
|
47
|
+
*/
|
|
48
|
+
function fetchFinalizedHeight(base) {
|
|
49
|
+
return (0, request_1.default)({
|
|
50
|
+
base: base,
|
|
51
|
+
url: "/blocks/height/finalized"
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* GET finalized block height at
|
|
56
|
+
* @param base
|
|
57
|
+
* @param height
|
|
58
|
+
*/
|
|
59
|
+
function fetchFinalizedHeightAt(base, height) {
|
|
60
|
+
return (0, request_1.default)({
|
|
61
|
+
base: base,
|
|
62
|
+
url: "/blocks/finalized/at/".concat(height)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* GET /generators/at/{height}
|
|
67
|
+
* Committed generators list at height
|
|
68
|
+
* @param base
|
|
69
|
+
* @param height
|
|
70
|
+
*/
|
|
71
|
+
function fetchComittedGeneratorsAt(base, height, options) {
|
|
72
|
+
if (options === void 0) { options = Object.create(null); }
|
|
73
|
+
return (0, request_1.default)({
|
|
74
|
+
base: base,
|
|
75
|
+
url: "/generators/at/".concat(height),
|
|
76
|
+
options: options
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get committed generator index for provided address.
|
|
81
|
+
* Returns index from 0, or -1 when address is missing in the list.
|
|
82
|
+
* @param base
|
|
83
|
+
* @param height
|
|
84
|
+
* @param address
|
|
85
|
+
*/
|
|
86
|
+
function fetchCommittedGeneratorIndex(base, height, address, options) {
|
|
87
|
+
if (options === void 0) { options = Object.create(null); }
|
|
88
|
+
return fetchComittedGeneratorsAt(base, height, options).then(function (list) {
|
|
89
|
+
var index = list.findIndex(function (item) { return item.address === address; });
|
|
90
|
+
return index >= 0 ? index : -1;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Calculates commitment period boundaries depends on feature 25 activation.
|
|
95
|
+
* @param base
|
|
96
|
+
* @param periodLength
|
|
97
|
+
*/
|
|
98
|
+
function fetchCommitmentPeriodHeights(base, periodLength) {
|
|
99
|
+
if (periodLength === void 0) { periodLength = 10000; }
|
|
100
|
+
return Promise.all([
|
|
101
|
+
(0, activation_1.fetchActivationStatus)(base),
|
|
102
|
+
(0, blocks_1.fetchHeight)(base)
|
|
103
|
+
]).then(function (_a) {
|
|
104
|
+
var _b = __read(_a, 2), activationStatus = _b[0], heightStatus = _b[1];
|
|
105
|
+
var feature25 = activationStatus.features.find(function (feature) {
|
|
106
|
+
return feature.id === 25 &&
|
|
107
|
+
feature.blockchainStatus === 'ACTIVATED';
|
|
108
|
+
});
|
|
109
|
+
if (!feature25) {
|
|
110
|
+
throw new Error('Finalization voting is not activated');
|
|
111
|
+
}
|
|
112
|
+
if (typeof feature25.activationHeight !== 'number') {
|
|
113
|
+
throw new Error('Feature 25 activation height is unavailable');
|
|
114
|
+
}
|
|
115
|
+
var featureActivationHeight = feature25.activationHeight === 0 ? 1 : feature25.activationHeight;
|
|
116
|
+
var nextPeriodStart = featureActivationHeight + periodLength;
|
|
117
|
+
while (heightStatus.height >= nextPeriodStart) {
|
|
118
|
+
nextPeriodStart += periodLength;
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
currentPeriodStart: Math.max(nextPeriodStart - periodLength, 1),
|
|
122
|
+
nextPeriodStart: nextPeriodStart
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/finalization/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWA,wCAMC;AAMD,oDAKC;AAOD,wDAKC;AAQD,8DAMC;AASD,oEAKC;AAOD,oEA4BC;AAvGD,gEAA0C;AAE1C,4CAAsD;AACtD,oCAAoD;AAGpD;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACnF,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,2BAA2B;QAChC,OAAO,SAAA;KACV,CAAC,CAAC;AACP,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC7C,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,0BAA0B;KAClC,CAAC,CAAA;AACN,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,IAAY,EAAE,MAAc;IAC/D,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,+BAAwB,MAAM,CAAE;KACxC,C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,gBAAgB,KAAK,WAAW;QADxC,CACwC,CAC3C,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,OAAO,SAAS,CAAC,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACnE,CAAC;QAED,IAAM,uBAAuB,GAAG,SAAS,CAAC,gBAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC;QAClG,IAAI,eAAe,GAAG,uBAAuB,GAAG,YAAY,CAAC;QAC7D,OAAO,YAAY,CAAC,MAAM,IAAI,eAAe,EAAE,CAAC;YAC5C,eAAe,IAAI,YAAY,CAAC;QACpC,CAAC;QAED,OAAO;YACH,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAAC,eAAe,GAAG,YAAY,EAAE,CAAC,CAAC;YAC/D,eAAe,iBAAA;SAClB,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -14,7 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.fetchActive = fetchActive;
|
|
18
|
+
exports.fetchLeasingInfo = fetchLeasingInfo;
|
|
18
19
|
var request_1 = __importDefault(require("../../tools/request"));
|
|
19
20
|
/**
|
|
20
21
|
* GET /leasing/active/{address}
|
|
@@ -22,21 +23,20 @@ var request_1 = __importDefault(require("../../tools/request"));
|
|
|
22
23
|
*/
|
|
23
24
|
function fetchActive(base, address, options) {
|
|
24
25
|
if (options === void 0) { options = Object.create(null); }
|
|
25
|
-
return request_1.default({ base: base, url: "/leasing/active/"
|
|
26
|
+
return (0, request_1.default)({ base: base, url: "/leasing/active/".concat(address), options: options });
|
|
26
27
|
}
|
|
27
|
-
exports.fetchActive = fetchActive;
|
|
28
28
|
/**
|
|
29
29
|
* GET /leasing/info/
|
|
30
30
|
* Get lease transactions info.
|
|
31
31
|
*/
|
|
32
32
|
function fetchLeasingInfo(base, ids, options) {
|
|
33
33
|
if (options === void 0) { options = Object.create(null); }
|
|
34
|
-
var searchParams = "{\"ids\":["
|
|
35
|
-
return request_1.default({
|
|
36
|
-
base: base,
|
|
34
|
+
var searchParams = "{\"ids\":[".concat(ids.map(function (id) { return "\"".concat(id, "\""); }).join(','), "]}");
|
|
35
|
+
return (0, request_1.default)({
|
|
36
|
+
base: base,
|
|
37
|
+
url: "/leasing/info/", options: __assign(__assign({}, options), { body: searchParams, method: 'POST', headers: {
|
|
37
38
|
'Content-Type': 'application/json'
|
|
38
39
|
} })
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
exports.fetchLeasingInfo = fetchLeasingInfo;
|
|
42
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/leasing/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/leasing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQA,kCAEC;AAOD,4CAaC;AA7BD,gEAA0C;AAG1C;;;GAGG;AACH,SAAgB,WAAW,CAAC,IAAY,EAAE,OAAe,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACjG,OAAO,IAAA,iBAAO,EAAC,EAAC,IAAI,MAAA,EAAE,GAAG,EAAE,0BAAmB,OAAO,CAAE,EAAE,OAAO,SAAA,EAAC,CAAC,CAAC;AACvE,CAAC;AAGD;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,IAAY,EAAE,GAAa,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACpG,IAAM,YAAY,GAAG,oBAAa,GAAG,CAAC,GAAG,CAAC,UAAA,EAAE,IAAI,OAAA,YAAK,EAAE,OAAI,EAAX,CAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAI,CAAC;IAE3E,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QAAE,GAAG,EAAE,gBAAgB,EAAE,OAAO,wBAC7B,OAAO,KACV,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;gBACL,cAAc,EAAE,kBAAkB;aACrC,GACJ;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -3,18 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.fetchNodeStatus = fetchNodeStatus;
|
|
7
|
+
exports.fetchNodeVersion = fetchNodeVersion;
|
|
7
8
|
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
9
|
// @TODO: When correct API key
|
|
9
10
|
// POST /node/stop
|
|
10
11
|
function fetchNodeStatus(base, options) {
|
|
11
12
|
if (options === void 0) { options = Object.create(null); }
|
|
12
|
-
return request_1.default({ base: base, url: '/node/status', options: options });
|
|
13
|
+
return (0, request_1.default)({ base: base, url: '/node/status', options: options });
|
|
13
14
|
}
|
|
14
|
-
exports.fetchNodeStatus = fetchNodeStatus;
|
|
15
15
|
function fetchNodeVersion(base, options) {
|
|
16
16
|
if (options === void 0) { options = Object.create(null); }
|
|
17
|
-
return request_1.default({ base: base, url: '/node/version', options: options });
|
|
17
|
+
return (0, request_1.default)({ base: base, url: '/node/version', options: options });
|
|
18
18
|
}
|
|
19
|
-
exports.fetchNodeVersion = fetchNodeVersion;
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/node/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/node/index.ts"],"names":[],"mappings":";;;;;AAKA,0CAEC;AAED,4CAEC;AAXD,gEAA0C;AAE1C,8BAA8B;AAC9B,kBAAkB;AAElB,SAAgB,eAAe,CAAC,IAAY,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACpF,OAAO,IAAA,iBAAO,EAAC,EAAE,IAAI,MAAA,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,gBAAgB,CAAC,IAAY,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACrF,OAAO,IAAA,iBAAO,EAAC,EAAE,IAAI,MAAA,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.fetchAll = fetchAll;
|
|
7
|
+
exports.fetchConnected = fetchConnected;
|
|
8
|
+
exports.fetchBlackListed = fetchBlackListed;
|
|
9
|
+
exports.fetchSuspended = fetchSuspended;
|
|
7
10
|
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
11
|
/**
|
|
9
12
|
* GET /peers/all
|
|
@@ -11,50 +14,46 @@ var request_1 = __importDefault(require("../../tools/request"));
|
|
|
11
14
|
*/
|
|
12
15
|
function fetchAll(base, options) {
|
|
13
16
|
if (options === void 0) { options = Object.create(null); }
|
|
14
|
-
return request_1.default({
|
|
17
|
+
return (0, request_1.default)({
|
|
15
18
|
base: base,
|
|
16
19
|
url: '/peers/all',
|
|
17
20
|
options: options
|
|
18
21
|
});
|
|
19
22
|
}
|
|
20
|
-
exports.fetchAll = fetchAll;
|
|
21
23
|
/**
|
|
22
24
|
* GET /peers/connected
|
|
23
25
|
* Connected peers list
|
|
24
26
|
*/
|
|
25
27
|
function fetchConnected(base, options) {
|
|
26
28
|
if (options === void 0) { options = Object.create(null); }
|
|
27
|
-
return request_1.default({
|
|
29
|
+
return (0, request_1.default)({
|
|
28
30
|
base: base,
|
|
29
31
|
url: '/peers/connected',
|
|
30
32
|
options: options
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
exports.fetchConnected = fetchConnected;
|
|
34
35
|
/**
|
|
35
36
|
* GET /peers/blacklisted
|
|
36
37
|
* Blacklisted peers list
|
|
37
38
|
*/
|
|
38
39
|
function fetchBlackListed(base, options) {
|
|
39
40
|
if (options === void 0) { options = Object.create(null); }
|
|
40
|
-
return request_1.default({
|
|
41
|
+
return (0, request_1.default)({
|
|
41
42
|
base: base,
|
|
42
43
|
url: '/peers/blacklisted',
|
|
43
44
|
options: options
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
exports.fetchBlackListed = fetchBlackListed;
|
|
47
47
|
/**
|
|
48
48
|
* GET /peers/suspended
|
|
49
49
|
* Suspended peers list
|
|
50
50
|
*/
|
|
51
51
|
function fetchSuspended(base, options) {
|
|
52
52
|
if (options === void 0) { options = Object.create(null); }
|
|
53
|
-
return request_1.default({
|
|
53
|
+
return (0, request_1.default)({
|
|
54
54
|
base: base,
|
|
55
55
|
url: '/peers/suspended',
|
|
56
56
|
options: options
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
exports.fetchSuspended = fetchSuspended;
|
|
60
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/peers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/peers/index.ts"],"names":[],"mappings":";;;;;AAOA,4BAMC;AAOD,wCAMC;AAMD,4CAMC;AAMD,wCAMC;AAlDD,gEAA0C;AAG1C;;;GAGG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC7E,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,YAAY;QACjB,OAAO,SAAA;KACV,CAAC,CAAA;AACN,CAAC;AAGD;;;GAGG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACnF,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,kBAAkB;QACvB,OAAO,SAAA;KACV,CAAC,CAAA;AACN,CAAC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,IAAY,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACrF,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,oBAAoB;QACzB,OAAO,SAAA;KACV,CAAC,CAAA;AACN,CAAC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACnF,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,kBAAkB;QACvB,OAAO,SAAA;KACV,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { TLong } from '../../interface';
|
|
|
4
4
|
* Current reward status
|
|
5
5
|
*/
|
|
6
6
|
export declare function fetchRewards(base: string, height?: number, options?: RequestInit): Promise<TRewards<TLong>>;
|
|
7
|
-
export
|
|
7
|
+
export type TRewards<LONG> = {
|
|
8
8
|
height: number;
|
|
9
9
|
totalWavesAmount: LONG;
|
|
10
10
|
currentReward: LONG;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchRewards =
|
|
6
|
+
exports.fetchRewards = fetchRewards;
|
|
7
7
|
var request_1 = __importDefault(require("../../tools/request"));
|
|
8
8
|
/**
|
|
9
9
|
* GET /blockchain/rewards
|
|
@@ -11,11 +11,10 @@ var request_1 = __importDefault(require("../../tools/request"));
|
|
|
11
11
|
*/
|
|
12
12
|
function fetchRewards(base, height, options) {
|
|
13
13
|
if (options === void 0) { options = Object.create(null); }
|
|
14
|
-
return request_1.default({
|
|
14
|
+
return (0, request_1.default)({
|
|
15
15
|
base: base,
|
|
16
|
-
url: height ? "/blockchain/rewards/"
|
|
16
|
+
url: height ? "/blockchain/rewards/".concat(height) : '/blockchain/rewards',
|
|
17
17
|
options: options
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
exports.fetchRewards = fetchRewards;
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/rewards/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/rewards/index.ts"],"names":[],"mappings":";;;;;AAQA,oCAMC;AAbD,gEAA0C;AAG1C;;;GAGG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,MAAe,EAAE,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAClG,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,8BAAuB,MAAM,CAAE,CAAC,CAAC,CAAC,qBAAqB;QACrE,OAAO,SAAA;KACV,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -21,7 +21,7 @@ interface IUnconfirmedSize {
|
|
|
21
21
|
export declare function fetchCalculateFee<T extends keyof TransactionMap<TLong>>(base: string, tx: Partial<TransactionMap<TLong>[T]> & {
|
|
22
22
|
type: T;
|
|
23
23
|
}, options?: RequestInit): Promise<TFeeInfo>;
|
|
24
|
-
export
|
|
24
|
+
export type TFeeInfo<LONG = TLong> = {
|
|
25
25
|
feeAssetId: string | null;
|
|
26
26
|
feeAmount: LONG;
|
|
27
27
|
};
|
|
@@ -30,7 +30,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.fetchUnconfirmedSize = fetchUnconfirmedSize;
|
|
34
|
+
exports.fetchCalculateFee = fetchCalculateFee;
|
|
35
|
+
exports.fetchUnconfirmed = fetchUnconfirmed;
|
|
36
|
+
exports.fetchTransactions = fetchTransactions;
|
|
37
|
+
exports.fetchUnconfirmedInfo = fetchUnconfirmedInfo;
|
|
38
|
+
exports.fetchInfo = fetchInfo;
|
|
39
|
+
exports.fetchMultipleInfo = fetchMultipleInfo;
|
|
40
|
+
exports.fetchStatus = fetchStatus;
|
|
41
|
+
exports.broadcast = broadcast;
|
|
34
42
|
var constants_1 = require("../../constants");
|
|
35
43
|
var blocks_1 = require("../blocks");
|
|
36
44
|
var request_1 = __importDefault(require("../../tools/request"));
|
|
@@ -42,12 +50,11 @@ var stringify_1 = __importDefault(require("../../tools/stringify"));
|
|
|
42
50
|
* Number of unconfirmed transactions
|
|
43
51
|
*/
|
|
44
52
|
function fetchUnconfirmedSize(base) {
|
|
45
|
-
return request_1.default({
|
|
53
|
+
return (0, request_1.default)({
|
|
46
54
|
base: base,
|
|
47
55
|
url: '/transactions/unconfirmed/size'
|
|
48
56
|
});
|
|
49
57
|
}
|
|
50
|
-
exports.fetchUnconfirmedSize = fetchUnconfirmedSize;
|
|
51
58
|
// @TODO: when correct API key is received
|
|
52
59
|
/**
|
|
53
60
|
* POST /transactions/sign/{signerAddress}
|
|
@@ -59,32 +66,30 @@ exports.fetchUnconfirmedSize = fetchUnconfirmedSize;
|
|
|
59
66
|
*/
|
|
60
67
|
function fetchCalculateFee(base, tx, options) {
|
|
61
68
|
if (options === void 0) { options = Object.create(null); }
|
|
62
|
-
return request_1.default({
|
|
69
|
+
return (0, request_1.default)({
|
|
63
70
|
base: base,
|
|
64
71
|
url: '/transactions/calculateFee',
|
|
65
|
-
options: utils_1.deepAssign(__assign({}, options), {
|
|
72
|
+
options: (0, utils_1.deepAssign)(__assign({}, options), {
|
|
66
73
|
method: 'POST',
|
|
67
|
-
body: stringify_1.default(tx),
|
|
74
|
+
body: (0, stringify_1.default)(tx),
|
|
68
75
|
headers: {
|
|
69
76
|
'Content-Type': 'application/json'
|
|
70
77
|
}
|
|
71
78
|
})
|
|
72
79
|
});
|
|
73
80
|
}
|
|
74
|
-
exports.fetchCalculateFee = fetchCalculateFee;
|
|
75
81
|
/**
|
|
76
82
|
* GET /transactions/unconfirmed
|
|
77
83
|
* Unconfirmed transactions
|
|
78
84
|
*/
|
|
79
85
|
function fetchUnconfirmed(base, options) {
|
|
80
86
|
if (options === void 0) { options = Object.create(null); }
|
|
81
|
-
return request_1.default({
|
|
87
|
+
return (0, request_1.default)({
|
|
82
88
|
base: base,
|
|
83
89
|
url: '/transactions/unconfirmed',
|
|
84
90
|
options: options
|
|
85
91
|
});
|
|
86
92
|
}
|
|
87
|
-
exports.fetchUnconfirmed = fetchUnconfirmed;
|
|
88
93
|
/**
|
|
89
94
|
* Список транзакций по адресу
|
|
90
95
|
* @param address
|
|
@@ -94,29 +99,27 @@ exports.fetchUnconfirmed = fetchUnconfirmed;
|
|
|
94
99
|
*/
|
|
95
100
|
function fetchTransactions(base, address, limit, after, retry, options) {
|
|
96
101
|
if (options === void 0) { options = Object.create(null); }
|
|
97
|
-
return request_1.default({
|
|
102
|
+
return (0, request_1.default)({
|
|
98
103
|
base: base,
|
|
99
|
-
url: "/transactions/address/"
|
|
104
|
+
url: "/transactions/address/".concat(address, "/limit/").concat(limit).concat((0, query_1.default)({ after: after })),
|
|
100
105
|
options: options
|
|
101
106
|
}).then(function (_a) {
|
|
102
107
|
var _b = __read(_a, 1), list = _b[0];
|
|
103
108
|
return list;
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
|
-
exports.fetchTransactions = fetchTransactions;
|
|
107
111
|
/**
|
|
108
112
|
* GET /transactions/unconfirmed/info/{id}
|
|
109
113
|
* Unconfirmed transaction info
|
|
110
114
|
*/
|
|
111
115
|
function fetchUnconfirmedInfo(base, id, options) {
|
|
112
116
|
if (options === void 0) { options = Object.create(null); }
|
|
113
|
-
return request_1.default({
|
|
117
|
+
return (0, request_1.default)({
|
|
114
118
|
base: base,
|
|
115
|
-
url: "/transactions/unconfirmed/info/"
|
|
119
|
+
url: "/transactions/unconfirmed/info/".concat(id),
|
|
116
120
|
options: options
|
|
117
121
|
});
|
|
118
122
|
}
|
|
119
|
-
exports.fetchUnconfirmedInfo = fetchUnconfirmedInfo;
|
|
120
123
|
// @TODO when correct API key is received
|
|
121
124
|
/**
|
|
122
125
|
* POST /transactions/sign
|
|
@@ -128,26 +131,24 @@ exports.fetchUnconfirmedInfo = fetchUnconfirmedInfo;
|
|
|
128
131
|
*/
|
|
129
132
|
function fetchInfo(base, id, options) {
|
|
130
133
|
if (options === void 0) { options = Object.create(null); }
|
|
131
|
-
return request_1.default({
|
|
134
|
+
return (0, request_1.default)({
|
|
132
135
|
base: base,
|
|
133
|
-
url: "/transactions/info/"
|
|
136
|
+
url: "/transactions/info/".concat(id),
|
|
134
137
|
options: options
|
|
135
138
|
});
|
|
136
139
|
}
|
|
137
|
-
exports.fetchInfo = fetchInfo;
|
|
138
140
|
/**
|
|
139
141
|
* GET /transactions/info/
|
|
140
142
|
* Get transactions by IDs
|
|
141
143
|
*/
|
|
142
144
|
function fetchMultipleInfo(base, ids, options) {
|
|
143
145
|
if (options === void 0) { options = Object.create(null); }
|
|
144
|
-
return request_1.default({
|
|
146
|
+
return (0, request_1.default)({
|
|
145
147
|
base: base,
|
|
146
|
-
url: "/transactions/info"
|
|
148
|
+
url: "/transactions/info".concat((0, query_1.default)({ id: ids })),
|
|
147
149
|
options: options
|
|
148
150
|
});
|
|
149
151
|
}
|
|
150
|
-
exports.fetchMultipleInfo = fetchMultipleInfo;
|
|
151
152
|
function fetchStatus(base, list) {
|
|
152
153
|
var DEFAULT_STATUS = {
|
|
153
154
|
id: '',
|
|
@@ -164,7 +165,7 @@ function fetchStatus(base, list) {
|
|
|
164
165
|
.catch(function () { return (__assign(__assign({}, DEFAULT_STATUS), { id: id })); });
|
|
165
166
|
});
|
|
166
167
|
return Promise.all([
|
|
167
|
-
blocks_1.fetchHeight(base),
|
|
168
|
+
(0, blocks_1.fetchHeight)(base),
|
|
168
169
|
Promise.all(loadAllTxInfo)
|
|
169
170
|
]).then(function (_a) {
|
|
170
171
|
var _b = __read(_a, 2), height = _b[0].height, statuses = _b[1];
|
|
@@ -174,20 +175,18 @@ function fetchStatus(base, list) {
|
|
|
174
175
|
});
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
|
-
exports.fetchStatus = fetchStatus;
|
|
178
178
|
function broadcast(base, tx, options) {
|
|
179
179
|
if (options === void 0) { options = Object.create(null); }
|
|
180
|
-
return request_1.default({
|
|
180
|
+
return (0, request_1.default)({
|
|
181
181
|
base: base,
|
|
182
182
|
url: '/transactions/broadcast',
|
|
183
|
-
options: utils_1.deepAssign(__assign({}, options), {
|
|
183
|
+
options: (0, utils_1.deepAssign)(__assign({}, options), {
|
|
184
184
|
method: 'POST',
|
|
185
|
-
body: stringify_1.default(tx),
|
|
185
|
+
body: (0, stringify_1.default)(tx),
|
|
186
186
|
headers: {
|
|
187
187
|
'Content-Type': 'application/json'
|
|
188
188
|
}
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
exports.broadcast = broadcast;
|
|
193
192
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/transactions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/transactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,oDAKC;AAiBD,8CAmBC;AAWD,4CAMC;AASD,8CAeC;AAMD,oDAMC;AAcD,8BAMC;AAMD,8CAMC;AAED,kCAiCC;AAeD,8BAcC;AAnND,6CAA2E;AAE3E,oCAAsC;AACtC,gEAAyD;AACzD,4DAAsC;AACtC,2CAA6C;AAC7C,oEAA8C;AAW9C;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC7C,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,gCAAgC;KACxC,CAAC,CAAA;AACN,CAAC;AAOD,0CAA0C;AAC1C;;;GAGG;AAEH;;;GAGG;AACH,SAAgB,iBAAiB,CAC7B,IAAY,EACZ,EAAmD,EACnD,OAA0C;IAA1C,wBAAA,EAAA,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE1C,OAAO,IAAA,iBAAO,EAAC;QACX,IAAI,MAAA;QACJ,GAAG,EAAE,4BAA4B;QACjC,OAAO,EAAE,IAAA,kBAAU,eACX,OAAO,GACX;YACI,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAA,mBAAS,E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