@waves/node-api-js 1.2.10 → 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 -99
- package/cjs/api-node/utils/index.js +210 -192
- package/cjs/api-node/utils/index.js.map +1 -1
- 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 -2402
- 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 -99
- package/es/api-node/utils/index.js +192 -175
- package/es/api-node/utils/index.js.map +1 -1
- 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
package/es/create.js
CHANGED
|
@@ -1,93 +1,90 @@
|
|
|
1
|
-
import * as addressesModule from './api-node/addresses';
|
|
2
|
-
import * as blocksModule from './api-node/blocks';
|
|
3
|
-
import * as transactionsModule from './api-node/transactions';
|
|
4
|
-
import * as leasingModule from './api-node/leasing';
|
|
5
|
-
import * as peersModule from './api-node/peers';
|
|
6
|
-
import * as rewardsModule from './api-node/rewards';
|
|
7
|
-
import * as utilsModule from './api-node/utils';
|
|
8
|
-
import * as debugModule from './api-node/debug';
|
|
9
|
-
import * as aliasModule from './api-node/alias';
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
function wrapRequest(base, callback) {
|
|
91
|
-
return callback.bind(null, base);
|
|
92
|
-
}
|
|
1
|
+
import * as addressesModule from './api-node/addresses';
|
|
2
|
+
import * as blocksModule from './api-node/blocks';
|
|
3
|
+
import * as transactionsModule from './api-node/transactions';
|
|
4
|
+
import * as leasingModule from './api-node/leasing';
|
|
5
|
+
import * as peersModule from './api-node/peers';
|
|
6
|
+
import * as rewardsModule from './api-node/rewards';
|
|
7
|
+
import * as utilsModule from './api-node/utils';
|
|
8
|
+
import * as debugModule from './api-node/debug';
|
|
9
|
+
import * as aliasModule from './api-node/alias';
|
|
10
|
+
import * as activationModule from './api-node/activation';
|
|
11
|
+
import * as nodeModule from './api-node/node';
|
|
12
|
+
import * as assetsModule from './api-node/assets';
|
|
13
|
+
import * as ethModule from './api-node/eth';
|
|
14
|
+
import query from './tools/query';
|
|
15
|
+
import resolve from './tools/resolve';
|
|
16
|
+
import request from './tools/request';
|
|
17
|
+
import broadcast from './tools/transactions/broadcast';
|
|
18
|
+
import getAssetsByTransaction from './tools/adresses/getAssetsByTransaction';
|
|
19
|
+
import getAssetIdListByTx from './tools/adresses/getAssetIdListByTx';
|
|
20
|
+
import getTransactionsWithAssets from './tools/adresses/getTransactionsWithAssets';
|
|
21
|
+
import availableSponsoredBalances from './tools/adresses/availableSponsoredBalances';
|
|
22
|
+
import wait from './tools/transactions/wait';
|
|
23
|
+
import parse from './tools/parse';
|
|
24
|
+
import getNetworkByte from './tools/blocks/getNetworkByte';
|
|
25
|
+
import getNetworkCode from './tools/blocks/getNetworkCode';
|
|
26
|
+
import createWatch from './tools/adresses/watch';
|
|
27
|
+
import * as toolsUtilsModule from './tools/utils';
|
|
28
|
+
export function create(base) {
|
|
29
|
+
const addresses = wrapRecord(base, addressesModule);
|
|
30
|
+
const blocks = wrapRecord(base, blocksModule);
|
|
31
|
+
const transactions = wrapRecord(base, transactionsModule);
|
|
32
|
+
const leasing = wrapRecord(base, leasingModule);
|
|
33
|
+
const peers = wrapRecord(base, peersModule);
|
|
34
|
+
const rewards = wrapRecord(base, rewardsModule);
|
|
35
|
+
const utils = wrapRecord(base, utilsModule);
|
|
36
|
+
const debug = wrapRecord(base, debugModule);
|
|
37
|
+
const alias = wrapRecord(base, aliasModule);
|
|
38
|
+
const activation = wrapRecord(base, activationModule);
|
|
39
|
+
const node = wrapRecord(base, nodeModule);
|
|
40
|
+
const assets = wrapRecord(base, assetsModule);
|
|
41
|
+
const eth = wrapRecord(base, ethModule);
|
|
42
|
+
const tools = {
|
|
43
|
+
transactions: {
|
|
44
|
+
broadcast: wrapRequest(base, broadcast),
|
|
45
|
+
wait: wrapRequest(base, wait)
|
|
46
|
+
},
|
|
47
|
+
blocks: {
|
|
48
|
+
getNetworkByte: wrapRequest(base, getNetworkByte),
|
|
49
|
+
getNetworkCode: wrapRequest(base, getNetworkCode)
|
|
50
|
+
},
|
|
51
|
+
addresses: {
|
|
52
|
+
createWatch: wrapRequest(base, createWatch),
|
|
53
|
+
getAssetsByTransaction: wrapRequest(base, getAssetsByTransaction),
|
|
54
|
+
getAssetIdListByTx,
|
|
55
|
+
getTransactionsWithAssets: wrapRequest(base, getTransactionsWithAssets),
|
|
56
|
+
availableSponsoredBalances: wrapRequest(base, availableSponsoredBalances)
|
|
57
|
+
},
|
|
58
|
+
utils: toolsUtilsModule,
|
|
59
|
+
query,
|
|
60
|
+
resolve,
|
|
61
|
+
request,
|
|
62
|
+
parse
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
addresses,
|
|
66
|
+
blocks,
|
|
67
|
+
transactions,
|
|
68
|
+
leasing,
|
|
69
|
+
tools,
|
|
70
|
+
peers,
|
|
71
|
+
rewards,
|
|
72
|
+
utils,
|
|
73
|
+
debug,
|
|
74
|
+
alias,
|
|
75
|
+
activation,
|
|
76
|
+
node,
|
|
77
|
+
assets,
|
|
78
|
+
eth
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function wrapRecord(base, hash) {
|
|
82
|
+
return Object.keys(hash).reduce((acc, methodName) => {
|
|
83
|
+
acc[methodName] = wrapRequest(base, hash[methodName]);
|
|
84
|
+
return acc;
|
|
85
|
+
}, {});
|
|
86
|
+
}
|
|
87
|
+
function wrapRequest(base, callback) {
|
|
88
|
+
return callback.bind(null, base);
|
|
89
|
+
}
|
|
93
90
|
//# sourceMappingURL=create.js.map
|
package/es/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,K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avesAddress2eth from "./tools/adresses/wavesAddress2eth";
|
|
2
|
-
import ethAddress2waves from "./tools/adresses/ethAddress2waves";
|
|
3
|
-
import wavesAsset2Eth from "./tools/assets/wavesAsset2eth";
|
|
4
|
-
import ethTxId2waves from "./tools/transactions/ethTxId2waves";
|
|
5
|
-
import { create as createFn } from './create';
|
|
6
|
-
export { wavesAddress2eth, ethAddress2waves, wavesAsset2Eth, ethTxId2waves };
|
|
7
|
-
export declare const create: typeof createFn;
|
|
8
|
-
export default createFn;
|
|
9
|
-
export { ICallableFuncArgumentType, TCallableFuncArgumentsArray, TCallableFuncArgumentsRecord, TCallableFuncArguments, } from './api-node/addresses';
|
|
1
|
+
import wavesAddress2eth from "./tools/adresses/wavesAddress2eth";
|
|
2
|
+
import ethAddress2waves from "./tools/adresses/ethAddress2waves";
|
|
3
|
+
import wavesAsset2Eth from "./tools/assets/wavesAsset2eth";
|
|
4
|
+
import ethTxId2waves from "./tools/transactions/ethTxId2waves";
|
|
5
|
+
import { create as createFn } from './create';
|
|
6
|
+
export { wavesAddress2eth, ethAddress2waves, wavesAsset2Eth, ethTxId2waves };
|
|
7
|
+
export declare const create: typeof createFn;
|
|
8
|
+
export default createFn;
|
|
9
|
+
export { ICallableFuncArgumentType, TCallableFuncArgumentsArray, TCallableFuncArgumentsRecord, TCallableFuncArguments, } from './api-node/addresses';
|
package/es/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import wavesAddress2eth from "./tools/adresses/wavesAddress2eth";
|
|
2
|
-
import ethAddress2waves from "./tools/adresses/ethAddress2waves";
|
|
3
|
-
import wavesAsset2Eth from "./tools/assets/wavesAsset2eth";
|
|
4
|
-
import ethTxId2waves from "./tools/transactions/ethTxId2waves";
|
|
5
|
-
import { create as createFn } from './create';
|
|
6
|
-
export { wavesAddress2eth, ethAddress2waves, wavesAsset2Eth, ethTxId2waves };
|
|
7
|
-
export const create = createFn;
|
|
8
|
-
export default createFn;
|
|
1
|
+
import wavesAddress2eth from "./tools/adresses/wavesAddress2eth";
|
|
2
|
+
import ethAddress2waves from "./tools/adresses/ethAddress2waves";
|
|
3
|
+
import wavesAsset2Eth from "./tools/assets/wavesAsset2eth";
|
|
4
|
+
import ethTxId2waves from "./tools/transactions/ethTxId2waves";
|
|
5
|
+
import { create as createFn } from './create';
|
|
6
|
+
export { wavesAddress2eth, ethAddress2waves, wavesAsset2Eth, ethTxId2waves };
|
|
7
|
+
export const create = createFn;
|
|
8
|
+
export default createFn;
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/es/interface.d.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { IScriptInfoMeta, TCallableFuncArguments, TCallableFuncArgumentsArray } from './api-node/addresses';
|
|
2
|
-
export declare type TParse<T> = (json: string) => T;
|
|
3
|
-
export declare type TLong = string | number;
|
|
4
|
-
export interface IRequestOptions {
|
|
5
|
-
retry?: number;
|
|
6
|
-
parse?: TParse<any>;
|
|
7
|
-
}
|
|
8
|
-
export declare type TRANSACTION_TYPE_MAP = {
|
|
9
|
-
3: 'issue';
|
|
10
|
-
4: 'transfer';
|
|
11
|
-
5: 'reissue';
|
|
12
|
-
6: 'burn';
|
|
13
|
-
7: 'exchange';
|
|
14
|
-
8: 'lease';
|
|
15
|
-
9: 'cancelLease';
|
|
16
|
-
10: 'alias';
|
|
17
|
-
11: 'massTransfer';
|
|
18
|
-
12: 'data';
|
|
19
|
-
13: 'setScript';
|
|
20
|
-
14: 'sponsorship';
|
|
21
|
-
15: 'setAssetScript';
|
|
22
|
-
16: 'invoke';
|
|
23
|
-
};
|
|
24
|
-
export declare type TRANSACTION_NAME_MAP = {
|
|
25
|
-
issue: 3;
|
|
26
|
-
transfer: 4;
|
|
27
|
-
reissue: 5;
|
|
28
|
-
burn: 6;
|
|
29
|
-
exchange: 7;
|
|
30
|
-
lease: 8;
|
|
31
|
-
cancelLease: 9;
|
|
32
|
-
alias: 10;
|
|
33
|
-
massTransfer: 11;
|
|
34
|
-
data: 12;
|
|
35
|
-
setScript: 13;
|
|
36
|
-
sponsorship: 14;
|
|
37
|
-
setAssetScript: 15;
|
|
38
|
-
invoke: 16;
|
|
39
|
-
};
|
|
40
|
-
export interface IWithApplicationStatus {
|
|
41
|
-
applicationStatus?: 'succeed' | 'script_execution_failed';
|
|
42
|
-
}
|
|
43
|
-
export declare const isCallableFuncArrayArguments: (scriptInfoMeta: IScriptInfoMeta<TCallableFuncArguments>) => scriptInfoMeta is IScriptInfoMeta<TCallableFuncArgumentsArray>;
|
|
44
|
-
export declare const isCallableFuncRecordArguments: (scriptInfoMeta: IScriptInfoMeta<TCallableFuncArguments>) => scriptInfoMeta is IScriptInfoMeta<Record<string, import("./api-node/addresses").ICallableFuncArgumentType>>;
|
|
1
|
+
import { IScriptInfoMeta, TCallableFuncArguments, TCallableFuncArgumentsArray } from './api-node/addresses';
|
|
2
|
+
export declare type TParse<T> = (json: string) => T;
|
|
3
|
+
export declare type TLong = string | number;
|
|
4
|
+
export interface IRequestOptions {
|
|
5
|
+
retry?: number;
|
|
6
|
+
parse?: TParse<any>;
|
|
7
|
+
}
|
|
8
|
+
export declare type TRANSACTION_TYPE_MAP = {
|
|
9
|
+
3: 'issue';
|
|
10
|
+
4: 'transfer';
|
|
11
|
+
5: 'reissue';
|
|
12
|
+
6: 'burn';
|
|
13
|
+
7: 'exchange';
|
|
14
|
+
8: 'lease';
|
|
15
|
+
9: 'cancelLease';
|
|
16
|
+
10: 'alias';
|
|
17
|
+
11: 'massTransfer';
|
|
18
|
+
12: 'data';
|
|
19
|
+
13: 'setScript';
|
|
20
|
+
14: 'sponsorship';
|
|
21
|
+
15: 'setAssetScript';
|
|
22
|
+
16: 'invoke';
|
|
23
|
+
};
|
|
24
|
+
export declare type TRANSACTION_NAME_MAP = {
|
|
25
|
+
issue: 3;
|
|
26
|
+
transfer: 4;
|
|
27
|
+
reissue: 5;
|
|
28
|
+
burn: 6;
|
|
29
|
+
exchange: 7;
|
|
30
|
+
lease: 8;
|
|
31
|
+
cancelLease: 9;
|
|
32
|
+
alias: 10;
|
|
33
|
+
massTransfer: 11;
|
|
34
|
+
data: 12;
|
|
35
|
+
setScript: 13;
|
|
36
|
+
sponsorship: 14;
|
|
37
|
+
setAssetScript: 15;
|
|
38
|
+
invoke: 16;
|
|
39
|
+
};
|
|
40
|
+
export interface IWithApplicationStatus {
|
|
41
|
+
applicationStatus?: 'succeed' | 'script_execution_failed';
|
|
42
|
+
}
|
|
43
|
+
export declare const isCallableFuncArrayArguments: (scriptInfoMeta: IScriptInfoMeta<TCallableFuncArguments>) => scriptInfoMeta is IScriptInfoMeta<TCallableFuncArgumentsArray>;
|
|
44
|
+
export declare const isCallableFuncRecordArguments: (scriptInfoMeta: IScriptInfoMeta<TCallableFuncArguments>) => scriptInfoMeta is IScriptInfoMeta<Record<string, import("./api-node/addresses").ICallableFuncArgumentType>>;
|
package/es/interface.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const isCallableFuncArrayArguments = (scriptInfoMeta) => !!scriptInfoMeta.isArrayArguments;
|
|
2
|
-
export const isCallableFuncRecordArguments = (scriptInfoMeta) => !scriptInfoMeta.isArrayArguments;
|
|
1
|
+
export const isCallableFuncArrayArguments = (scriptInfoMeta) => !!scriptInfoMeta.isArrayArguments;
|
|
2
|
+
export const isCallableFuncRecordArguments = (scriptInfoMeta) => !scriptInfoMeta.isArrayArguments;
|
|
3
3
|
//# sourceMappingURL=interface.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TLong } from '../../interface';
|
|
2
|
-
export default function (base: string, address: string, wavesFee: TLong): Promise<Array<TAssetFeeInfo>>;
|
|
3
|
-
export declare type TAssetFeeInfo = {
|
|
4
|
-
assetId: string;
|
|
5
|
-
wavesFee: TLong;
|
|
6
|
-
assetFee: TLong;
|
|
7
|
-
};
|
|
1
|
+
import { TLong } from '../../interface';
|
|
2
|
+
export default function (base: string, address: string, wavesFee: TLong): Promise<Array<TAssetFeeInfo>>;
|
|
3
|
+
export declare type TAssetFeeInfo = {
|
|
4
|
+
assetId: string;
|
|
5
|
+
wavesFee: TLong;
|
|
6
|
+
assetFee: TLong;
|
|
7
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { BigNumber } from '@waves/bignumber';
|
|
2
|
-
import { fetchAssetsBalance } from '../../api-node/assets';
|
|
3
|
-
import { filter, map, pipe, prop } from '../utils';
|
|
4
|
-
export default function (base, address, wavesFee) {
|
|
5
|
-
return fetchAssetsBalance(base, address).then(pipe(prop('balances'), filter(canBeSponsor(wavesFee)), map(currentFee(wavesFee))));
|
|
6
|
-
}
|
|
7
|
-
function canBeSponsor(wavesFee) {
|
|
8
|
-
return balance => (balance.minSponsoredAssetFee
|
|
9
|
-
&& BigNumber.toBigNumber(balance.sponsorBalance || 0)
|
|
10
|
-
.gte(wavesFee)
|
|
11
|
-
&& BigNumber.toBigNumber(wavesFee)
|
|
12
|
-
.div(0.001 * Math.pow(10, 8))
|
|
13
|
-
.mul(balance.minSponsoredAssetFee)
|
|
14
|
-
.lte(balance.balance)) || false;
|
|
15
|
-
}
|
|
16
|
-
function currentFee(wavesFee) {
|
|
17
|
-
const count = BigNumber.toBigNumber(wavesFee)
|
|
18
|
-
.div(0.001 * Math.pow(10, 8));
|
|
19
|
-
return balance => ({
|
|
20
|
-
assetId: balance.assetId,
|
|
21
|
-
wavesFee,
|
|
22
|
-
assetFee: BigNumber.toBigNumber(balance.minSponsoredAssetFee)
|
|
23
|
-
.mul(count)
|
|
24
|
-
.toFixed()
|
|
25
|
-
});
|
|
26
|
-
}
|
|
1
|
+
import { BigNumber } from '@waves/bignumber';
|
|
2
|
+
import { fetchAssetsBalance } from '../../api-node/assets';
|
|
3
|
+
import { filter, map, pipe, prop } from '../utils';
|
|
4
|
+
export default function (base, address, wavesFee) {
|
|
5
|
+
return fetchAssetsBalance(base, address).then(pipe(prop('balances'), filter(canBeSponsor(wavesFee)), map(currentFee(wavesFee))));
|
|
6
|
+
}
|
|
7
|
+
function canBeSponsor(wavesFee) {
|
|
8
|
+
return balance => (balance.minSponsoredAssetFee
|
|
9
|
+
&& BigNumber.toBigNumber(balance.sponsorBalance || 0)
|
|
10
|
+
.gte(wavesFee)
|
|
11
|
+
&& BigNumber.toBigNumber(wavesFee)
|
|
12
|
+
.div(0.001 * Math.pow(10, 8))
|
|
13
|
+
.mul(balance.minSponsoredAssetFee)
|
|
14
|
+
.lte(balance.balance)) || false;
|
|
15
|
+
}
|
|
16
|
+
function currentFee(wavesFee) {
|
|
17
|
+
const count = BigNumber.toBigNumber(wavesFee)
|
|
18
|
+
.div(0.001 * Math.pow(10, 8));
|
|
19
|
+
return balance => ({
|
|
20
|
+
assetId: balance.assetId,
|
|
21
|
+
wavesFee,
|
|
22
|
+
assetFee: BigNumber.toBigNumber(balance.minSponsoredAssetFee)
|
|
23
|
+
.mul(count)
|
|
24
|
+
.toFixed()
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=availableSponsoredBalances.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function ethAddress2waves(ethAddress: string, chainId: number): string;
|
|
1
|
+
export default function ethAddress2waves(ethAddress: string, chainId: number): string;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { keccak, blake2b, base58Encode, base16Decode } from '@waves/ts-lib-crypto';
|
|
2
|
-
const validateEthAddress = (addr) => {
|
|
3
|
-
return addr != null && addr.length == 42;
|
|
4
|
-
};
|
|
5
|
-
export default function ethAddress2waves(ethAddress, chainId) {
|
|
6
|
-
if (validateEthAddress(ethAddress)) {
|
|
7
|
-
ethAddress = ethAddress.substr(2);
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
throw `Invalid ethereum address: ${ethAddress} `;
|
|
11
|
-
}
|
|
12
|
-
const prefixBytes = new Uint8Array([0x01, chainId]);
|
|
13
|
-
// Раскодировать HEX строку в байты (PK_HASH)
|
|
14
|
-
const pkHashBytes = base16Decode(ethAddress);
|
|
15
|
-
// Сделать чексумму CHECKSUM=keccak256(blake2b256([0x01, CHAIN_ID] + PK_HASH))
|
|
16
|
-
const checksumBytes = new Uint8Array([
|
|
17
|
-
...prefixBytes,
|
|
18
|
-
...pkHashBytes
|
|
19
|
-
]);
|
|
20
|
-
const checksum = keccak(blake2b(checksumBytes));
|
|
21
|
-
// склеить [0x01, CHAIN_ID] (два байта) + PK_HASH (изначальные 20 байт) + CHECKSUM[1:4] (первые четыре байта чексуммы)
|
|
22
|
-
const wavesBytes = new Uint8Array([
|
|
23
|
-
...prefixBytes,
|
|
24
|
-
...pkHashBytes.slice(0, 20),
|
|
25
|
-
...checksum.slice(0, 4)
|
|
26
|
-
]);
|
|
27
|
-
// закодировать в base58
|
|
28
|
-
const wavesAddress = base58Encode(wavesBytes);
|
|
29
|
-
return wavesAddress;
|
|
30
|
-
}
|
|
1
|
+
import { keccak, blake2b, base58Encode, base16Decode } from '@waves/ts-lib-crypto';
|
|
2
|
+
const validateEthAddress = (addr) => {
|
|
3
|
+
return addr != null && addr.length == 42;
|
|
4
|
+
};
|
|
5
|
+
export default function ethAddress2waves(ethAddress, chainId) {
|
|
6
|
+
if (validateEthAddress(ethAddress)) {
|
|
7
|
+
ethAddress = ethAddress.substr(2);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
throw `Invalid ethereum address: ${ethAddress} `;
|
|
11
|
+
}
|
|
12
|
+
const prefixBytes = new Uint8Array([0x01, chainId]);
|
|
13
|
+
// Раскодировать HEX строку в байты (PK_HASH)
|
|
14
|
+
const pkHashBytes = base16Decode(ethAddress);
|
|
15
|
+
// Сделать чексумму CHECKSUM=keccak256(blake2b256([0x01, CHAIN_ID] + PK_HASH))
|
|
16
|
+
const checksumBytes = new Uint8Array([
|
|
17
|
+
...prefixBytes,
|
|
18
|
+
...pkHashBytes
|
|
19
|
+
]);
|
|
20
|
+
const checksum = keccak(blake2b(checksumBytes));
|
|
21
|
+
// склеить [0x01, CHAIN_ID] (два байта) + PK_HASH (изначальные 20 байт) + CHECKSUM[1:4] (первые четыре байта чексуммы)
|
|
22
|
+
const wavesBytes = new Uint8Array([
|
|
23
|
+
...prefixBytes,
|
|
24
|
+
...pkHashBytes.slice(0, 20),
|
|
25
|
+
...checksum.slice(0, 4)
|
|
26
|
+
]);
|
|
27
|
+
// закодировать в base58
|
|
28
|
+
const wavesAddress = base58Encode(wavesBytes);
|
|
29
|
+
return wavesAddress;
|
|
30
|
+
}
|
|
31
31
|
//# sourceMappingURL=ethAddress2waves.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Transaction, TransactionFromNode } from '@waves/ts-types';
|
|
2
|
-
export default function (tx: Array<Transaction> | Transaction | TransactionFromNode | TransactionFromNode[]): Array<string>;
|
|
1
|
+
import { Transaction, TransactionFromNode } from '@waves/ts-types';
|
|
2
|
+
export default function (tx: Array<Transaction> | Transaction | TransactionFromNode | TransactionFromNode[]): Array<string>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { prop, switchTransactionByType, toArray } from '../utils';
|
|
2
|
-
import { NAME_MAP } from '../../constants';
|
|
3
|
-
const getAssetIdList = switchTransactionByType({
|
|
4
|
-
[NAME_MAP.transfer]: tx => [tx.assetId, tx.feeAssetId],
|
|
5
|
-
[NAME_MAP.burn]: tx => [tx.assetId],
|
|
6
|
-
[NAME_MAP.reissue]: tx => [tx.assetId],
|
|
7
|
-
[NAME_MAP.exchange]: tx => Array.from(new Set([
|
|
8
|
-
tx.order1.assetPair.amountAsset,
|
|
9
|
-
tx.order1.assetPair.priceAsset,
|
|
10
|
-
tx.order1.version === 3 ? tx.order1.matcherFeeAssetId : null,
|
|
11
|
-
tx.order2.version === 3 ? tx.order2.matcherFeeAssetId : null
|
|
12
|
-
])),
|
|
13
|
-
[NAME_MAP.massTransfer]: tx => [tx.assetId],
|
|
14
|
-
[NAME_MAP.setAssetScript]: tx => [tx.assetId],
|
|
15
|
-
[NAME_MAP.sponsorship]: tx => [tx.assetId],
|
|
16
|
-
[NAME_MAP.invoke]: tx => [...(tx.payment || []).map(prop('assetId')), tx.feeAssetId],
|
|
17
|
-
[NAME_MAP.updateAsset]: tx => [tx.assetId]
|
|
18
|
-
});
|
|
19
|
-
export default function (tx) {
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
const idList = toArray(tx).reduce((acc, tx) => acc.concat(getAssetIdList(tx) || []), []).filter(x => x != null);
|
|
22
|
-
return idList;
|
|
23
|
-
}
|
|
1
|
+
import { prop, switchTransactionByType, toArray } from '../utils';
|
|
2
|
+
import { NAME_MAP } from '../../constants';
|
|
3
|
+
const getAssetIdList = switchTransactionByType({
|
|
4
|
+
[NAME_MAP.transfer]: tx => [tx.assetId, tx.feeAssetId],
|
|
5
|
+
[NAME_MAP.burn]: tx => [tx.assetId],
|
|
6
|
+
[NAME_MAP.reissue]: tx => [tx.assetId],
|
|
7
|
+
[NAME_MAP.exchange]: tx => Array.from(new Set([
|
|
8
|
+
tx.order1.assetPair.amountAsset,
|
|
9
|
+
tx.order1.assetPair.priceAsset,
|
|
10
|
+
tx.order1.version === 3 ? tx.order1.matcherFeeAssetId : null,
|
|
11
|
+
tx.order2.version === 3 ? tx.order2.matcherFeeAssetId : null
|
|
12
|
+
])),
|
|
13
|
+
[NAME_MAP.massTransfer]: tx => [tx.assetId],
|
|
14
|
+
[NAME_MAP.setAssetScript]: tx => [tx.assetId],
|
|
15
|
+
[NAME_MAP.sponsorship]: tx => [tx.assetId],
|
|
16
|
+
[NAME_MAP.invoke]: tx => [...(tx.payment || []).map(prop('assetId')), tx.feeAssetId],
|
|
17
|
+
[NAME_MAP.updateAsset]: tx => [tx.assetId]
|
|
18
|
+
});
|
|
19
|
+
export default function (tx) {
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
const idList = toArray(tx).reduce((acc, tx) => acc.concat(getAssetIdList(tx) || []), []).filter(x => x != null);
|
|
22
|
+
return idList;
|
|
23
|
+
}
|
|
24
24
|
//# sourceMappingURL=getAssetIdListByTx.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TAssetDetails } from '../../api-node/assets';
|
|
2
|
-
import { Transaction, TransactionFromNode } from '@waves/ts-types';
|
|
3
|
-
export default function (base: string, tx: Array<Transaction> | Transaction | TransactionFromNode | TransactionFromNode[]): Promise<Record<string, TAssetDetails>>;
|
|
1
|
+
import { TAssetDetails } from '../../api-node/assets';
|
|
2
|
+
import { Transaction, TransactionFromNode } from '@waves/ts-types';
|
|
3
|
+
export default function (base: string, tx: Array<Transaction> | Transaction | TransactionFromNode | TransactionFromNode[]): Promise<Record<string, TAssetDetails>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fetchDetails } from '../../api-node/assets';
|
|
2
|
-
import getAssetIdListByTx from './getAssetIdListByTx';
|
|
3
|
-
import { indexBy, prop } from '../utils';
|
|
4
|
-
export default function (base, tx) {
|
|
5
|
-
return fetchDetails(base, getAssetIdListByTx(tx))
|
|
6
|
-
.then(list => indexBy(prop('assetId'), list));
|
|
7
|
-
}
|
|
1
|
+
import { fetchDetails } from '../../api-node/assets';
|
|
2
|
+
import getAssetIdListByTx from './getAssetIdListByTx';
|
|
3
|
+
import { indexBy, prop } from '../utils';
|
|
4
|
+
export default function (base, tx) {
|
|
5
|
+
return fetchDetails(base, getAssetIdListByTx(tx))
|
|
6
|
+
.then(list => indexBy(prop('assetId'), list));
|
|
7
|
+
}
|
|
8
8
|
//# sourceMappingURL=getAssetsByTransaction.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TAssetDetails } from '../../api-node/assets';
|
|
2
|
-
import { TransactionFromNode } from '@waves/ts-types';
|
|
3
|
-
export default function (base: string, address: string, limit: number, after?: string): Promise<{
|
|
4
|
-
transactions: Array<TransactionFromNode>;
|
|
5
|
-
assets: Record<string, TAssetDetails>;
|
|
6
|
-
}>;
|
|
1
|
+
import { TAssetDetails } from '../../api-node/assets';
|
|
2
|
+
import { TransactionFromNode } from '@waves/ts-types';
|
|
3
|
+
export default function (base: string, address: string, limit: number, after?: string): Promise<{
|
|
4
|
+
transactions: Array<TransactionFromNode>;
|
|
5
|
+
assets: Record<string, TAssetDetails>;
|
|
6
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { fetchTransactions } from '../../api-node/transactions';
|
|
2
|
-
import getAssetsByTransaction from './getAssetsByTransaction';
|
|
3
|
-
export default function (base, address, limit, after) {
|
|
4
|
-
return fetchTransactions(base, address, limit, after)
|
|
5
|
-
.then(transactions => getAssetsByTransaction(base, transactions).then(assets => ({ transactions, assets })));
|
|
6
|
-
}
|
|
1
|
+
import { fetchTransactions } from '../../api-node/transactions';
|
|
2
|
+
import getAssetsByTransaction from './getAssetsByTransaction';
|
|
3
|
+
export default function (base, address, limit, after) {
|
|
4
|
+
return fetchTransactions(base, address, limit, after)
|
|
5
|
+
.then(transactions => getAssetsByTransaction(base, transactions).then(assets => ({ transactions, assets })));
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=getTransactionsWithAssets.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Transaction, WithApiMixin } from '@waves/ts-types';
|
|
2
|
-
import { TLong } from '../../interface';
|
|
3
|
-
import { EventEmitter } from 'typed-ts-events';
|
|
4
|
-
export declare class Watch {
|
|
5
|
-
readonly address: string;
|
|
6
|
-
private readonly _base;
|
|
7
|
-
private readonly _interval;
|
|
8
|
-
private readonly _emitter;
|
|
9
|
-
private _lastBlock;
|
|
10
|
-
private _timer;
|
|
11
|
-
constructor(base: string, address: string, tx: (Transaction<TLong> & WithApiMixin) | null, interval?: number);
|
|
12
|
-
on<K extends keyof IEvents>(event: K, handler: EventEmitter.IHandler<IEvents[K], any>): void;
|
|
13
|
-
once<K extends keyof IEvents>(event: K, handler: EventEmitter.IHandler<IEvents[K], any>): void;
|
|
14
|
-
off(event?: keyof IEvents, handler?: EventEmitter.IHandler<IEvents[keyof IEvents], any>): void;
|
|
15
|
-
private _run;
|
|
16
|
-
private getTransactionsInHeight;
|
|
17
|
-
private _addTimeout;
|
|
18
|
-
private static _groupByHeight;
|
|
19
|
-
private static _getTransactionsToDispatch;
|
|
20
|
-
}
|
|
21
|
-
export interface IEvents {
|
|
22
|
-
'change-state': Array<Transaction<TLong> & WithApiMixin>;
|
|
23
|
-
}
|
|
24
|
-
export default function (base: string, address: string, interval?: number): Promise<Watch>;
|
|
1
|
+
import { Transaction, WithApiMixin } from '@waves/ts-types';
|
|
2
|
+
import { TLong } from '../../interface';
|
|
3
|
+
import { EventEmitter } from 'typed-ts-events';
|
|
4
|
+
export declare class Watch {
|
|
5
|
+
readonly address: string;
|
|
6
|
+
private readonly _base;
|
|
7
|
+
private readonly _interval;
|
|
8
|
+
private readonly _emitter;
|
|
9
|
+
private _lastBlock;
|
|
10
|
+
private _timer;
|
|
11
|
+
constructor(base: string, address: string, tx: (Transaction<TLong> & WithApiMixin) | null, interval?: number);
|
|
12
|
+
on<K extends keyof IEvents>(event: K, handler: EventEmitter.IHandler<IEvents[K], any>): void;
|
|
13
|
+
once<K extends keyof IEvents>(event: K, handler: EventEmitter.IHandler<IEvents[K], any>): void;
|
|
14
|
+
off(event?: keyof IEvents, handler?: EventEmitter.IHandler<IEvents[keyof IEvents], any>): void;
|
|
15
|
+
private _run;
|
|
16
|
+
private getTransactionsInHeight;
|
|
17
|
+
private _addTimeout;
|
|
18
|
+
private static _groupByHeight;
|
|
19
|
+
private static _getTransactionsToDispatch;
|
|
20
|
+
}
|
|
21
|
+
export interface IEvents {
|
|
22
|
+
'change-state': Array<Transaction<TLong> & WithApiMixin>;
|
|
23
|
+
}
|
|
24
|
+
export default function (base: string, address: string, interval?: number): Promise<Watch>;
|