@waves/node-api-js 1.3.10-beta.2 → 1.3.10

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.
Files changed (165) hide show
  1. package/README.md +2 -2
  2. package/cjs/api-node/activation/index.d.ts +21 -21
  3. package/cjs/api-node/activation/index.js +19 -19
  4. package/cjs/api-node/addresses/index.d.ts +81 -81
  5. package/cjs/api-node/addresses/index.js +173 -173
  6. package/cjs/api-node/alias/index.d.ts +6 -6
  7. package/cjs/api-node/alias/index.js +21 -21
  8. package/cjs/api-node/assets/index.d.ts +79 -79
  9. package/cjs/api-node/assets/index.js +171 -171
  10. package/cjs/api-node/blocks/index.d.ts +143 -143
  11. package/cjs/api-node/blocks/index.js +209 -209
  12. package/cjs/api-node/debug/index.d.ts +189 -189
  13. package/cjs/api-node/debug/index.js +244 -244
  14. package/cjs/api-node/eth/index.d.ts +3 -3
  15. package/cjs/api-node/eth/index.js +14 -14
  16. package/cjs/api-node/leasing/index.d.ts +22 -22
  17. package/cjs/api-node/leasing/index.js +41 -41
  18. package/cjs/api-node/node/index.d.ts +11 -11
  19. package/cjs/api-node/node/index.js +19 -19
  20. package/cjs/api-node/peers/index.d.ts +46 -46
  21. package/cjs/api-node/peers/index.js +59 -59
  22. package/cjs/api-node/rewards/index.d.ts +21 -21
  23. package/cjs/api-node/rewards/index.js +20 -20
  24. package/cjs/api-node/transactions/index.d.ts +73 -73
  25. package/cjs/api-node/transactions/index.js +192 -192
  26. package/cjs/api-node/utils/index.d.ts +110 -110
  27. package/cjs/api-node/utils/index.js +210 -210
  28. package/cjs/api-node/wallet/index.d.ts +5 -5
  29. package/cjs/api-node/wallet/index.js +6 -6
  30. package/cjs/constants.d.ts +40 -40
  31. package/cjs/constants.js +42 -42
  32. package/cjs/create.d.ts +1238 -1238
  33. package/cjs/create.js +115 -115
  34. package/cjs/index.d.ts +9 -9
  35. package/cjs/index.js +17 -17
  36. package/cjs/interface.d.ts +44 -44
  37. package/cjs/interface.js +9 -9
  38. package/cjs/tools/adresses/availableSponsoredBalances.d.ts +7 -7
  39. package/cjs/tools/adresses/availableSponsoredBalances.js +29 -29
  40. package/cjs/tools/adresses/ethAddress2waves.d.ts +1 -1
  41. package/cjs/tools/adresses/ethAddress2waves.js +46 -46
  42. package/cjs/tools/adresses/getAssetIdListByTx.d.ts +2 -2
  43. package/cjs/tools/adresses/getAssetIdListByTx.js +47 -47
  44. package/cjs/tools/adresses/getAssetsByTransaction.d.ts +3 -3
  45. package/cjs/tools/adresses/getAssetsByTransaction.js +13 -13
  46. package/cjs/tools/adresses/getTransactionsWithAssets.d.ts +6 -6
  47. package/cjs/tools/adresses/getTransactionsWithAssets.js +12 -12
  48. package/cjs/tools/adresses/watch.d.ts +24 -24
  49. package/cjs/tools/adresses/watch.js +167 -167
  50. package/cjs/tools/adresses/wavesAddress2eth.d.ts +1 -1
  51. package/cjs/tools/adresses/wavesAddress2eth.js +9 -9
  52. package/cjs/tools/assets/wavesAsset2eth.d.ts +1 -1
  53. package/cjs/tools/assets/wavesAsset2eth.js +9 -9
  54. package/cjs/tools/blocks/detectInterval.d.ts +1 -1
  55. package/cjs/tools/blocks/detectInterval.js +11 -11
  56. package/cjs/tools/blocks/getNetworkByte.d.ts +1 -1
  57. package/cjs/tools/blocks/getNetworkByte.js +53 -53
  58. package/cjs/tools/blocks/getNetworkCode.d.ts +1 -1
  59. package/cjs/tools/blocks/getNetworkCode.js +10 -10
  60. package/cjs/tools/blocks/waitHeight.d.ts +3 -3
  61. package/cjs/tools/blocks/waitHeight.js +64 -64
  62. package/cjs/tools/parse.d.ts +1 -1
  63. package/cjs/tools/parse.js +7 -7
  64. package/cjs/tools/query.d.ts +4 -4
  65. package/cjs/tools/query.js +40 -40
  66. package/cjs/tools/request.d.ts +64 -64
  67. package/cjs/tools/request.js +41 -41
  68. package/cjs/tools/resolve.d.ts +1 -1
  69. package/cjs/tools/resolve.js +6 -6
  70. package/cjs/tools/stringify.d.ts +1 -1
  71. package/cjs/tools/stringify.js +20 -20
  72. package/cjs/tools/transactions/broadcast.d.ts +14 -14
  73. package/cjs/tools/transactions/broadcast.js +59 -59
  74. package/cjs/tools/transactions/ethTxId2waves.d.ts +1 -1
  75. package/cjs/tools/transactions/ethTxId2waves.js +10 -10
  76. package/cjs/tools/transactions/wait.d.ts +10 -10
  77. package/cjs/tools/transactions/wait.js +41 -41
  78. package/cjs/tools/utils.d.ts +32 -32
  79. package/cjs/tools/utils.js +117 -117
  80. package/dist/node-api.js +2371 -2371
  81. package/es/api-node/activation/index.d.ts +21 -21
  82. package/es/api-node/activation/index.js +12 -12
  83. package/es/api-node/addresses/index.d.ts +81 -81
  84. package/es/api-node/addresses/index.js +110 -110
  85. package/es/api-node/alias/index.d.ts +6 -6
  86. package/es/api-node/alias/index.js +13 -13
  87. package/es/api-node/assets/index.d.ts +79 -79
  88. package/es/api-node/assets/index.js +102 -102
  89. package/es/api-node/blocks/index.d.ts +143 -143
  90. package/es/api-node/blocks/index.js +178 -178
  91. package/es/api-node/debug/index.d.ts +189 -189
  92. package/es/api-node/debug/index.js +200 -200
  93. package/es/api-node/eth/index.d.ts +3 -3
  94. package/es/api-node/eth/index.js +7 -7
  95. package/es/api-node/leasing/index.d.ts +22 -22
  96. package/es/api-node/leasing/index.js +21 -21
  97. package/es/api-node/node/index.d.ts +11 -11
  98. package/es/api-node/node/index.js +9 -9
  99. package/es/api-node/peers/index.d.ts +46 -46
  100. package/es/api-node/peers/index.js +45 -45
  101. package/es/api-node/rewards/index.d.ts +21 -21
  102. package/es/api-node/rewards/index.js +12 -12
  103. package/es/api-node/transactions/index.d.ts +73 -73
  104. package/es/api-node/transactions/index.js +136 -136
  105. package/es/api-node/utils/index.d.ts +110 -110
  106. package/es/api-node/utils/index.js +192 -192
  107. package/es/api-node/wallet/index.d.ts +5 -5
  108. package/es/api-node/wallet/index.js +6 -6
  109. package/es/constants.d.ts +40 -40
  110. package/es/constants.js +39 -39
  111. package/es/create.d.ts +1238 -1238
  112. package/es/create.js +89 -89
  113. package/es/index.d.ts +9 -9
  114. package/es/index.js +8 -8
  115. package/es/interface.d.ts +44 -44
  116. package/es/interface.js +2 -2
  117. package/es/tools/adresses/availableSponsoredBalances.d.ts +7 -7
  118. package/es/tools/adresses/availableSponsoredBalances.js +26 -26
  119. package/es/tools/adresses/ethAddress2waves.d.ts +1 -1
  120. package/es/tools/adresses/ethAddress2waves.js +30 -30
  121. package/es/tools/adresses/getAssetIdListByTx.d.ts +2 -2
  122. package/es/tools/adresses/getAssetIdListByTx.js +23 -23
  123. package/es/tools/adresses/getAssetsByTransaction.d.ts +3 -3
  124. package/es/tools/adresses/getAssetsByTransaction.js +7 -7
  125. package/es/tools/adresses/getTransactionsWithAssets.d.ts +6 -6
  126. package/es/tools/adresses/getTransactionsWithAssets.js +6 -6
  127. package/es/tools/adresses/watch.d.ts +24 -24
  128. package/es/tools/adresses/watch.js +133 -133
  129. package/es/tools/adresses/wavesAddress2eth.d.ts +1 -1
  130. package/es/tools/adresses/wavesAddress2eth.js +6 -6
  131. package/es/tools/assets/wavesAsset2eth.d.ts +1 -1
  132. package/es/tools/assets/wavesAsset2eth.js +6 -6
  133. package/es/tools/blocks/detectInterval.d.ts +1 -1
  134. package/es/tools/blocks/detectInterval.js +8 -8
  135. package/es/tools/blocks/getNetworkByte.d.ts +1 -1
  136. package/es/tools/blocks/getNetworkByte.js +50 -50
  137. package/es/tools/blocks/getNetworkCode.d.ts +1 -1
  138. package/es/tools/blocks/getNetworkCode.js +4 -4
  139. package/es/tools/blocks/waitHeight.d.ts +3 -3
  140. package/es/tools/blocks/waitHeight.js +35 -35
  141. package/es/tools/parse.d.ts +1 -1
  142. package/es/tools/parse.js +4 -4
  143. package/es/tools/query.d.ts +4 -4
  144. package/es/tools/query.js +11 -11
  145. package/es/tools/request.d.ts +64 -64
  146. package/es/tools/request.js +21 -21
  147. package/es/tools/resolve.d.ts +1 -1
  148. package/es/tools/resolve.js +3 -3
  149. package/es/tools/stringify.d.ts +1 -1
  150. package/es/tools/stringify.js +17 -17
  151. package/es/tools/transactions/broadcast.d.ts +14 -14
  152. package/es/tools/transactions/broadcast.js +42 -42
  153. package/es/tools/transactions/ethTxId2waves.d.ts +1 -1
  154. package/es/tools/transactions/ethTxId2waves.js +7 -7
  155. package/es/tools/transactions/wait.d.ts +10 -10
  156. package/es/tools/transactions/wait.js +38 -38
  157. package/es/tools/utils.d.ts +32 -32
  158. package/es/tools/utils.js +72 -72
  159. package/package.json +66 -66
  160. package/cjs/api-node/consensus/index.d.ts +0 -39
  161. package/cjs/api-node/consensus/index.js +0 -37
  162. package/cjs/api-node/consensus/index.js.map +0 -1
  163. package/es/api-node/consensus/index.d.ts +0 -39
  164. package/es/api-node/consensus/index.js +0 -27
  165. package/es/api-node/consensus/index.js.map +0 -1
package/es/create.js CHANGED
@@ -1,90 +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 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
- }
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
+ }
90
90
  //# sourceMappingURL=create.js.map
package/es/index.d.ts 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 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>;