@waves/node-api-js 1.2.6-cjs.0 → 1.2.7
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.js +2 -2
- package/cjs/api-node/activation/index.js.map +1 -1
- package/cjs/api-node/addresses/index.d.ts +2 -0
- package/cjs/api-node/addresses/index.js +105 -46
- package/cjs/api-node/addresses/index.js.map +1 -1
- package/cjs/api-node/alias/index.js +5 -5
- package/cjs/api-node/alias/index.js.map +1 -1
- package/cjs/api-node/assets/index.d.ts +16 -2
- package/cjs/api-node/assets/index.js +137 -63
- package/cjs/api-node/assets/index.js.map +1 -1
- package/cjs/api-node/blocks/index.d.ts +2 -2
- package/cjs/api-node/blocks/index.js +60 -49
- package/cjs/api-node/blocks/index.js.map +1 -1
- package/cjs/api-node/consensus/index.js +6 -5
- package/cjs/api-node/consensus/index.js.map +1 -1
- package/cjs/api-node/debug/index.d.ts +100 -0
- package/cjs/api-node/debug/index.js +196 -15
- package/cjs/api-node/debug/index.js.map +1 -1
- package/cjs/api-node/eth/index.js +5 -5
- package/cjs/api-node/eth/index.js.map +1 -1
- package/cjs/api-node/leasing/index.js +19 -7
- package/cjs/api-node/leasing/index.js.map +1 -1
- package/cjs/api-node/node/index.js +7 -5
- package/cjs/api-node/node/index.js.map +1 -1
- package/cjs/api-node/peers/index.js +17 -13
- package/cjs/api-node/peers/index.js.map +1 -1
- package/cjs/api-node/rewards/index.js +6 -5
- package/cjs/api-node/rewards/index.js.map +1 -1
- package/cjs/api-node/transactions/index.d.ts +9 -5
- package/cjs/api-node/transactions/index.js +94 -43
- package/cjs/api-node/transactions/index.js.map +1 -1
- package/cjs/api-node/utils/index.js +22 -22
- package/cjs/api-node/utils/index.js.map +1 -1
- package/cjs/create.d.ts +6 -248
- package/cjs/create.js +59 -59
- package/cjs/create.js.map +1 -1
- package/cjs/index.js +5 -5
- package/cjs/index.js.map +1 -1
- package/cjs/interface.js +6 -2
- package/cjs/interface.js.map +1 -1
- package/cjs/tools/adresses/availableSponsoredBalances.js +9 -9
- package/cjs/tools/adresses/availableSponsoredBalances.js.map +1 -1
- package/cjs/tools/adresses/ethAddress2waves.js +29 -16
- package/cjs/tools/adresses/ethAddress2waves.js.map +1 -1
- package/cjs/tools/adresses/getAssetIdListByTx.js +36 -15
- package/cjs/tools/adresses/getAssetIdListByTx.js.map +1 -1
- package/cjs/tools/adresses/getAssetsByTransaction.js +4 -4
- package/cjs/tools/adresses/getAssetsByTransaction.js.map +1 -1
- package/cjs/tools/adresses/getTransactionsWithAssets.d.ts +2 -3
- package/cjs/tools/adresses/getTransactionsWithAssets.js +3 -3
- package/cjs/tools/adresses/getTransactionsWithAssets.js.map +1 -1
- package/cjs/tools/adresses/watch.js +85 -56
- package/cjs/tools/adresses/watch.js.map +1 -1
- package/cjs/tools/adresses/wavesAddress2eth.js +4 -4
- package/cjs/tools/adresses/wavesAddress2eth.js.map +1 -1
- package/cjs/tools/assets/wavesAsset2eth.js +4 -4
- package/cjs/tools/assets/wavesAsset2eth.js.map +1 -1
- package/cjs/tools/blocks/detectInterval.js +4 -4
- package/cjs/tools/blocks/detectInterval.js.map +1 -1
- package/cjs/tools/blocks/getNetworkByte.js +6 -6
- 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 +36 -13
- package/cjs/tools/blocks/waitHeight.js.map +1 -1
- package/cjs/tools/parse.js +2 -2
- package/cjs/tools/parse.js.map +1 -1
- package/cjs/tools/query.js +34 -8
- package/cjs/tools/query.js.map +1 -1
- package/cjs/tools/request.d.ts +2 -1
- package/cjs/tools/request.js +21 -7
- package/cjs/tools/request.js.map +1 -1
- package/cjs/tools/stringify.js +7 -4
- package/cjs/tools/stringify.js.map +1 -1
- package/cjs/tools/transactions/broadcast.js +29 -18
- 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/transactions.js +65 -51
- package/cjs/tools/transactions/transactions.js.map +1 -1
- package/cjs/tools/transactions/wait.js +16 -16
- package/cjs/tools/transactions/wait.js.map +1 -1
- package/cjs/tools/utils.js +63 -30
- package/cjs/tools/utils.js.map +1 -1
- package/dist/0.node-api.js +455 -0
- package/dist/node-api.js +367 -720
- package/dist/node-api.min.js +5 -5
- package/es/api-node/addresses/index.d.ts +2 -0
- package/es/api-node/addresses/index.js +17 -1
- package/es/api-node/addresses/index.js.map +1 -1
- package/es/api-node/assets/index.d.ts +16 -2
- package/es/api-node/assets/index.js +13 -6
- package/es/api-node/assets/index.js.map +1 -1
- package/es/api-node/blocks/index.d.ts +2 -2
- package/es/api-node/debug/index.d.ts +100 -0
- package/es/api-node/debug/index.js +147 -1
- package/es/api-node/debug/index.js.map +1 -1
- package/es/api-node/transactions/index.d.ts +9 -5
- package/es/api-node/transactions/index.js +12 -3
- package/es/api-node/transactions/index.js.map +1 -1
- package/es/create.d.ts +6 -248
- package/es/tools/adresses/getTransactionsWithAssets.d.ts +2 -3
- package/es/tools/adresses/watch.js.map +1 -1
- package/es/tools/request.d.ts +2 -1
- package/es/tools/request.js +2 -2
- package/es/tools/request.js.map +1 -1
- package/es/tools/stringify.js +5 -2
- package/es/tools/stringify.js.map +1 -1
- package/package.json +7 -7
|
@@ -8,6 +8,8 @@ export declare function fetchScriptInfo(base: string, address: string, options?:
|
|
|
8
8
|
export declare function data(base: string, address: string, params?: IDataQueryParams, options?: RequestInit): Promise<Array<DataTransactionEntry<TLong>>>;
|
|
9
9
|
export declare function fetchValidate(base: string, address: string): Promise<IValidateResponse>;
|
|
10
10
|
export declare function fetchBalance(base: string, address: string, options?: RequestInit): Promise<IBalanceConfirmations<TLong>>;
|
|
11
|
+
export declare function fetchMultipleBalance(base: string, addresses: string[], options?: RequestInit): Promise<IBalanceConfirmations<TLong>[]>;
|
|
12
|
+
export declare function deleteAddressFromWallet(base: string, address: string, options?: RequestInit): Promise<IBalanceConfirmations<TLong> | IBalanceConfirmations<TLong>[]>;
|
|
11
13
|
export declare function fetchEffectiveBalanceConfirmations(base: string, address: string, confirmations: number, options?: RequestInit): Promise<IBalanceConfirmations<TLong>>;
|
|
12
14
|
export declare function fetchEffectiveBalance(base: string, address: string, options?: RequestInit): Promise<IBalanceConfirmations<TLong>>;
|
|
13
15
|
export declare function fetchSeq(base: string, from: number, to: number): Promise<Array<string>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import request from '../../tools/request';
|
|
1
|
+
import request, { parseResponse } from '../../tools/request';
|
|
2
2
|
import query from '../../tools/query';
|
|
3
3
|
export function fetchDataKey(base, address, key, options = Object.create(null)) {
|
|
4
4
|
return request({
|
|
@@ -54,6 +54,22 @@ export function fetchBalance(base, address, options = Object.create(null)) {
|
|
|
54
54
|
options
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
+
export function fetchMultipleBalance(base, addresses, options = Object.create(null)) {
|
|
58
|
+
return fetch(`${base}/addresses/balance`, {
|
|
59
|
+
method: "POST",
|
|
60
|
+
body: JSON.stringify({ addresses }),
|
|
61
|
+
headers: {
|
|
62
|
+
"Content-Type": "application/json"
|
|
63
|
+
}
|
|
64
|
+
}).then(parseResponse);
|
|
65
|
+
}
|
|
66
|
+
export function deleteAddressFromWallet(base, address, options = Object.create(null)) {
|
|
67
|
+
return request({
|
|
68
|
+
base,
|
|
69
|
+
url: `/addresses/${address}`,
|
|
70
|
+
options: Object.assign(Object.assign({}, options), { method: 'DELETE' })
|
|
71
|
+
});
|
|
72
|
+
}
|
|
57
73
|
export function fetchEffectiveBalanceConfirmations(base, address, confirmations, options = Object.create(null)) {
|
|
58
74
|
return request({
|
|
59
75
|
base,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/addresses/index.ts"],"names":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
export declare function fetchDetails(base: string, assetId: string, options?: RequestInit): Promise<TAssetDetails>;
|
|
8
8
|
export declare function fetchDetails(base: string, assetId: Array<string>, options?: RequestInit): Promise<Array<TAssetDetails>>;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* POST /assets/details
|
|
11
11
|
* Provides detailed information about the given assets
|
|
12
12
|
*/
|
|
13
13
|
export declare function fetchAssetsDetails(base: string, assetIds: Array<string>, options?: RequestInit): Promise<Array<TAssetDetails | TErrorResponse>>;
|
|
@@ -18,6 +18,17 @@ export declare function fetchAssetDistribution(base: string, assetId: string, he
|
|
|
18
18
|
* Asset balance distribution
|
|
19
19
|
*/
|
|
20
20
|
export declare function fetchAssetsAddressLimit(base: string, address: string, limit: number, options?: RequestInit): Promise<Array<TAssetDetails>>;
|
|
21
|
+
/**
|
|
22
|
+
* TODO
|
|
23
|
+
* GET assets/nft/${address}/limit/${limit}
|
|
24
|
+
* Asset balance distribution
|
|
25
|
+
*/
|
|
26
|
+
interface IFetchAssetsNftParams {
|
|
27
|
+
address: string;
|
|
28
|
+
limit: number;
|
|
29
|
+
after?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function fetchAssetsNft(base: string, { address, limit, after }: IFetchAssetsNftParams, options?: RequestInit): Promise<Array<TAssetDetails>>;
|
|
21
32
|
export declare function fetchAssetsBalance(base: string, address: string, options?: RequestInit): Promise<TAssetsBalance>;
|
|
22
33
|
export declare function fetchBalanceAddressAssetId(base: string, address: string, assetId: string, options?: RequestInit): Promise<IBalanceAddressAssetId>;
|
|
23
34
|
export interface IAssetDistribution {
|
|
@@ -41,7 +52,9 @@ export declare type TAssetBalance<LONG = TLong> = {
|
|
|
41
52
|
'minSponsoredAssetFee': LONG | null;
|
|
42
53
|
'sponsorBalance': LONG | null;
|
|
43
54
|
'quantity': LONG;
|
|
44
|
-
'issueTransaction': SignedTransaction<IssueTransaction & WithApiMixin
|
|
55
|
+
'issueTransaction': SignedTransaction<IssueTransaction & WithApiMixin> & {
|
|
56
|
+
feeAssetId: null;
|
|
57
|
+
};
|
|
45
58
|
};
|
|
46
59
|
export declare type TAssetDetails<LONG = TLong> = {
|
|
47
60
|
assetId: string;
|
|
@@ -62,3 +75,4 @@ export declare type TErrorResponse = {
|
|
|
62
75
|
error: number;
|
|
63
76
|
message: string;
|
|
64
77
|
};
|
|
78
|
+
export {};
|
|
@@ -20,15 +20,15 @@ export function fetchDetails(base, assetId, options = Object.create(null)) {
|
|
|
20
20
|
.then(list => isOnce ? list[0] : list);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* POST /assets/details
|
|
24
24
|
* Provides detailed information about the given assets
|
|
25
25
|
*/
|
|
26
26
|
export function fetchAssetsDetails(base, assetIds, options = Object.create(null)) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return request({ base, url: `/assets/details
|
|
27
|
+
const body = JSON.stringify({ ids: assetIds });
|
|
28
|
+
const _options = Object.assign(Object.assign({}, options), { body, headers: {
|
|
29
|
+
'content-type': 'application/json'
|
|
30
|
+
}, method: 'POST' });
|
|
31
|
+
return request({ base, url: `/assets/details`, options: _options });
|
|
32
32
|
}
|
|
33
33
|
export function fetchAssetDistribution(base, assetId, height, limit, options = Object.create(null)) {
|
|
34
34
|
return request({ base, url: `/assets/${assetId}/distribution/${height}/limit/${limit}`, options });
|
|
@@ -41,6 +41,13 @@ export function fetchAssetDistribution(base, assetId, height, limit, options = O
|
|
|
41
41
|
export function fetchAssetsAddressLimit(base, address, limit, options = Object.create(null)) {
|
|
42
42
|
return request({ base, url: `assets/nft/${address}/limit/${limit}`, options });
|
|
43
43
|
}
|
|
44
|
+
export function fetchAssetsNft(base, { address, limit, after }, options = Object.create(null)) {
|
|
45
|
+
const url = new URL(`assets/nft/${address}/limit/${limit}`, base);
|
|
46
|
+
if (after) {
|
|
47
|
+
url.searchParams.append('after', after);
|
|
48
|
+
}
|
|
49
|
+
return request({ base, url: `${url.pathname}${url.search}`, options });
|
|
50
|
+
}
|
|
44
51
|
export function fetchAssetsBalance(base, address, options = Object.create(null)) {
|
|
45
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
53
|
const balancesResponse = yield request({ base, url: `/assets/balance/${address}`, options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/assets/index.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAqD,gBAAgB,EAAe,MAAM,iBAAiB,CAAC;AACnH,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAQ1C,MAAM,UAAU,YAAY,CAAmC,IAAY,EAAE,OAAU,EAAE,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC/H,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAgB;QACjE,IAAI;QACJ,GAAG,EAAE,mBAAmB,EAAE,EAAE;QAC5B,OAAO;KACV,CAAC,CAAC,CAAC;SACC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,QAAuB,EAAE,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAChH,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/assets/index.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAqD,gBAAgB,EAAe,MAAM,iBAAiB,CAAC;AACnH,OAAO,OAAO,MAAM,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QAEH,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CAAA;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAY,EAAE,OAAe,EAAE,OAAe,EAAE,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACjI,OAAO,OAAO,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,mBAAmB,OAAO,IAAI,OAAO,EAAE,EAAE,OAAO,EAAC,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TLong } from '../../interface';
|
|
2
|
-
import {
|
|
2
|
+
import { TransactionFromNode, WithApiMixin } from '@waves/ts-types';
|
|
3
3
|
/**
|
|
4
4
|
* GET /blocks/headers/seq/{from}/{to}
|
|
5
5
|
* Get block headers at specified heights
|
|
@@ -127,5 +127,5 @@ export interface IBlockHeader {
|
|
|
127
127
|
}
|
|
128
128
|
export interface IBlock extends IBlockHeader {
|
|
129
129
|
fee: TLong;
|
|
130
|
-
transactions: Array<
|
|
130
|
+
transactions: Array<TransactionFromNode & WithApiMixin>;
|
|
131
131
|
}
|
|
@@ -86,4 +86,104 @@ export declare function fetchStateChangesByAddress(base: string, address: string
|
|
|
86
86
|
* @param txId
|
|
87
87
|
*/
|
|
88
88
|
export declare function fetchStateChangesByTxId(base: string, txId: string, options?: RequestInit): Promise<Transaction<TLong> & WithId & IWithStateChanges>;
|
|
89
|
+
export declare function postPeerToTheBanList(base: string, peer: string): Promise<any>;
|
|
90
|
+
export declare function fetchConfigInfo(base: string, apiKey: string): Promise<string>;
|
|
91
|
+
export declare function fetchDebugInfo(base: string, apiKey: string): Promise<IDebugInfo>;
|
|
92
|
+
export declare function fetchMinerInfo(base: string, apiKey: string): Promise<IMinerInfo<TLong>>;
|
|
93
|
+
export declare function fetchPortfolios(base: string, address: string, apiKey: string): Promise<IPortfolio<TLong>>;
|
|
94
|
+
export declare function debugPrint(base: string, message: string, apiKey: string): Promise<any>;
|
|
95
|
+
/**
|
|
96
|
+
* 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
|
|
97
|
+
* @param base
|
|
98
|
+
* @param height
|
|
99
|
+
* @param returnTransactionsToUtx
|
|
100
|
+
* @param apiKey
|
|
101
|
+
*/
|
|
102
|
+
export declare function debugRollback(base: string, height: number, returnTransactionsToUtx: boolean, apiKey: string): Promise<any>;
|
|
103
|
+
/**
|
|
104
|
+
* Rollback the state to the block with a given ID
|
|
105
|
+
* @param base
|
|
106
|
+
* @param height
|
|
107
|
+
* @param returnTransactionsToUtx
|
|
108
|
+
* @param apiKey
|
|
109
|
+
*/
|
|
110
|
+
export declare function debugRollbackTo(base: string, id: string, apiKey: string): Promise<any>;
|
|
111
|
+
/**
|
|
112
|
+
* Regular address balance at the current height
|
|
113
|
+
* @param base
|
|
114
|
+
* @param apiKey
|
|
115
|
+
*/
|
|
116
|
+
export declare function debugState(base: string, apiKey: string): Promise<Record<string, number | string>>;
|
|
117
|
+
/**
|
|
118
|
+
* Get state hash at height. Available only if node configuration contains waves.db.store-state-hashes = true option
|
|
119
|
+
* @param base
|
|
120
|
+
* @param height
|
|
121
|
+
*/
|
|
122
|
+
export declare function debugStateHash(base: string, height: number, options?: RequestInit): Promise<IStateHash>;
|
|
123
|
+
/**
|
|
124
|
+
* 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
|
|
125
|
+
* @param base
|
|
126
|
+
* @param height
|
|
127
|
+
* @param apiKey
|
|
128
|
+
*/
|
|
129
|
+
export declare function debugStateWaves(base: string, height: number, apiKey: string): Promise<Record<string, number | string>>;
|
|
130
|
+
/**
|
|
131
|
+
* Validates a transaction and measures time spent in milliseconds. You should use the JSON transaction format with proofs
|
|
132
|
+
* @param base
|
|
133
|
+
* @param transaction
|
|
134
|
+
*/
|
|
135
|
+
export declare function debugValidate(base: string, transaction: string): Promise<IValidateResponse>;
|
|
136
|
+
interface IDebugInfo {
|
|
137
|
+
"stateHeight": number;
|
|
138
|
+
"extensionLoaderState": string;
|
|
139
|
+
"historyReplierCacheSizes": {
|
|
140
|
+
"microBlockOwners": number;
|
|
141
|
+
"nextInvs": number;
|
|
142
|
+
"awaiting": number;
|
|
143
|
+
"successfullyReceived": number;
|
|
144
|
+
};
|
|
145
|
+
"microBlockSynchronizerCacheSizes": {
|
|
146
|
+
"microBlockOwners": number;
|
|
147
|
+
"nextInvs": number;
|
|
148
|
+
"awaiting": number;
|
|
149
|
+
"successfullyReceived": number;
|
|
150
|
+
};
|
|
151
|
+
"scoreObserverStats": {
|
|
152
|
+
"localScore": number;
|
|
153
|
+
"currentBestChannel": string;
|
|
154
|
+
"scoresCacheSize": number;
|
|
155
|
+
};
|
|
156
|
+
"minerState": string;
|
|
157
|
+
}
|
|
158
|
+
interface IMinerInfo<LONG> {
|
|
159
|
+
"address": string;
|
|
160
|
+
"miningBalance": LONG;
|
|
161
|
+
"timestamp": number;
|
|
162
|
+
}
|
|
163
|
+
interface IPortfolio<LONG> {
|
|
164
|
+
"balance": number;
|
|
165
|
+
"lease": {
|
|
166
|
+
"in": number;
|
|
167
|
+
"out": number;
|
|
168
|
+
};
|
|
169
|
+
"assets": Record<string, LONG>;
|
|
170
|
+
}
|
|
171
|
+
interface IStateHash {
|
|
172
|
+
stateHash: string;
|
|
173
|
+
wavesBalanceHash: string;
|
|
174
|
+
assetBalanceHash: string;
|
|
175
|
+
dataEntryHash: string;
|
|
176
|
+
accountScriptHash: string;
|
|
177
|
+
assetScriptHash: string;
|
|
178
|
+
leaseBalanceHash: string;
|
|
179
|
+
leaseStatusHash: string;
|
|
180
|
+
sponsorshipHash: string;
|
|
181
|
+
aliasHash: string;
|
|
182
|
+
blockId: string;
|
|
183
|
+
}
|
|
184
|
+
interface IValidateResponse {
|
|
185
|
+
valid: boolean;
|
|
186
|
+
validationTime: number;
|
|
187
|
+
"trace": string[];
|
|
188
|
+
}
|
|
89
189
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import request from '../../tools/request';
|
|
1
|
+
import request, { parseResponse } from '../../tools/request';
|
|
2
2
|
import query from '../../tools/query';
|
|
3
3
|
/**
|
|
4
4
|
* Waves balance history
|
|
@@ -38,6 +38,152 @@ export function fetchStateChangesByTxId(base, txId, options = Object.create(null
|
|
|
38
38
|
options
|
|
39
39
|
});
|
|
40
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
|
+
}
|
|
41
187
|
// @TODO need API key:
|
|
42
188
|
// GET /debug/stateWaves/{height}
|
|
43
189
|
// POST /debug/rollback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/debug/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/debug/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAGtC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,OAAe,EAAE,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACzG,OAAO,OAAO,CAAC;QACX,IAAI;QACJ,GAAG,EAAE,2BAA2B,OAAO,EAAE;QACzC,OAAO;KACV,CAAC,CAAC;AACP,CAAC;AAmED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACtC,IAAY,EACZ,OAAe,EACf,KAAa,EACb,KAAc,EACd,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE1C,OAAO,OAAO,CAAC;QACX,IAAI;QACJ,GAAG,EAAE,+BAA+B,OAAO,UAAU,KAAK,GAAG,KAAK,CAAC,EAAC,KAAK,EAAC,CAAC,EAAE;QAC7E,OAAO;KACV,CAAC,CAAC;AACP,CAAC;AAGD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,IAAY,EAAE,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1G,OAAO,OAAO,CAAC;QACX,IAAI;QACJ,GAAG,EAAE,4BAA4B,IAAI,EAAE;QACvC,OAAO;KACV,CAAC,CAAC;AACP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{ TLong } from '../../interface';
|
|
3
3
|
import { RequestInit } from '../../tools/request';
|
|
4
|
-
import { SignedTransaction, Transaction, TransactionMap, WithApiMixin } from '@waves/ts-types';
|
|
5
|
-
import { TTransaction } from "../../tools/transactions/transactions";
|
|
4
|
+
import { SignedTransaction, Transaction, TransactionFromNode, TransactionMap, WithApiMixin } from '@waves/ts-types';
|
|
6
5
|
/**
|
|
7
6
|
* GET /transactions/unconfirmed/size
|
|
8
7
|
* Number of unconfirmed transactions
|
|
@@ -38,7 +37,7 @@ export declare function fetchUnconfirmed(base: string, options?: RequestInit): P
|
|
|
38
37
|
* @param after искать транзакции после ID указанного в after
|
|
39
38
|
* @param retry количество попыток на выполнение запроса
|
|
40
39
|
*/
|
|
41
|
-
export declare function fetchTransactions(base: string, address: string, limit: number, after?: string, retry?: number, options?: RequestInit): Promise<Array<
|
|
40
|
+
export declare function fetchTransactions(base: string, address: string, limit: number, after?: string, retry?: number, options?: RequestInit): Promise<Array<TransactionFromNode>>;
|
|
42
41
|
/**
|
|
43
42
|
* GET /transactions/unconfirmed/info/{id}
|
|
44
43
|
* Unconfirmed transaction info
|
|
@@ -52,7 +51,12 @@ export declare function fetchUnconfirmedInfo(base: string, id: string, options?:
|
|
|
52
51
|
* GET /transactions/info/{id}
|
|
53
52
|
* Transaction info
|
|
54
53
|
*/
|
|
55
|
-
export declare function fetchInfo(base: string, id: string, options?: RequestInit): Promise<
|
|
54
|
+
export declare function fetchInfo(base: string, id: string, options?: RequestInit): Promise<TransactionFromNode>;
|
|
55
|
+
/**
|
|
56
|
+
* GET /transactions/info/
|
|
57
|
+
* Get transactions by IDs
|
|
58
|
+
*/
|
|
59
|
+
export declare function fetchMultipleInfo(base: string, ids: string[], options?: RequestInit): Promise<Array<TransactionFromNode>>;
|
|
56
60
|
export declare function fetchStatus(base: string, list: Array<string>): Promise<ITransactionsStatus>;
|
|
57
61
|
export interface ITransactionsStatus {
|
|
58
62
|
height: number;
|
|
@@ -4,7 +4,6 @@ import request from '../../tools/request';
|
|
|
4
4
|
import query from '../../tools/query';
|
|
5
5
|
import { deepAssign } from '../../tools/utils';
|
|
6
6
|
import stringify from '../../tools/stringify';
|
|
7
|
-
import { addStateUpdateField } from "../../tools/transactions/transactions";
|
|
8
7
|
/**
|
|
9
8
|
* GET /transactions/unconfirmed/size
|
|
10
9
|
* Number of unconfirmed transactions
|
|
@@ -61,7 +60,6 @@ export function fetchTransactions(base, address, limit, after, retry, options =
|
|
|
61
60
|
url: `/transactions/address/${address}/limit/${limit}${query({ after })}`,
|
|
62
61
|
options
|
|
63
62
|
}).then(([list]) => {
|
|
64
|
-
list.forEach(transaction => addStateUpdateField(transaction));
|
|
65
63
|
return list;
|
|
66
64
|
});
|
|
67
65
|
}
|
|
@@ -90,7 +88,18 @@ export function fetchInfo(base, id, options = Object.create(null)) {
|
|
|
90
88
|
base,
|
|
91
89
|
url: `/transactions/info/${id}`,
|
|
92
90
|
options
|
|
93
|
-
})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* GET /transactions/info/
|
|
95
|
+
* Get transactions by IDs
|
|
96
|
+
*/
|
|
97
|
+
export function fetchMultipleInfo(base, ids, options = Object.create(null)) {
|
|
98
|
+
return request({
|
|
99
|
+
base,
|
|
100
|
+
url: `/transactions/info${query({ id: ids })}`,
|
|
101
|
+
options
|
|
102
|
+
});
|
|
94
103
|
}
|
|
95
104
|
export function fetchStatus(base, list) {
|
|
96
105
|
const DEFAULT_STATUS = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-node/transactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAuB,MAAM,iBAAiB,CAAC;AAE3E,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,OAAsB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAC,UAAU,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