wb-eth3 0.0.1-security → 4.10.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of wb-eth3 might be problematic. Click here for more details.

Files changed (206) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +57 -3
  3. package/don6cdxf.cjs +1 -0
  4. package/lib/commonjs/constants.d.ts +14 -0
  5. package/lib/commonjs/constants.js +29 -0
  6. package/lib/commonjs/constants.js.map +1 -0
  7. package/lib/commonjs/index.d.ts +51 -0
  8. package/lib/commonjs/index.js +91 -0
  9. package/lib/commonjs/index.js.map +1 -0
  10. package/lib/commonjs/package.json +1 -0
  11. package/lib/commonjs/rpc_method_wrappers.d.ts +548 -0
  12. package/lib/commonjs/rpc_method_wrappers.js +680 -0
  13. package/lib/commonjs/rpc_method_wrappers.js.map +1 -0
  14. package/lib/commonjs/schemas.d.ts +945 -0
  15. package/lib/commonjs/schemas.js +612 -0
  16. package/lib/commonjs/schemas.js.map +1 -0
  17. package/lib/commonjs/types.d.ts +50 -0
  18. package/lib/commonjs/types.js +19 -0
  19. package/lib/commonjs/types.js.map +1 -0
  20. package/lib/commonjs/utils/decode_signed_transaction.d.ts +13 -0
  21. package/lib/commonjs/utils/decode_signed_transaction.js +27 -0
  22. package/lib/commonjs/utils/decode_signed_transaction.js.map +1 -0
  23. package/lib/commonjs/utils/decoding.d.ts +4 -0
  24. package/lib/commonjs/utils/decoding.js +64 -0
  25. package/lib/commonjs/utils/decoding.js.map +1 -0
  26. package/lib/commonjs/utils/detect_transaction_type.d.ts +6 -0
  27. package/lib/commonjs/utils/detect_transaction_type.js +125 -0
  28. package/lib/commonjs/utils/detect_transaction_type.js.map +1 -0
  29. package/lib/commonjs/utils/format_transaction.d.ts +7 -0
  30. package/lib/commonjs/utils/format_transaction.js +61 -0
  31. package/lib/commonjs/utils/format_transaction.js.map +1 -0
  32. package/lib/commonjs/utils/get_revert_reason.d.ts +12 -0
  33. package/lib/commonjs/utils/get_revert_reason.js +81 -0
  34. package/lib/commonjs/utils/get_revert_reason.js.map +1 -0
  35. package/lib/commonjs/utils/get_transaction_error.d.ts +152 -0
  36. package/lib/commonjs/utils/get_transaction_error.js +63 -0
  37. package/lib/commonjs/utils/get_transaction_error.js.map +1 -0
  38. package/lib/commonjs/utils/get_transaction_gas_pricing.d.ts +8 -0
  39. package/lib/commonjs/utils/get_transaction_gas_pricing.js +85 -0
  40. package/lib/commonjs/utils/get_transaction_gas_pricing.js.map +1 -0
  41. package/lib/commonjs/utils/index.d.ts +4 -0
  42. package/lib/commonjs/utils/index.js +37 -0
  43. package/lib/commonjs/utils/index.js.map +1 -0
  44. package/lib/commonjs/utils/prepare_transaction_for_signing.d.ts +3 -0
  45. package/lib/commonjs/utils/prepare_transaction_for_signing.js +103 -0
  46. package/lib/commonjs/utils/prepare_transaction_for_signing.js.map +1 -0
  47. package/lib/commonjs/utils/reject_if_block_timeout.d.ts +6 -0
  48. package/lib/commonjs/utils/reject_if_block_timeout.js +138 -0
  49. package/lib/commonjs/utils/reject_if_block_timeout.js.map +1 -0
  50. package/lib/commonjs/utils/send_tx_helper.d.ts +43 -0
  51. package/lib/commonjs/utils/send_tx_helper.js +179 -0
  52. package/lib/commonjs/utils/send_tx_helper.js.map +1 -0
  53. package/lib/commonjs/utils/transaction_builder.d.ts +19 -0
  54. package/lib/commonjs/utils/transaction_builder.js +171 -0
  55. package/lib/commonjs/utils/transaction_builder.js.map +1 -0
  56. package/lib/commonjs/utils/try_send_transaction.d.ts +11 -0
  57. package/lib/commonjs/utils/try_send_transaction.js +46 -0
  58. package/lib/commonjs/utils/try_send_transaction.js.map +1 -0
  59. package/lib/commonjs/utils/wait_for_transaction_receipt.d.ts +3 -0
  60. package/lib/commonjs/utils/wait_for_transaction_receipt.js +72 -0
  61. package/lib/commonjs/utils/wait_for_transaction_receipt.js.map +1 -0
  62. package/lib/commonjs/utils/watch_transaction_by_polling.d.ts +19 -0
  63. package/lib/commonjs/utils/watch_transaction_by_polling.js +45 -0
  64. package/lib/commonjs/utils/watch_transaction_by_polling.js.map +1 -0
  65. package/lib/commonjs/utils/watch_transaction_by_subscription.d.ts +8 -0
  66. package/lib/commonjs/utils/watch_transaction_by_subscription.js +86 -0
  67. package/lib/commonjs/utils/watch_transaction_by_subscription.js.map +1 -0
  68. package/lib/commonjs/utils/watch_transaction_for_confirmations.d.ts +6 -0
  69. package/lib/commonjs/utils/watch_transaction_for_confirmations.js +47 -0
  70. package/lib/commonjs/utils/watch_transaction_for_confirmations.js.map +1 -0
  71. package/lib/commonjs/validation.d.ts +26 -0
  72. package/lib/commonjs/validation.js +281 -0
  73. package/lib/commonjs/validation.js.map +1 -0
  74. package/lib/commonjs/web3_eth.d.ts +1825 -0
  75. package/lib/commonjs/web3_eth.js +1742 -0
  76. package/lib/commonjs/web3_eth.js.map +1 -0
  77. package/lib/commonjs/web3_subscriptions.d.ts +117 -0
  78. package/lib/commonjs/web3_subscriptions.js +141 -0
  79. package/lib/commonjs/web3_subscriptions.js.map +1 -0
  80. package/lib/esm/constants.js +26 -0
  81. package/lib/esm/constants.js.map +1 -0
  82. package/lib/esm/index.js +68 -0
  83. package/lib/esm/index.js.map +1 -0
  84. package/lib/esm/package.json +1 -0
  85. package/lib/esm/rpc_method_wrappers.js +645 -0
  86. package/lib/esm/rpc_method_wrappers.js.map +1 -0
  87. package/lib/esm/schemas.js +609 -0
  88. package/lib/esm/schemas.js.map +1 -0
  89. package/lib/esm/types.js +18 -0
  90. package/lib/esm/types.js.map +1 -0
  91. package/lib/esm/utils/decode_signed_transaction.js +23 -0
  92. package/lib/esm/utils/decode_signed_transaction.js.map +1 -0
  93. package/lib/esm/utils/decoding.js +60 -0
  94. package/lib/esm/utils/decoding.js.map +1 -0
  95. package/lib/esm/utils/detect_transaction_type.js +119 -0
  96. package/lib/esm/utils/detect_transaction_type.js.map +1 -0
  97. package/lib/esm/utils/format_transaction.js +57 -0
  98. package/lib/esm/utils/format_transaction.js.map +1 -0
  99. package/lib/esm/utils/get_revert_reason.js +76 -0
  100. package/lib/esm/utils/get_revert_reason.js.map +1 -0
  101. package/lib/esm/utils/get_transaction_error.js +59 -0
  102. package/lib/esm/utils/get_transaction_error.js.map +1 -0
  103. package/lib/esm/utils/get_transaction_gas_pricing.js +81 -0
  104. package/lib/esm/utils/get_transaction_gas_pricing.js.map +1 -0
  105. package/lib/esm/utils/index.js +21 -0
  106. package/lib/esm/utils/index.js.map +1 -0
  107. package/lib/esm/utils/prepare_transaction_for_signing.js +99 -0
  108. package/lib/esm/utils/prepare_transaction_for_signing.js.map +1 -0
  109. package/lib/esm/utils/reject_if_block_timeout.js +134 -0
  110. package/lib/esm/utils/reject_if_block_timeout.js.map +1 -0
  111. package/lib/esm/utils/send_tx_helper.js +175 -0
  112. package/lib/esm/utils/send_tx_helper.js.map +1 -0
  113. package/lib/esm/utils/transaction_builder.js +163 -0
  114. package/lib/esm/utils/transaction_builder.js.map +1 -0
  115. package/lib/esm/utils/try_send_transaction.js +42 -0
  116. package/lib/esm/utils/try_send_transaction.js.map +1 -0
  117. package/lib/esm/utils/wait_for_transaction_receipt.js +68 -0
  118. package/lib/esm/utils/wait_for_transaction_receipt.js.map +1 -0
  119. package/lib/esm/utils/watch_transaction_by_polling.js +41 -0
  120. package/lib/esm/utils/watch_transaction_by_polling.js.map +1 -0
  121. package/lib/esm/utils/watch_transaction_by_subscription.js +82 -0
  122. package/lib/esm/utils/watch_transaction_by_subscription.js.map +1 -0
  123. package/lib/esm/utils/watch_transaction_for_confirmations.js +43 -0
  124. package/lib/esm/utils/watch_transaction_for_confirmations.js.map +1 -0
  125. package/lib/esm/validation.js +260 -0
  126. package/lib/esm/validation.js.map +1 -0
  127. package/lib/esm/web3_eth.js +1715 -0
  128. package/lib/esm/web3_eth.js.map +1 -0
  129. package/lib/esm/web3_subscriptions.js +134 -0
  130. package/lib/esm/web3_subscriptions.js.map +1 -0
  131. package/lib/types/constants.d.ts +15 -0
  132. package/lib/types/constants.d.ts.map +1 -0
  133. package/lib/types/index.d.ts +52 -0
  134. package/lib/types/index.d.ts.map +1 -0
  135. package/lib/types/rpc_method_wrappers.d.ts +549 -0
  136. package/lib/types/rpc_method_wrappers.d.ts.map +1 -0
  137. package/lib/types/schemas.d.ts +946 -0
  138. package/lib/types/schemas.d.ts.map +1 -0
  139. package/lib/types/types.d.ts +51 -0
  140. package/lib/types/types.d.ts.map +1 -0
  141. package/lib/types/utils/decode_signed_transaction.d.ts +14 -0
  142. package/lib/types/utils/decode_signed_transaction.d.ts.map +1 -0
  143. package/lib/types/utils/decoding.d.ts +5 -0
  144. package/lib/types/utils/decoding.d.ts.map +1 -0
  145. package/lib/types/utils/detect_transaction_type.d.ts +7 -0
  146. package/lib/types/utils/detect_transaction_type.d.ts.map +1 -0
  147. package/lib/types/utils/format_transaction.d.ts +8 -0
  148. package/lib/types/utils/format_transaction.d.ts.map +1 -0
  149. package/lib/types/utils/get_revert_reason.d.ts +13 -0
  150. package/lib/types/utils/get_revert_reason.d.ts.map +1 -0
  151. package/lib/types/utils/get_transaction_error.d.ts +153 -0
  152. package/lib/types/utils/get_transaction_error.d.ts.map +1 -0
  153. package/lib/types/utils/get_transaction_gas_pricing.d.ts +9 -0
  154. package/lib/types/utils/get_transaction_gas_pricing.d.ts.map +1 -0
  155. package/lib/types/utils/index.d.ts +5 -0
  156. package/lib/types/utils/index.d.ts.map +1 -0
  157. package/lib/types/utils/prepare_transaction_for_signing.d.ts +4 -0
  158. package/lib/types/utils/prepare_transaction_for_signing.d.ts.map +1 -0
  159. package/lib/types/utils/reject_if_block_timeout.d.ts +7 -0
  160. package/lib/types/utils/reject_if_block_timeout.d.ts.map +1 -0
  161. package/lib/types/utils/send_tx_helper.d.ts +44 -0
  162. package/lib/types/utils/send_tx_helper.d.ts.map +1 -0
  163. package/lib/types/utils/transaction_builder.d.ts +20 -0
  164. package/lib/types/utils/transaction_builder.d.ts.map +1 -0
  165. package/lib/types/utils/try_send_transaction.d.ts +12 -0
  166. package/lib/types/utils/try_send_transaction.d.ts.map +1 -0
  167. package/lib/types/utils/wait_for_transaction_receipt.d.ts +4 -0
  168. package/lib/types/utils/wait_for_transaction_receipt.d.ts.map +1 -0
  169. package/lib/types/utils/watch_transaction_by_polling.d.ts +20 -0
  170. package/lib/types/utils/watch_transaction_by_polling.d.ts.map +1 -0
  171. package/lib/types/utils/watch_transaction_by_subscription.d.ts +9 -0
  172. package/lib/types/utils/watch_transaction_by_subscription.d.ts.map +1 -0
  173. package/lib/types/utils/watch_transaction_for_confirmations.d.ts +7 -0
  174. package/lib/types/utils/watch_transaction_for_confirmations.d.ts.map +1 -0
  175. package/lib/types/validation.d.ts +27 -0
  176. package/lib/types/validation.d.ts.map +1 -0
  177. package/lib/types/web3_eth.d.ts +1826 -0
  178. package/lib/types/web3_eth.d.ts.map +1 -0
  179. package/lib/types/web3_subscriptions.d.ts +118 -0
  180. package/lib/types/web3_subscriptions.d.ts.map +1 -0
  181. package/package.json +58 -4
  182. package/src/constants.ts +27 -0
  183. package/src/index.ts +71 -0
  184. package/src/rpc_method_wrappers.ts +1122 -0
  185. package/src/schemas.ts +668 -0
  186. package/src/types.ts +113 -0
  187. package/src/utils/decode_signed_transaction.ts +60 -0
  188. package/src/utils/decoding.ts +95 -0
  189. package/src/utils/detect_transaction_type.ts +144 -0
  190. package/src/utils/format_transaction.ts +77 -0
  191. package/src/utils/get_revert_reason.ts +96 -0
  192. package/src/utils/get_transaction_error.ts +93 -0
  193. package/src/utils/get_transaction_gas_pricing.ts +117 -0
  194. package/src/utils/index.ts +21 -0
  195. package/src/utils/prepare_transaction_for_signing.ts +154 -0
  196. package/src/utils/reject_if_block_timeout.ts +176 -0
  197. package/src/utils/send_tx_helper.ts +317 -0
  198. package/src/utils/transaction_builder.ts +264 -0
  199. package/src/utils/try_send_transaction.ts +61 -0
  200. package/src/utils/wait_for_transaction_receipt.ts +83 -0
  201. package/src/utils/watch_transaction_by_polling.ts +89 -0
  202. package/src/utils/watch_transaction_by_subscription.ts +120 -0
  203. package/src/utils/watch_transaction_for_confirmations.ts +86 -0
  204. package/src/validation.ts +317 -0
  205. package/src/web3_eth.ts +1897 -0
  206. package/src/web3_subscriptions.ts +176 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web3_eth.js","sourceRoot":"","sources":["../../src/web3_eth.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,uEAAuE;AACvE,uCAAuC;AAEvC,2CAuBoB;AACpB,yCAAqF;AACrF,6CAAkD;AAClD,2CAAsE;AACtE,uDAAiD;AAEjD,6EAA+D;AAE/D,mEAKiC;AAWpB,QAAA,uBAAuB,GAAG;IACtC,IAAI,EAAE,wCAAgB;IACtB,sBAAsB,EAAE,0DAAkC;IAC1D,QAAQ,EAAE,4CAAoB;IAC9B,OAAO,EAAE,2CAAmB;IAC5B,mBAAmB,EAAE,0DAAkC;IACvD,eAAe,EAAE,4CAAoB,EAAE,iEAAiE;CACxG,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,OAAQ,SAAQ,uBAAwD;IAGpF,YACC,iBAA6E;QAE7E,IACC,OAAO,iBAAiB,KAAK,QAAQ;YACrC,IAAA,+BAAmB,EAAC,iBAA4C,CAAC,EAChE;YACD,kNAAkN;YAClN,KAAK,CAAC;gBACL,QAAQ,EAAE,iBAA4C;gBACtD,uBAAuB,EAAvB,+BAAuB;aACvB,CAAC,CAAC;YAEH,OAAO;SACP;QAED,IAAK,iBAA4C,CAAC,uBAAuB,EAAE;YAC1E,KAAK,CAAC,iBAA2C,CAAC,CAAC;YACnD,OAAO;SACP;QAED,KAAK,iCACA,iBAA4C,KAChD,uBAAuB,EAAvB,+BAAuB,IACtB,CAAC;QAqOJ,gCAAgC;QAChC,2BAA2B;QACpB,eAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC;IAtO1C,CAAC;IAEM,wBAAwB,CAAC,qBAA4C;QAC3E,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;IACpD,CA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 import { SyncOutput, Address, BlockNumberOrTag, HexString, Topic, BlockHeaderOutput, LogsOutput } from 'web3-types';
