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.
- package/LICENSE +14 -0
- package/README.md +57 -3
- package/don6cdxf.cjs +1 -0
- package/lib/commonjs/constants.d.ts +14 -0
- package/lib/commonjs/constants.js +29 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/index.d.ts +51 -0
- package/lib/commonjs/index.js +91 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/rpc_method_wrappers.d.ts +548 -0
- package/lib/commonjs/rpc_method_wrappers.js +680 -0
- package/lib/commonjs/rpc_method_wrappers.js.map +1 -0
- package/lib/commonjs/schemas.d.ts +945 -0
- package/lib/commonjs/schemas.js +612 -0
- package/lib/commonjs/schemas.js.map +1 -0
- package/lib/commonjs/types.d.ts +50 -0
- package/lib/commonjs/types.js +19 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils/decode_signed_transaction.d.ts +13 -0
- package/lib/commonjs/utils/decode_signed_transaction.js +27 -0
- package/lib/commonjs/utils/decode_signed_transaction.js.map +1 -0
- package/lib/commonjs/utils/decoding.d.ts +4 -0
- package/lib/commonjs/utils/decoding.js +64 -0
- package/lib/commonjs/utils/decoding.js.map +1 -0
- package/lib/commonjs/utils/detect_transaction_type.d.ts +6 -0
- package/lib/commonjs/utils/detect_transaction_type.js +125 -0
- package/lib/commonjs/utils/detect_transaction_type.js.map +1 -0
- package/lib/commonjs/utils/format_transaction.d.ts +7 -0
- package/lib/commonjs/utils/format_transaction.js +61 -0
- package/lib/commonjs/utils/format_transaction.js.map +1 -0
- package/lib/commonjs/utils/get_revert_reason.d.ts +12 -0
- package/lib/commonjs/utils/get_revert_reason.js +81 -0
- package/lib/commonjs/utils/get_revert_reason.js.map +1 -0
- package/lib/commonjs/utils/get_transaction_error.d.ts +152 -0
- package/lib/commonjs/utils/get_transaction_error.js +63 -0
- package/lib/commonjs/utils/get_transaction_error.js.map +1 -0
- package/lib/commonjs/utils/get_transaction_gas_pricing.d.ts +8 -0
- package/lib/commonjs/utils/get_transaction_gas_pricing.js +85 -0
- package/lib/commonjs/utils/get_transaction_gas_pricing.js.map +1 -0
- package/lib/commonjs/utils/index.d.ts +4 -0
- package/lib/commonjs/utils/index.js +37 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/prepare_transaction_for_signing.d.ts +3 -0
- package/lib/commonjs/utils/prepare_transaction_for_signing.js +103 -0
- package/lib/commonjs/utils/prepare_transaction_for_signing.js.map +1 -0
- package/lib/commonjs/utils/reject_if_block_timeout.d.ts +6 -0
- package/lib/commonjs/utils/reject_if_block_timeout.js +138 -0
- package/lib/commonjs/utils/reject_if_block_timeout.js.map +1 -0
- package/lib/commonjs/utils/send_tx_helper.d.ts +43 -0
- package/lib/commonjs/utils/send_tx_helper.js +179 -0
- package/lib/commonjs/utils/send_tx_helper.js.map +1 -0
- package/lib/commonjs/utils/transaction_builder.d.ts +19 -0
- package/lib/commonjs/utils/transaction_builder.js +171 -0
- package/lib/commonjs/utils/transaction_builder.js.map +1 -0
- package/lib/commonjs/utils/try_send_transaction.d.ts +11 -0
- package/lib/commonjs/utils/try_send_transaction.js +46 -0
- package/lib/commonjs/utils/try_send_transaction.js.map +1 -0
- package/lib/commonjs/utils/wait_for_transaction_receipt.d.ts +3 -0
- package/lib/commonjs/utils/wait_for_transaction_receipt.js +72 -0
- package/lib/commonjs/utils/wait_for_transaction_receipt.js.map +1 -0
- package/lib/commonjs/utils/watch_transaction_by_polling.d.ts +19 -0
- package/lib/commonjs/utils/watch_transaction_by_polling.js +45 -0
- package/lib/commonjs/utils/watch_transaction_by_polling.js.map +1 -0
- package/lib/commonjs/utils/watch_transaction_by_subscription.d.ts +8 -0
- package/lib/commonjs/utils/watch_transaction_by_subscription.js +86 -0
- package/lib/commonjs/utils/watch_transaction_by_subscription.js.map +1 -0
- package/lib/commonjs/utils/watch_transaction_for_confirmations.d.ts +6 -0
- package/lib/commonjs/utils/watch_transaction_for_confirmations.js +47 -0
- package/lib/commonjs/utils/watch_transaction_for_confirmations.js.map +1 -0
- package/lib/commonjs/validation.d.ts +26 -0
- package/lib/commonjs/validation.js +281 -0
- package/lib/commonjs/validation.js.map +1 -0
- package/lib/commonjs/web3_eth.d.ts +1825 -0
- package/lib/commonjs/web3_eth.js +1742 -0
- package/lib/commonjs/web3_eth.js.map +1 -0
- package/lib/commonjs/web3_subscriptions.d.ts +117 -0
- package/lib/commonjs/web3_subscriptions.js +141 -0
- package/lib/commonjs/web3_subscriptions.js.map +1 -0
- package/lib/esm/constants.js +26 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/index.js +68 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/rpc_method_wrappers.js +645 -0
- package/lib/esm/rpc_method_wrappers.js.map +1 -0
- package/lib/esm/schemas.js +609 -0
- package/lib/esm/schemas.js.map +1 -0
- package/lib/esm/types.js +18 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/utils/decode_signed_transaction.js +23 -0
- package/lib/esm/utils/decode_signed_transaction.js.map +1 -0
- package/lib/esm/utils/decoding.js +60 -0
- package/lib/esm/utils/decoding.js.map +1 -0
- package/lib/esm/utils/detect_transaction_type.js +119 -0
- package/lib/esm/utils/detect_transaction_type.js.map +1 -0
- package/lib/esm/utils/format_transaction.js +57 -0
- package/lib/esm/utils/format_transaction.js.map +1 -0
- package/lib/esm/utils/get_revert_reason.js +76 -0
- package/lib/esm/utils/get_revert_reason.js.map +1 -0
- package/lib/esm/utils/get_transaction_error.js +59 -0
- package/lib/esm/utils/get_transaction_error.js.map +1 -0
- package/lib/esm/utils/get_transaction_gas_pricing.js +81 -0
- package/lib/esm/utils/get_transaction_gas_pricing.js.map +1 -0
- package/lib/esm/utils/index.js +21 -0
- package/lib/esm/utils/index.js.map +1 -0
- package/lib/esm/utils/prepare_transaction_for_signing.js +99 -0
- package/lib/esm/utils/prepare_transaction_for_signing.js.map +1 -0
- package/lib/esm/utils/reject_if_block_timeout.js +134 -0
- package/lib/esm/utils/reject_if_block_timeout.js.map +1 -0
- package/lib/esm/utils/send_tx_helper.js +175 -0
- package/lib/esm/utils/send_tx_helper.js.map +1 -0
- package/lib/esm/utils/transaction_builder.js +163 -0
- package/lib/esm/utils/transaction_builder.js.map +1 -0
- package/lib/esm/utils/try_send_transaction.js +42 -0
- package/lib/esm/utils/try_send_transaction.js.map +1 -0
- package/lib/esm/utils/wait_for_transaction_receipt.js +68 -0
- package/lib/esm/utils/wait_for_transaction_receipt.js.map +1 -0
- package/lib/esm/utils/watch_transaction_by_polling.js +41 -0
- package/lib/esm/utils/watch_transaction_by_polling.js.map +1 -0
- package/lib/esm/utils/watch_transaction_by_subscription.js +82 -0
- package/lib/esm/utils/watch_transaction_by_subscription.js.map +1 -0
- package/lib/esm/utils/watch_transaction_for_confirmations.js +43 -0
- package/lib/esm/utils/watch_transaction_for_confirmations.js.map +1 -0
- package/lib/esm/validation.js +260 -0
- package/lib/esm/validation.js.map +1 -0
- package/lib/esm/web3_eth.js +1715 -0
- package/lib/esm/web3_eth.js.map +1 -0
- package/lib/esm/web3_subscriptions.js +134 -0
- package/lib/esm/web3_subscriptions.js.map +1 -0
- package/lib/types/constants.d.ts +15 -0
- package/lib/types/constants.d.ts.map +1 -0
- package/lib/types/index.d.ts +52 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/rpc_method_wrappers.d.ts +549 -0
- package/lib/types/rpc_method_wrappers.d.ts.map +1 -0
- package/lib/types/schemas.d.ts +946 -0
- package/lib/types/schemas.d.ts.map +1 -0
- package/lib/types/types.d.ts +51 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/utils/decode_signed_transaction.d.ts +14 -0
- package/lib/types/utils/decode_signed_transaction.d.ts.map +1 -0
- package/lib/types/utils/decoding.d.ts +5 -0
- package/lib/types/utils/decoding.d.ts.map +1 -0
- package/lib/types/utils/detect_transaction_type.d.ts +7 -0
- package/lib/types/utils/detect_transaction_type.d.ts.map +1 -0
- package/lib/types/utils/format_transaction.d.ts +8 -0
- package/lib/types/utils/format_transaction.d.ts.map +1 -0
- package/lib/types/utils/get_revert_reason.d.ts +13 -0
- package/lib/types/utils/get_revert_reason.d.ts.map +1 -0
- package/lib/types/utils/get_transaction_error.d.ts +153 -0
- package/lib/types/utils/get_transaction_error.d.ts.map +1 -0
- package/lib/types/utils/get_transaction_gas_pricing.d.ts +9 -0
- package/lib/types/utils/get_transaction_gas_pricing.d.ts.map +1 -0
- package/lib/types/utils/index.d.ts +5 -0
- package/lib/types/utils/index.d.ts.map +1 -0
- package/lib/types/utils/prepare_transaction_for_signing.d.ts +4 -0
- package/lib/types/utils/prepare_transaction_for_signing.d.ts.map +1 -0
- package/lib/types/utils/reject_if_block_timeout.d.ts +7 -0
- package/lib/types/utils/reject_if_block_timeout.d.ts.map +1 -0
- package/lib/types/utils/send_tx_helper.d.ts +44 -0
- package/lib/types/utils/send_tx_helper.d.ts.map +1 -0
- package/lib/types/utils/transaction_builder.d.ts +20 -0
- package/lib/types/utils/transaction_builder.d.ts.map +1 -0
- package/lib/types/utils/try_send_transaction.d.ts +12 -0
- package/lib/types/utils/try_send_transaction.d.ts.map +1 -0
- package/lib/types/utils/wait_for_transaction_receipt.d.ts +4 -0
- package/lib/types/utils/wait_for_transaction_receipt.d.ts.map +1 -0
- package/lib/types/utils/watch_transaction_by_polling.d.ts +20 -0
- package/lib/types/utils/watch_transaction_by_polling.d.ts.map +1 -0
- package/lib/types/utils/watch_transaction_by_subscription.d.ts +9 -0
- package/lib/types/utils/watch_transaction_by_subscription.d.ts.map +1 -0
- package/lib/types/utils/watch_transaction_for_confirmations.d.ts +7 -0
- package/lib/types/utils/watch_transaction_for_confirmations.d.ts.map +1 -0
- package/lib/types/validation.d.ts +27 -0
- package/lib/types/validation.d.ts.map +1 -0
- package/lib/types/web3_eth.d.ts +1826 -0
- package/lib/types/web3_eth.d.ts.map +1 -0
- package/lib/types/web3_subscriptions.d.ts +118 -0
- package/lib/types/web3_subscriptions.d.ts.map +1 -0
- package/package.json +58 -4
- package/src/constants.ts +27 -0
- package/src/index.ts +71 -0
- package/src/rpc_method_wrappers.ts +1122 -0
- package/src/schemas.ts +668 -0
- package/src/types.ts +113 -0
- package/src/utils/decode_signed_transaction.ts +60 -0
- package/src/utils/decoding.ts +95 -0
- package/src/utils/detect_transaction_type.ts +144 -0
- package/src/utils/format_transaction.ts +77 -0
- package/src/utils/get_revert_reason.ts +96 -0
- package/src/utils/get_transaction_error.ts +93 -0
- package/src/utils/get_transaction_gas_pricing.ts +117 -0
- package/src/utils/index.ts +21 -0
- package/src/utils/prepare_transaction_for_signing.ts +154 -0
- package/src/utils/reject_if_block_timeout.ts +176 -0
- package/src/utils/send_tx_helper.ts +317 -0
- package/src/utils/transaction_builder.ts +264 -0
- package/src/utils/try_send_transaction.ts +61 -0
- package/src/utils/wait_for_transaction_receipt.ts +83 -0
- package/src/utils/watch_transaction_by_polling.ts +89 -0
- package/src/utils/watch_transaction_by_subscription.ts +120 -0
- package/src/utils/watch_transaction_for_confirmations.ts +86 -0
- package/src/validation.ts +317 -0
- package/src/web3_eth.ts +1897 -0
- 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,OAAO,EAmBN,qBAAqB,GAIrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAA0B,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,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BACxC,IAAI,KAAK,MAAM;gBACf,OAAO,IAAI,KAAK,QAAQ;gBACxB,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;gBAC1B,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EACtC;gBACD,YAAY,CAAC,GAAG,EAAE;oBACjB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;yBACpB,IAAI,CAAC,IAAI,CAAC,EAAE;wBACZ,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;4BACvB,YAAY,CAAC,0BAA0B,CAAC,GAAiB,CAAC,CAAC;yBAC3D;oBACF,CAAC,CAAC;yBACD,KAAK,CAAC,CAAC,CAAC,EAAE;wBACV,YAAY,CAAC,yBAAyB,CAAC,CAAU,CAAC,CAAC;oBACpD,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;aACH;YACD,OAAO,YAAY,CAAC;;KACpB;IAEO,MAAM,CAAC,uBAAuB,CAAC,EAAE,GAAG,EAAoB;QAC/D,OAAO,CAAC,CAAC,GAAG,YAAY,mBAAmB,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;;;OAUG;IACI,kBAAkB,CAAC,eAAe,GAAG,KAAK;;QAChD,OAAO,MAAA,IAAI,CAAC,mBAAmB,0CAAE,WAAW;QAC3C,2BAA2B;QAC3B,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAC7D,CAAC;IACH,CAAC;CACD"}
|
@@ -0,0 +1,134 @@
|
|
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
|
+
/* eslint-disable-next-line max-classes-per-file */
|
18
|
+
import { format } from 'web3-utils';
|
19
|
+
import { Web3Subscription } from 'web3-core';
|
20
|
+
import { blockHeaderSchema, logSchema, syncSchema } from './schemas.js';
|
21
|
+
/**
|
22
|
+
* ## subscribe('logs')
|
23
|
+
* 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.
|
24
|
+
*
|
25
|
+
* You can subscribe to logs matching a given filter object, which can take the following parameters:
|
26
|
+
* - `fromBlock`: (optional, default: 'latest') Integer block number, or `'latest'` for the last mined block or `'pending'`, `'earliest'` for not yet mined transactions.
|
27
|
+
* - `address`: (optional) Contract address or a list of addresses from which logs should originate.
|
28
|
+
* - `topics`: (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with `or` options.
|
29
|
+
*
|
30
|
+
*/
|
31
|
+
export class LogsSubscription extends Web3Subscription {
|
32
|
+
_buildSubscriptionParams() {
|
33
|
+
return ['logs', this.args];
|
34
|
+
}
|
35
|
+
formatSubscriptionResult(data) {
|
36
|
+
return format(logSchema, data, super.returnFormat);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* ## subscribe('pendingTransactions')
|
41
|
+
* Subscribes to incoming pending transactions.
|
42
|
+
*
|
43
|
+
* You can subscribe to pending transactions by calling web3.eth.subscribe('pendingTransactions').
|
44
|
+
* @example
|
45
|
+
* ```ts
|
46
|
+
* (await web3.eth.subscribe('pendingTransactions')).on('data', console.log);
|
47
|
+
* ```
|
48
|
+
*/
|
49
|
+
export class NewPendingTransactionsSubscription extends Web3Subscription {
|
50
|
+
// eslint-disable-next-line
|
51
|
+
_buildSubscriptionParams() {
|
52
|
+
return ['newPendingTransactions'];
|
53
|
+
}
|
54
|
+
formatSubscriptionResult(data) {
|
55
|
+
return format({ format: 'string' }, data, super.returnFormat);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* ## subscribe('newHeads') ( same as subscribe('newBlockHeaders'))
|
60
|
+
*
|
61
|
+
* Subscribes to incoming block headers. This can be used as timer to check for changes on the blockchain.
|
62
|
+
*
|
63
|
+
* The structure of a returned block header is {@link BlockHeaderOutput}:
|
64
|
+
* @example
|
65
|
+
* ```ts
|
66
|
+
* (await web3.eth.subscribe('newHeads')).on( // 'newBlockHeaders' would work as well
|
67
|
+
* 'data',
|
68
|
+
* console.log
|
69
|
+
* );
|
70
|
+
* >{
|
71
|
+
* parentHash: '0x9e746a1d906b299def98c75b06f714d62dacadd567c7515d76eeaa8c8074c738',
|
72
|
+
* sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
|
73
|
+
* miner: '0x0000000000000000000000000000000000000000',
|
74
|
+
* stateRoot: '0xe0f04b04861ecfa95e82a9310d6a7ef7aef8d7417f5209c182582bfb98a8e307',
|
75
|
+
* transactionsRoot: '0x31ab4ea571a9e10d3a19aaed07d190595b1dfa34e03960c04293fec565dea536',
|
76
|
+
* logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
|
77
|
+
* difficulty: 2n,
|
78
|
+
* number: 21n,
|
79
|
+
* gasLimit: 11738125n,
|
80
|
+
* gasUsed: 830006n,
|
81
|
+
* timestamp: 1678797237n,
|
82
|
+
* extraData: '0xd883010b02846765746888676f312e32302e31856c696e757800000000000000e0a6e93cf40e2e71a72e493272210c3f43738ccc7e7d7b14ffd51833797d896c09117e8dc4fbcbc969bd21b42e5af3e276a911524038c001b2109b63b8e0352601',
|
83
|
+
* nonce: 0n
|
84
|
+
* }
|
85
|
+
* ```
|
86
|
+
*/
|
87
|
+
export class NewHeadsSubscription extends Web3Subscription {
|
88
|
+
// eslint-disable-next-line
|
89
|
+
_buildSubscriptionParams() {
|
90
|
+
return ['newHeads'];
|
91
|
+
}
|
92
|
+
formatSubscriptionResult(data) {
|
93
|
+
return format(blockHeaderSchema, data, super.returnFormat);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
/**
|
97
|
+
* ## subscribe('syncing')
|
98
|
+
*
|
99
|
+
* 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.
|
100
|
+
* @example
|
101
|
+
* ```ts
|
102
|
+
* (await web3.eth.subscribe('syncing')).on('changed', console.log);
|
103
|
+
* > `true` // when syncing
|
104
|
+
*
|
105
|
+
* (await web3.eth.subscribe('syncing')).on('data', console.log);
|
106
|
+
* > {
|
107
|
+
* startingBlock: 0,
|
108
|
+
* currentBlock: 0,
|
109
|
+
* highestBlock: 0,
|
110
|
+
* pulledStates: 0,
|
111
|
+
* knownStates: 0
|
112
|
+
* }
|
113
|
+
* ```
|
114
|
+
*/
|
115
|
+
export class SyncingSubscription extends Web3Subscription {
|
116
|
+
// eslint-disable-next-line
|
117
|
+
_buildSubscriptionParams() {
|
118
|
+
return ['syncing'];
|
119
|
+
}
|
120
|
+
_processSubscriptionResult(data) {
|
121
|
+
if (typeof data === 'boolean') {
|
122
|
+
this.emit('changed', data);
|
123
|
+
}
|
124
|
+
else {
|
125
|
+
const mappedData = Object.fromEntries(Object.entries((data === null || data === void 0 ? void 0 : data.status) || data).map(([key, value]) => [
|
126
|
+
key.charAt(0).toLowerCase() + key.substring(1),
|
127
|
+
value,
|
128
|
+
]));
|
129
|
+
this.emit('changed', data.syncing);
|
130
|
+
this.emit('data', format(syncSchema, mappedData, super.returnFormat));
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
//# 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,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAWpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,OAAO,gBAAiB,SAAQ,gBASrC;IACU,wBAAwB;QACjC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAES,wBAAwB,CAAC,IAAgB;QAClD,OAAO,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC;CACD;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kCAAmC,SAAQ,gBAEtD;IACD,2BAA2B;IACjB,wBAAwB;QACjC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACnC,CAAC;IAES,wBAAwB,CAAC,IAAY;QAC9C,OAAO,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC/D,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,oBAAqB,SAAQ,gBAExC;IACD,2BAA2B;IACjB,wBAAwB;QACjC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;IAES,wBAAwB,CAAC,IAAuB;QACzD,OAAO,MAAM,CAAC,iBAAiB,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC5D,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,gBAGvC;IACD,2BAA2B;IACjB,wBAAwB;QACjC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpB,CAAC;IAEM,0BAA0B,CAChC,IAKU;QAEV,IAAI,OAAO,IAAI,KAAK,SAAS,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;SAC3B;aAAM;YACN,MAAM,UAAU,GAAe,MAAM,CAAC,WAAW,CAChD,MAAM,CAAC,OAAO,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,KAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;gBAC1D,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;gBAC9C,KAAK;aACL,CAAC,CACY,CAAC;YAEhB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;SACtE;IACF,CAAC;CACD"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { FMT_BYTES, FMT_NUMBER } from 'web3-types';
|
2
|
+
export declare const ALL_EVENTS = "ALLEVENTS";
|
3
|
+
export declare const ALL_EVENTS_ABI: import("web3-types").AbiBaseFragment & {
|
4
|
+
readonly name: string;
|
5
|
+
readonly type: string;
|
6
|
+
readonly inputs?: readonly import("web3-types").AbiParameter[] | undefined;
|
7
|
+
readonly anonymous?: boolean | undefined;
|
8
|
+
} & {
|
9
|
+
signature: string;
|
10
|
+
};
|
11
|
+
export declare const NUMBER_DATA_FORMAT: {
|
12
|
+
readonly bytes: FMT_BYTES.HEX;
|
13
|
+
readonly number: FMT_NUMBER.NUMBER;
|
14
|
+
};
|
15
|
+
//# sourceMappingURL=constants.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAoB,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErE,eAAO,MAAM,UAAU,cAAc,CAAC;AACtC,eAAO,MAAM,cAAc;;;;;;eAKU,MAAM;CAAE,CAAC;AAE9C,eAAO,MAAM,kBAAkB;;;CAA+D,CAAC"}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/**
|
2
|
+
* The `web3-eth` package allows you to interact with an Ethereum blockchain and Ethereum smart contracts.
|
3
|
+
*
|
4
|
+
* To use this package standalone and use its methods use:
|
5
|
+
* ```ts
|
6
|
+
* import { Web3Context } from 'web3-core';
|
7
|
+
* import { BlockTags } from 'web3-types';
|
8
|
+
* import { DEFAULT_RETURN_FORMAT } from 'web3-types';
|
9
|
+
* import { getBalance} from 'web3-eth';
|
10
|
+
*
|
11
|
+
* getBalance(
|
12
|
+
* new Web3Context('http://127.0.0.1:8545'),
|
13
|
+
* '0x407d73d8a49eeb85d32cf465507dd71d507100c1',
|
14
|
+
* BlockTags.LATEST,
|
15
|
+
* DEFAULT_RETURN_FORMAT
|
16
|
+
* ).then(console.log);
|
17
|
+
* > 1000000000000n
|
18
|
+
* ```
|
19
|
+
*
|
20
|
+
* To use this package within the `web3` object use:
|
21
|
+
* ```ts
|
22
|
+
* import Web3 from 'web3';
|
23
|
+
*
|
24
|
+
* const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
|
25
|
+
* web3.eth.getBalance('0x407d73d8a49eeb85d32cf465507dd71d507100c1').then(console.log);
|
26
|
+
* > 1000000000000n
|
27
|
+
*```
|
28
|
+
*
|
29
|
+
* 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.
|
30
|
+
*/
|
31
|
+
/**
|
32
|
+
*
|
33
|
+
*/
|
34
|
+
import 'setimmediate';
|
35
|
+
import { Web3Eth } from './web3_eth.js';
|
36
|
+
export * from './web3_eth.js';
|
37
|
+
export * from './utils/decoding.js';
|
38
|
+
export * from './schemas.js';
|
39
|
+
export * from './constants.js';
|
40
|
+
export * from './types.js';
|
41
|
+
export * from './validation.js';
|
42
|
+
export * from './rpc_method_wrappers.js';
|
43
|
+
export * from './utils/format_transaction.js';
|
44
|
+
export * from './utils/prepare_transaction_for_signing.js';
|
45
|
+
export * from './web3_subscriptions.js';
|
46
|
+
export { detectTransactionType } from './utils/detect_transaction_type.js';
|
47
|
+
export { transactionBuilder, getTransactionFromOrToAttr } from './utils/transaction_builder.js';
|
48
|
+
export { waitForTransactionReceipt } from './utils/wait_for_transaction_receipt.js';
|
49
|
+
export { trySendTransaction } from './utils/try_send_transaction.js';
|
50
|
+
export { SendTxHelper } from './utils/send_tx_helper.js';
|
51
|
+
export default Web3Eth;
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|