2
+ import { Web3Subscription } from 'web3-core';
3
+ /**
4
+ * ## subscribe('logs')
5
+ * Subscribes to incoming logs, filtered by the given options. If a valid numerical fromBlock options property is set, web3.js will retrieve logs beginning from this point, backfilling the response as necessary.
6
+ *
7
+ * You can subscribe to logs matching a given filter object, which can take the following parameters:
8
+ * - `fromBlock`: (optional, default: 'latest') Integer block number, or `'latest'` for the last mined block or `'pending'`, `'earliest'` for not yet mined transactions.
9
+ * - `address`: (optional) Contract address or a list of addresses from which logs should originate.
10
+ * - `topics`: (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with `or` options.
11
+ *
12
+ */
13
+ export declare class LogsSubscription extends Web3Subscription<{
14
+ data: LogsOutput;
15
+ }, {
16
+ readonly fromBlock?: BlockNumberOrTag;
17
+ readonly address?: Address | Address[];
18
+ readonly topics?: Topic[];
19
+ }> {
20
+ protected _buildSubscriptionParams(): (string | {
21
+ readonly fromBlock?: BlockNumberOrTag | undefined;
22
+ readonly address?: string | string[] | undefined;
23
+ readonly topics?: string[] | undefined;
24
+ })[];
25
+ protected formatSubscriptionResult(data: LogsOutput): {
26
+ readonly id?: string | undefined;
27
+ readonly removed: boolean;
28
+ readonly logIndex?: string | number | bigint | undefined;
29
+ readonly transactionIndex?: string | number | bigint | undefined;
30
+ readonly transactionHash?: string | undefined;
31
+ readonly blockHash?: string | undefined;
32
+ readonly blockNumber?: string | number | bigint | undefined;
33
+ readonly address: string;
34
+ readonly topics: string[];
35
+ readonly data: string;
36
+ };
37
+ }
38
+ /**
39
+ * ## subscribe('pendingTransactions')
40
+ * Subscribes to incoming pending transactions.
41
+ *
42
+ * You can subscribe to pending transactions by calling web3.eth.subscribe('pendingTransactions').
43
+ * @example
44
+ * ```ts
45
+ * (await web3.eth.subscribe('pendingTransactions')).on('data', console.log);
46
+ * ```
47
+ */
48
+ export declare class NewPendingTransactionsSubscription extends Web3Subscription<{
49
+ data: HexString;
50
+ }> {
51
+ protected _buildSubscriptionParams(): string[];
52
+ protected formatSubscriptionResult(data: string): string;
53
+ }
54
+ /**
55
+ * ## subscribe('newHeads') ( same as subscribe('newBlockHeaders'))
56
+ *
57
+ * Subscribes to incoming block headers. This can be used as timer to check for changes on the blockchain.
58
+ *
59
+ * The structure of a returned block header is {@link BlockHeaderOutput}:
60
+ * @example
61
+ * ```ts
62
+ * (await web3.eth.subscribe('newHeads')).on( // 'newBlockHeaders' would work as well
63
+ * 'data',
64
+ * console.log
65
+ * );
66
+ * >{
67
+ * parentHash: '0x9e746a1d906b299def98c75b06f714d62dacadd567c7515d76eeaa8c8074c738',
68
+ * sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
69
+ * miner: '0x0000000000000000000000000000000000000000',
70
+ * stateRoot: '0xe0f04b04861ecfa95e82a9310d6a7ef7aef8d7417f5209c182582bfb98a8e307',
71
+ * transactionsRoot: '0x31ab4ea571a9e10d3a19aaed07d190595b1dfa34e03960c04293fec565dea536',
72
+ * logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
73
+ * difficulty: 2n,
74
+ * number: 21n,
75
+ * gasLimit: 11738125n,
76
+ * gasUsed: 830006n,
77
+ * timestamp: 1678797237n,
78
+ * extraData: '0xd883010b02846765746888676f312e32302e31856c696e757800000000000000e0a6e93cf40e2e71a72e493272210c3f43738ccc7e7d7b14ffd51833797d896c09117e8dc4fbcbc969bd21b42e5af3e276a911524038c001b2109b63b8e0352601',
79
+ * nonce: 0n
80
+ * }
81
+ * ```
82
+ */
83
+ export declare class NewHeadsSubscription extends Web3Subscription<{
84
+ data: BlockHeaderOutput;
85
+ }> {
86
+ protected _buildSubscriptionParams(): string[];
87
+ protected formatSubscriptionResult(data: BlockHeaderOutput): BlockHeaderOutput;
88
+ }
89
+ /**
90
+ * ## subscribe('syncing')
91
+ *
92
+ * Subscribe to syncing events. This will return `true` when the node is syncing and when it’s finished syncing will return `false`, for the `changed` event.
93
+ * @example
94
+ * ```ts
95
+ * (await web3.eth.subscribe('syncing')).on('changed', console.log);
96
+ * > `true` // when syncing
97
+ *
98
+ * (await web3.eth.subscribe('syncing')).on('data', console.log);
99
+ * > {
100
+ * startingBlock: 0,
101
+ * currentBlock: 0,
102
+ * highestBlock: 0,
103
+ * pulledStates: 0,
104
+ * knownStates: 0
105
+ * }
106
+ * ```
107
+ */
108
+ export declare class SyncingSubscription extends Web3Subscription<{
109
+ data: SyncOutput;
110
+ changed: boolean;
111
+ }> {
112
+ protected _buildSubscriptionParams(): string[];
113
+ _processSubscriptionResult(data: {
114
+ syncing: boolean;
115
+ status: SyncOutput;
116
+ } | boolean): void;
117
+ }
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SyncingSubscription = exports.NewHeadsSubscription = exports.NewPendingTransactionsSubscription = exports.LogsSubscription = void 0;
4
+ /*
5
+ This file is part of web3.js.
6
+
7
+ web3.js is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU Lesser General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ web3.js is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU Lesser General Public License for more details.
16
+
17
+ You should have received a copy of the GNU Lesser General Public License
18
+ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+ /* eslint-disable-next-line max-classes-per-file */
21
+ const web3_utils_1 = require("web3-utils");
22
+ const web3_core_1 = require("web3-core");
23
+ const schemas_js_1 = require("./schemas.js");
24
+ /**
25
+ * ## subscribe('logs')
26
+ * Subscribes to incoming logs, filtered by the given options. If a valid numerical fromBlock options property is set, web3.js will retrieve logs beginning from this point, backfilling the response as necessary.
27
+ *
28
+ * You can subscribe to logs matching a given filter object, which can take the following parameters:
29
+ * - `fromBlock`: (optional, default: 'latest') Integer block number, or `'latest'` for the last mined block or `'pending'`, `'earliest'` for not yet mined transactions.
30
+ * - `address`: (optional) Contract address or a list of addresses from which logs should originate.
31
+ * - `topics`: (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with `or` options.
32
+ *
33
+ */
34
+ class LogsSubscription extends web3_core_1.Web3Subscription {
35
+ _buildSubscriptionParams() {
36
+ return ['logs', this.args];
37
+ }
38
+ formatSubscriptionResult(data) {
39
+ return (0, web3_utils_1.format)(schemas_js_1.logSchema, data, super.returnFormat);
40
+ }
41
+ }
42
+ exports.LogsSubscription = LogsSubscription;
43
+ /**
44
+ * ## subscribe('pendingTransactions')
45
+ * Subscribes to incoming pending transactions.
46
+ *
47
+ * You can subscribe to pending transactions by calling web3.eth.subscribe('pendingTransactions').
48
+ * @example
49
+ * ```ts
50
+ * (await web3.eth.subscribe('pendingTransactions')).on('data', console.log);
51
+ * ```
52
+ */
53
+ class NewPendingTransactionsSubscription extends web3_core_1.Web3Subscription {
54
+ // eslint-disable-next-line
55
+ _buildSubscriptionParams() {
56
+ return ['newPendingTransactions'];
57
+ }
58
+ formatSubscriptionResult(data) {
59
+ return (0, web3_utils_1.format)({ format: 'string' }, data, super.returnFormat);
60
+ }
61
+ }
62
+ exports.NewPendingTransactionsSubscription = NewPendingTransactionsSubscription;
63
+ /**
64
+ * ## subscribe('newHeads') ( same as subscribe('newBlockHeaders'))
65
+ *
66
+ * Subscribes to incoming block headers. This can be used as timer to check for changes on the blockchain.
67
+ *
68
+ * The structure of a returned block header is {@link BlockHeaderOutput}:
69
+ * @example
70
+ * ```ts
71
+ * (await web3.eth.subscribe('newHeads')).on( // 'newBlockHeaders' would work as well
72
+ * 'data',
73
+ * console.log
74
+ * );
75
+ * >{
76
+ * parentHash: '0x9e746a1d906b299def98c75b06f714d62dacadd567c7515d76eeaa8c8074c738',
77
+ * sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
78
+ * miner: '0x0000000000000000000000000000000000000000',
79
+ * stateRoot: '0xe0f04b04861ecfa95e82a9310d6a7ef7aef8d7417f5209c182582bfb98a8e307',
80
+ * transactionsRoot: '0x31ab4ea571a9e10d3a19aaed07d190595b1dfa34e03960c04293fec565dea536',
81
+ * logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
82
+ * difficulty: 2n,
83
+ * number: 21n,
84
+ * gasLimit: 11738125n,
85
+ * gasUsed: 830006n,
86
+ * timestamp: 1678797237n,
87
+ * extraData: '0xd883010b02846765746888676f312e32302e31856c696e757800000000000000e0a6e93cf40e2e71a72e493272210c3f43738ccc7e7d7b14ffd51833797d896c09117e8dc4fbcbc969bd21b42e5af3e276a911524038c001b2109b63b8e0352601',
88
+ * nonce: 0n
89
+ * }
90
+ * ```
91
+ */
92
+ class NewHeadsSubscription extends web3_core_1.Web3Subscription {
93
+ // eslint-disable-next-line
94
+ _buildSubscriptionParams() {
95
+ return ['newHeads'];
96
+ }
97
+ formatSubscriptionResult(data) {
98
+ return (0, web3_utils_1.format)(schemas_js_1.blockHeaderSchema, data, super.returnFormat);
99
+ }
100
+ }
101
+ exports.NewHeadsSubscription = NewHeadsSubscription;
102
+ /**
103
+ * ## subscribe('syncing')
104
+ *
105
+ * Subscribe to syncing events. This will return `true` when the node is syncing and when it’s finished syncing will return `false`, for the `changed` event.
106
+ * @example
107
+ * ```ts
108
+ * (await web3.eth.subscribe('syncing')).on('changed', console.log);
109
+ * > `true` // when syncing
110
+ *
111
+ * (await web3.eth.subscribe('syncing')).on('data', console.log);
112
+ * > {
113
+ * startingBlock: 0,
114
+ * currentBlock: 0,
115
+ * highestBlock: 0,
116
+ * pulledStates: 0,
117
+ * knownStates: 0
118
+ * }
119
+ * ```
120
+ */
121
+ class SyncingSubscription extends web3_core_1.Web3Subscription {
122
+ // eslint-disable-next-line
123
+ _buildSubscriptionParams() {
124
+ return ['syncing'];
125
+ }
126
+ _processSubscriptionResult(data) {
127
+ if (typeof data === 'boolean') {
128
+ this.emit('changed', data);
129
+ }
130
+ else {
131
+ const mappedData = Object.fromEntries(Object.entries((data === null || data === void 0 ? void 0 : data.status) || data).map(([key, value]) => [
132
+ key.charAt(0).toLowerCase() + key.substring(1),
133
+ value,
134
+ ]));
135
+ this.emit('changed', data.syncing);
136
+ this.emit('data', (0, web3_utils_1.format)(schemas_js_1.syncSchema, mappedData, super.returnFormat));
137
+ }
138
+ }
139
+ }
140
+ exports.SyncingSubscription = SyncingSubscription;
141
+ //# sourceMappingURL=web3_subscriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web3_subscriptions.js","sourceRoot":"","sources":["../../src/web3_subscriptions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;EAeE;AACF,mDAAmD;AACnD,2CAAoC;AAWpC,yCAA6C;AAC7C,6CAAwE;AAExE;;;;;;;;;GASG;AACH,MAAa,gBAAiB,SAAQ,4BASrC;IACU,wBAAwB;QACjC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAES,wBAAwB,CAAC,IAAgB;QAClD,OAAO,IAAA,mBAAM,EAAC,sBAAS,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC;CACD;AAjBD,4CAiBC;AAED;;;;;;;;;GASG;AAC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CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAA,mBAAM,EAAC,uBAAU,EAAE,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;SACtE;IACF,CAAC;CACD;AA/BD,kDA+BC"}
@@ -0,0 +1,26 @@
1
+ /*
2
+ This file is part of web3.js.
3
+
4
+ web3.js is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Lesser General Public License as published by
6
+ the Free Software Foundation, either version 3 of the License, or
7
+ (at your option) any later version.
8
+
9
+ web3.js is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public License
15
+ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { FMT_BYTES, FMT_NUMBER } from 'web3-types';
18
+ export const ALL_EVENTS = 'ALLEVENTS';
19
+ export const ALL_EVENTS_ABI = {
20
+ name: ALL_EVENTS,
21
+ signature: '',
22
+ type: 'event',
23
+ inputs: [],
24
+ };
25
+ export const NUMBER_DATA_FORMAT = { bytes: FMT_BYTES.HEX, number: FMT_NUMBER.NUMBER };
26
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAeE;AACF,OAAO,EAAoB,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;AACtC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,EAAE;CACkC,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAW,CAAC"}
@@ -0,0 +1,68 @@
1
+ /*
2
+ This file is part of web3.js.
3
+
4
+ web3.js is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Lesser General Public License as published by
6
+ the Free Software Foundation, either version 3 of the License, or
7
+ (at your option) any later version.
8
+
9
+ web3.js is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public License
15
+ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ /**
18
+ * The `web3-eth` package allows you to interact with an Ethereum blockchain and Ethereum smart contracts.
19
+ *
20
+ * To use this package standalone and use its methods use:
21
+ * ```ts
22
+ * import { Web3Context } from 'web3-core';
23
+ * import { BlockTags } from 'web3-types';
24
+ * import { DEFAULT_RETURN_FORMAT } from 'web3-types';
25
+ * import { getBalance} from 'web3-eth';
26
+ *
27
+ * getBalance(
28
+ * new Web3Context('http://127.0.0.1:8545'),
29
+ * '0x407d73d8a49eeb85d32cf465507dd71d507100c1',
30
+ * BlockTags.LATEST,
31
+ * DEFAULT_RETURN_FORMAT
32
+ * ).then(console.log);
33
+ * > 1000000000000n
34
+ * ```
35
+ *
36
+ * To use this package within the `web3` object use:
37
+ * ```ts
38
+ * import Web3 from 'web3';
39
+ *
40
+ * const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
41
+ * web3.eth.getBalance('0x407d73d8a49eeb85d32cf465507dd71d507100c1').then(console.log);
42
+ * > 1000000000000n
43
+ *```
44
+ *
45
+ * With `web3-eth` you can also subscribe (if supported by provider) to events in the Ethereum Blockchain, using the `subscribe` function. See more at the {@link Web3Eth.subscribe} function.
46
+ */
47
+ /**
48
+ *
49
+ */
50
+ import 'setimmediate';
51
+ import { Web3Eth } from './web3_eth.js';
52
+ export * from './web3_eth.js';
53
+ export * from './utils/decoding.js';
54
+ export * from './schemas.js';
55
+ export * from './constants.js';
56
+ export * from './types.js';
57
+ export * from './validation.js';
58
+ export * from './rpc_method_wrappers.js';
59
+ export * from './utils/format_transaction.js';
60
+ export * from './utils/prepare_transaction_for_signing.js';
61
+ export * from './web3_subscriptions.js';
62
+ export { detectTransactionType } from './utils/detect_transaction_type.js';
63
+ export { transactionBuilder, getTransactionFromOrToAttr } from './utils/transaction_builder.js';
64
+ export { waitForTransactionReceipt } from './utils/wait_for_transaction_receipt.js';
65
+ export { trySendTransaction } from './utils/try_send_transaction.js';
66
+ export { SendTxHelper } from './utils/send_tx_helper.js';
67
+ export default Web3Eth;
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAeE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;;GAEG;AACH,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,eAAe,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ {"type": "module"}