@aztec/ethereum 0.0.0-test.0 → 0.0.1-commit.21caa21
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/dest/account.d.ts +2 -0
- package/dest/account.d.ts.map +1 -0
- package/dest/account.js +4 -0
- package/dest/chain.d.ts +1 -1
- package/dest/client.d.ts +6 -4
- package/dest/client.d.ts.map +1 -1
- package/dest/client.js +16 -2
- package/dest/config.d.ts +111 -17
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +462 -22
- package/dest/constants.d.ts +1 -1
- package/dest/contracts/empire_base.d.ts +24 -8
- package/dest/contracts/empire_base.d.ts.map +1 -1
- package/dest/contracts/empire_base.js +75 -2
- package/dest/contracts/empire_slashing_proposer.d.ts +66 -0
- package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -0
- package/dest/contracts/empire_slashing_proposer.js +200 -0
- package/dest/contracts/errors.d.ts +7 -0
- package/dest/contracts/errors.d.ts.map +1 -0
- package/dest/contracts/errors.js +12 -0
- package/dest/contracts/fee_asset_handler.d.ts +19 -0
- package/dest/contracts/fee_asset_handler.d.ts.map +1 -0
- package/dest/contracts/fee_asset_handler.js +57 -0
- package/dest/contracts/fee_juice.d.ts +6 -7
- package/dest/contracts/fee_juice.d.ts.map +1 -1
- package/dest/contracts/fee_juice.js +27 -20
- package/dest/contracts/governance.d.ts +43 -32
- package/dest/contracts/governance.d.ts.map +1 -1
- package/dest/contracts/governance.js +87 -84
- package/dest/contracts/governance_proposer.d.ts +16 -13
- package/dest/contracts/governance_proposer.d.ts.map +1 -1
- package/dest/contracts/governance_proposer.js +37 -17
- package/dest/contracts/gse.d.ts +32 -0
- package/dest/contracts/gse.d.ts.map +1 -0
- package/dest/contracts/gse.js +72 -0
- package/dest/contracts/inbox.d.ts +26 -0
- package/dest/contracts/inbox.d.ts.map +1 -0
- package/dest/contracts/inbox.js +45 -0
- package/dest/contracts/index.d.ts +9 -3
- package/dest/contracts/index.d.ts.map +1 -1
- package/dest/contracts/index.js +8 -2
- package/dest/contracts/multicall.d.ts +21 -0
- package/dest/contracts/multicall.d.ts.map +1 -0
- package/dest/contracts/multicall.js +156 -0
- package/dest/contracts/registry.d.ts +10 -5
- package/dest/contracts/registry.d.ts.map +1 -1
- package/dest/contracts/registry.js +44 -16
- package/dest/contracts/rollup.d.ts +204 -40
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +529 -79
- package/dest/contracts/slasher_contract.d.ts +44 -0
- package/dest/contracts/slasher_contract.d.ts.map +1 -0
- package/dest/contracts/slasher_contract.js +75 -0
- package/dest/contracts/tally_slashing_proposer.d.ts +139 -0
- package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -0
- package/dest/contracts/tally_slashing_proposer.js +313 -0
- package/dest/contracts/utils.d.ts +3 -0
- package/dest/contracts/utils.d.ts.map +1 -0
- package/dest/contracts/utils.js +11 -0
- package/dest/deploy_l1_contracts.d.ts +577 -21114
- package/dest/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_l1_contracts.js +1225 -421
- package/dest/eth-signer/eth-signer.d.ts +21 -0
- package/dest/eth-signer/eth-signer.d.ts.map +1 -0
- package/dest/eth-signer/eth-signer.js +5 -0
- package/dest/eth-signer/index.d.ts +2 -0
- package/dest/eth-signer/index.d.ts.map +1 -0
- package/dest/eth-signer/index.js +1 -0
- package/dest/index.d.ts +7 -3
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +6 -2
- package/dest/l1_artifacts.d.ts +77344 -0
- package/dest/l1_artifacts.d.ts.map +1 -0
- package/dest/l1_artifacts.js +166 -0
- package/dest/l1_contract_addresses.d.ts +24 -4
- package/dest/l1_contract_addresses.d.ts.map +1 -1
- package/dest/l1_contract_addresses.js +22 -18
- package/dest/l1_reader.d.ts +2 -2
- package/dest/l1_reader.d.ts.map +1 -1
- package/dest/l1_reader.js +8 -8
- package/dest/l1_tx_utils/config.d.ts +59 -0
- package/dest/l1_tx_utils/config.d.ts.map +1 -0
- package/dest/l1_tx_utils/config.js +82 -0
- package/dest/l1_tx_utils/constants.d.ts +6 -0
- package/dest/l1_tx_utils/constants.d.ts.map +1 -0
- package/dest/l1_tx_utils/constants.js +14 -0
- package/dest/l1_tx_utils/factory.d.ts +24 -0
- package/dest/l1_tx_utils/factory.d.ts.map +1 -0
- package/dest/l1_tx_utils/factory.js +12 -0
- package/dest/l1_tx_utils/index.d.ts +10 -0
- package/dest/l1_tx_utils/index.d.ts.map +1 -0
- package/dest/l1_tx_utils/index.js +10 -0
- package/dest/l1_tx_utils/interfaces.d.ts +76 -0
- package/dest/l1_tx_utils/interfaces.d.ts.map +1 -0
- package/dest/l1_tx_utils/interfaces.js +4 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts +94 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/l1_tx_utils.js +610 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +26 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +26 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +94 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +430 -0
- package/dest/l1_tx_utils/signer.d.ts +4 -0
- package/dest/l1_tx_utils/signer.d.ts.map +1 -0
- package/dest/l1_tx_utils/signer.js +16 -0
- package/dest/l1_tx_utils/types.d.ts +67 -0
- package/dest/l1_tx_utils/types.d.ts.map +1 -0
- package/dest/l1_tx_utils/types.js +26 -0
- package/dest/l1_tx_utils/utils.d.ts +4 -0
- package/dest/l1_tx_utils/utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/utils.js +14 -0
- package/dest/l1_types.d.ts +6 -0
- package/dest/l1_types.d.ts.map +1 -0
- package/dest/l1_types.js +1 -0
- package/dest/publisher_manager.d.ts +15 -0
- package/dest/publisher_manager.d.ts.map +1 -0
- package/dest/publisher_manager.js +88 -0
- package/dest/queries.d.ts +4 -2
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +53 -12
- package/dest/test/chain_monitor.d.ts +73 -0
- package/dest/test/chain_monitor.d.ts.map +1 -0
- package/dest/test/chain_monitor.js +215 -0
- package/dest/test/delayed_tx_utils.d.ts +8 -3
- package/dest/test/delayed_tx_utils.d.ts.map +1 -1
- package/dest/test/delayed_tx_utils.js +13 -6
- package/dest/test/eth_cheat_codes.d.ts +217 -0
- package/dest/test/eth_cheat_codes.d.ts.map +1 -0
- package/dest/test/eth_cheat_codes.js +558 -0
- package/dest/test/eth_cheat_codes_with_state.d.ts +2 -2
- package/dest/test/eth_cheat_codes_with_state.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes_with_state.js +1 -1
- package/dest/test/index.d.ts +4 -1
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +3 -0
- package/dest/test/rollup_cheat_codes.d.ts +87 -0
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -0
- package/dest/test/rollup_cheat_codes.js +266 -0
- package/dest/test/start_anvil.d.ts +7 -1
- package/dest/test/start_anvil.d.ts.map +1 -1
- package/dest/test/start_anvil.js +16 -7
- package/dest/test/tx_delayer.d.ts +18 -7
- package/dest/test/tx_delayer.d.ts.map +1 -1
- package/dest/test/tx_delayer.js +95 -19
- package/dest/test/upgrade_utils.d.ts +6 -5
- package/dest/test/upgrade_utils.d.ts.map +1 -1
- package/dest/test/upgrade_utils.js +23 -16
- package/dest/types.d.ts +7 -8
- package/dest/types.d.ts.map +1 -1
- package/dest/types.js +3 -1
- package/dest/utils.d.ts +2 -1
- package/dest/utils.d.ts.map +1 -1
- package/dest/utils.js +43 -88
- package/dest/zkPassportVerifierAddress.d.ts +15 -0
- package/dest/zkPassportVerifierAddress.d.ts.map +1 -0
- package/dest/zkPassportVerifierAddress.js +11 -0
- package/package.json +28 -19
- package/src/account.ts +5 -0
- package/src/client.ts +42 -4
- package/src/config.ts +592 -31
- package/src/contracts/empire_base.ts +77 -7
- package/src/contracts/empire_slashing_proposer.ts +265 -0
- package/src/contracts/errors.ts +13 -0
- package/src/contracts/fee_asset_handler.ts +63 -0
- package/src/contracts/fee_juice.ts +29 -15
- package/src/contracts/governance.ts +80 -77
- package/src/contracts/governance_proposer.ts +66 -24
- package/src/contracts/gse.ts +88 -0
- package/src/contracts/inbox.ts +63 -0
- package/src/contracts/index.ts +8 -2
- package/src/contracts/multicall.ts +155 -0
- package/src/contracts/registry.ts +51 -26
- package/src/contracts/rollup.ts +596 -74
- package/src/contracts/slasher_contract.ts +89 -0
- package/src/contracts/tally_slashing_proposer.ts +316 -0
- package/src/contracts/utils.ts +14 -0
- package/src/deploy_l1_contracts.ts +1459 -538
- package/src/eth-signer/eth-signer.ts +25 -0
- package/src/eth-signer/index.ts +1 -0
- package/src/index.ts +6 -2
- package/src/l1_artifacts.ts +254 -0
- package/src/l1_contract_addresses.ts +32 -19
- package/src/l1_reader.ts +9 -9
- package/src/l1_tx_utils/README.md +177 -0
- package/src/l1_tx_utils/config.ts +143 -0
- package/src/l1_tx_utils/constants.ts +18 -0
- package/src/l1_tx_utils/factory.ts +64 -0
- package/src/l1_tx_utils/index.ts +12 -0
- package/src/l1_tx_utils/interfaces.ts +86 -0
- package/src/l1_tx_utils/l1_tx_utils.ts +718 -0
- package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +77 -0
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +558 -0
- package/src/l1_tx_utils/signer.ts +28 -0
- package/src/l1_tx_utils/types.ts +85 -0
- package/src/l1_tx_utils/utils.ts +16 -0
- package/src/l1_types.ts +6 -0
- package/src/publisher_manager.ts +106 -0
- package/src/queries.ts +73 -15
- package/src/test/chain_monitor.ts +243 -0
- package/src/test/delayed_tx_utils.ts +34 -6
- package/src/test/eth_cheat_codes.ts +588 -0
- package/src/test/eth_cheat_codes_with_state.ts +1 -1
- package/src/test/index.ts +3 -0
- package/src/test/rollup_cheat_codes.ts +307 -0
- package/src/test/start_anvil.ts +22 -5
- package/src/test/tx_delayer.ts +127 -26
- package/src/test/upgrade_utils.ts +30 -21
- package/src/types.ts +10 -8
- package/src/utils.ts +49 -90
- package/src/zkPassportVerifierAddress.ts +15 -0
- package/dest/contracts/forwarder.d.ts +0 -24
- package/dest/contracts/forwarder.d.ts.map +0 -1
- package/dest/contracts/forwarder.js +0 -101
- package/dest/contracts/slashing_proposer.d.ts +0 -21
- package/dest/contracts/slashing_proposer.d.ts.map +0 -1
- package/dest/contracts/slashing_proposer.js +0 -47
- package/dest/eth_cheat_codes.d.ts +0 -147
- package/dest/eth_cheat_codes.d.ts.map +0 -1
- package/dest/eth_cheat_codes.js +0 -303
- package/dest/l1_tx_utils.d.ts +0 -192
- package/dest/l1_tx_utils.d.ts.map +0 -1
- package/dest/l1_tx_utils.js +0 -641
- package/dest/l1_tx_utils_with_blobs.d.ts +0 -12
- package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
- package/dest/l1_tx_utils_with_blobs.js +0 -64
- package/src/contracts/forwarder.ts +0 -132
- package/src/contracts/slashing_proposer.ts +0 -51
- package/src/eth_cheat_codes.ts +0 -314
- package/src/l1_tx_utils.ts +0 -847
- package/src/l1_tx_utils_with_blobs.ts +0 -86
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import { type Hex } from 'viem';
|
|
3
|
-
/**
|
|
4
|
-
* A class that provides utility functions for interacting with ethereum (L1).
|
|
5
|
-
*/
|
|
6
|
-
export declare class EthCheatCodes {
|
|
7
|
-
/**
|
|
8
|
-
* The RPC URL to use for interacting with the chain
|
|
9
|
-
*/
|
|
10
|
-
rpcUrls: string[];
|
|
11
|
-
/**
|
|
12
|
-
* The logger to use for the eth cheatcodes
|
|
13
|
-
*/
|
|
14
|
-
logger: import("@aztec/foundation/log").Logger;
|
|
15
|
-
private publicClient;
|
|
16
|
-
constructor(
|
|
17
|
-
/**
|
|
18
|
-
* The RPC URL to use for interacting with the chain
|
|
19
|
-
*/
|
|
20
|
-
rpcUrls: string[],
|
|
21
|
-
/**
|
|
22
|
-
* The logger to use for the eth cheatcodes
|
|
23
|
-
*/
|
|
24
|
-
logger?: import("@aztec/foundation/log").Logger);
|
|
25
|
-
rpcCall(method: string, params: any[]): Promise<any>;
|
|
26
|
-
/**
|
|
27
|
-
* Get the auto mine status of the underlying chain
|
|
28
|
-
* @returns True if automine is on, false otherwise
|
|
29
|
-
*/
|
|
30
|
-
isAutoMining(): Promise<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* Get the current blocknumber
|
|
33
|
-
* @returns The current block number
|
|
34
|
-
*/
|
|
35
|
-
blockNumber(): Promise<number>;
|
|
36
|
-
/**
|
|
37
|
-
* Get the current chainId
|
|
38
|
-
* @returns The current chainId
|
|
39
|
-
*/
|
|
40
|
-
chainId(): Promise<number>;
|
|
41
|
-
/**
|
|
42
|
-
* Get the current timestamp
|
|
43
|
-
* @returns The current timestamp
|
|
44
|
-
*/
|
|
45
|
-
timestamp(): Promise<number>;
|
|
46
|
-
/**
|
|
47
|
-
* Advance the chain by a number of blocks
|
|
48
|
-
* @param numberOfBlocks - The number of blocks to mine
|
|
49
|
-
*/
|
|
50
|
-
mine(numberOfBlocks?: number): Promise<void>;
|
|
51
|
-
private doMine;
|
|
52
|
-
/**
|
|
53
|
-
* Mines a single block with evm_mine
|
|
54
|
-
*/
|
|
55
|
-
evmMine(): Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Set the balance of an account
|
|
58
|
-
* @param account - The account to set the balance for
|
|
59
|
-
* @param balance - The balance to set
|
|
60
|
-
*/
|
|
61
|
-
setBalance(account: EthAddress, balance: bigint): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Set the interval between blocks (block time)
|
|
64
|
-
* @param interval - The interval to use between blocks
|
|
65
|
-
*/
|
|
66
|
-
setBlockInterval(interval: number): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Set the next block base fee per gas
|
|
69
|
-
* @param baseFee - The base fee to set
|
|
70
|
-
*/
|
|
71
|
-
setNextBlockBaseFeePerGas(baseFee: bigint | number): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Set the interval between blocks (block time)
|
|
74
|
-
* @param seconds - The interval to use between blocks
|
|
75
|
-
*/
|
|
76
|
-
setIntervalMining(seconds: number): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Set the automine status of the underlying anvil chain
|
|
79
|
-
* @param automine - The automine status to set
|
|
80
|
-
*/
|
|
81
|
-
setAutomine(automine: boolean): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Drop a transaction from the mempool
|
|
84
|
-
* @param txHash - The transaction hash
|
|
85
|
-
*/
|
|
86
|
-
dropTransaction(txHash: Hex): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Set the next block timestamp
|
|
89
|
-
* @param timestamp - The timestamp to set the next block to
|
|
90
|
-
*/
|
|
91
|
-
setNextBlockTimestamp(timestamp: number): Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
* Set the next block timestamp and mines the block
|
|
94
|
-
* @param timestamp - The timestamp to set the next block to
|
|
95
|
-
*/
|
|
96
|
-
warp(timestamp: number | bigint, silent?: boolean): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Load the value at a storage slot of a contract address on eth
|
|
99
|
-
* @param contract - The contract address
|
|
100
|
-
* @param slot - The storage slot
|
|
101
|
-
* @returns - The value at the storage slot
|
|
102
|
-
*/
|
|
103
|
-
load(contract: EthAddress, slot: bigint): Promise<bigint>;
|
|
104
|
-
/**
|
|
105
|
-
* Set the value at a storage slot of a contract address on eth
|
|
106
|
-
* @param contract - The contract address
|
|
107
|
-
* @param slot - The storage slot
|
|
108
|
-
* @param value - The value to set the storage slot to
|
|
109
|
-
*/
|
|
110
|
-
store(contract: EthAddress, slot: bigint, value: bigint): Promise<void>;
|
|
111
|
-
/**
|
|
112
|
-
* Computes the slot value for a given map and key.
|
|
113
|
-
* @param baseSlot - The base slot of the map (specified in Aztec.nr contract)
|
|
114
|
-
* @param key - The key to lookup in the map
|
|
115
|
-
* @returns The storage slot of the value in the map
|
|
116
|
-
*/
|
|
117
|
-
keccak256(baseSlot: bigint, key: bigint): bigint;
|
|
118
|
-
/**
|
|
119
|
-
* Send transactions impersonating an externally owned account or contract.
|
|
120
|
-
* @param who - The address to impersonate
|
|
121
|
-
*/
|
|
122
|
-
startImpersonating(who: EthAddress | Hex): Promise<void>;
|
|
123
|
-
/**
|
|
124
|
-
* Stop impersonating an account that you are currently impersonating.
|
|
125
|
-
* @param who - The address to stop impersonating
|
|
126
|
-
*/
|
|
127
|
-
stopImpersonating(who: EthAddress | Hex): Promise<void>;
|
|
128
|
-
/**
|
|
129
|
-
* Set the bytecode for a contract
|
|
130
|
-
* @param contract - The contract address
|
|
131
|
-
* @param bytecode - The bytecode to set
|
|
132
|
-
*/
|
|
133
|
-
etch(contract: EthAddress, bytecode: `0x${string}`): Promise<void>;
|
|
134
|
-
/**
|
|
135
|
-
* Get the bytecode for a contract
|
|
136
|
-
* @param contract - The contract address
|
|
137
|
-
* @returns The bytecode for the contract
|
|
138
|
-
*/
|
|
139
|
-
getBytecode(contract: EthAddress): Promise<`0x${string}`>;
|
|
140
|
-
/**
|
|
141
|
-
* Get the raw transaction object for a given transaction hash
|
|
142
|
-
* @param txHash - The transaction hash
|
|
143
|
-
* @returns The raw transaction
|
|
144
|
-
*/
|
|
145
|
-
getRawTransaction(txHash: Hex): Promise<`0x${string}`>;
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=eth_cheat_codes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eth_cheat_codes.d.ts","sourceRoot":"","sources":["../src/eth_cheat_codes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE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OAGG;IACU,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASpE;;;OAGG;IACU,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAY5E;;;;;OAKG;IACU,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKtE;;;;;OAKG;IACU,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUpF;;;;;OAKG;IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAMvD;;;OAGG;IACU,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IASrE;;;OAGG;IACU,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IASpE;;;;OAIG;IACU,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/E;;;;OAIG;IACU,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC;IAKtE;;;;OAIG;IACU,iBAAiB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC;CAIpE"}
|
package/dest/eth_cheat_codes.js
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE, toHex } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { keccak256 } from '@aztec/foundation/crypto';
|
|
3
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
-
import { createPublicClient, fallback, http } from 'viem';
|
|
5
|
-
/**
|
|
6
|
-
* A class that provides utility functions for interacting with ethereum (L1).
|
|
7
|
-
*/ export class EthCheatCodes {
|
|
8
|
-
rpcUrls;
|
|
9
|
-
logger;
|
|
10
|
-
publicClient;
|
|
11
|
-
constructor(/**
|
|
12
|
-
* The RPC URL to use for interacting with the chain
|
|
13
|
-
*/ rpcUrls, /**
|
|
14
|
-
* The logger to use for the eth cheatcodes
|
|
15
|
-
*/ logger = createLogger('ethereum:cheat_codes')){
|
|
16
|
-
this.rpcUrls = rpcUrls;
|
|
17
|
-
this.logger = logger;
|
|
18
|
-
this.publicClient = createPublicClient({
|
|
19
|
-
transport: fallback(this.rpcUrls.map((url)=>http(url)))
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
async rpcCall(method, params) {
|
|
23
|
-
const paramsString = JSON.stringify(params);
|
|
24
|
-
this.logger.info(`Calling ${method} with params: ${paramsString} on ${this.rpcUrls.join(', ')}`);
|
|
25
|
-
return await this.publicClient.transport.request({
|
|
26
|
-
method,
|
|
27
|
-
params
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get the auto mine status of the underlying chain
|
|
32
|
-
* @returns True if automine is on, false otherwise
|
|
33
|
-
*/ async isAutoMining() {
|
|
34
|
-
try {
|
|
35
|
-
const res = await this.rpcCall('anvil_getAutomine', []);
|
|
36
|
-
return res;
|
|
37
|
-
} catch (err) {
|
|
38
|
-
this.logger.error(`Calling "anvil_getAutomine" failed with:`, err);
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Get the current blocknumber
|
|
44
|
-
* @returns The current block number
|
|
45
|
-
*/ async blockNumber() {
|
|
46
|
-
const res = await this.rpcCall('eth_blockNumber', []);
|
|
47
|
-
return parseInt(res, 16);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Get the current chainId
|
|
51
|
-
* @returns The current chainId
|
|
52
|
-
*/ async chainId() {
|
|
53
|
-
const res = await this.rpcCall('eth_chainId', []);
|
|
54
|
-
return parseInt(res, 16);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get the current timestamp
|
|
58
|
-
* @returns The current timestamp
|
|
59
|
-
*/ async timestamp() {
|
|
60
|
-
const res = await this.rpcCall('eth_getBlockByNumber', [
|
|
61
|
-
'latest',
|
|
62
|
-
true
|
|
63
|
-
]);
|
|
64
|
-
return parseInt(res.timestamp, 16);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Advance the chain by a number of blocks
|
|
68
|
-
* @param numberOfBlocks - The number of blocks to mine
|
|
69
|
-
*/ async mine(numberOfBlocks = 1) {
|
|
70
|
-
await this.doMine(numberOfBlocks);
|
|
71
|
-
this.logger.warn(`Mined ${numberOfBlocks} L1 blocks`);
|
|
72
|
-
}
|
|
73
|
-
async doMine(numberOfBlocks = 1) {
|
|
74
|
-
try {
|
|
75
|
-
await this.rpcCall('hardhat_mine', [
|
|
76
|
-
numberOfBlocks
|
|
77
|
-
]);
|
|
78
|
-
} catch (err) {
|
|
79
|
-
throw new Error(`Error mining: ${err}`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Mines a single block with evm_mine
|
|
84
|
-
*/ async evmMine() {
|
|
85
|
-
try {
|
|
86
|
-
await this.rpcCall('evm_mine', []);
|
|
87
|
-
} catch (err) {
|
|
88
|
-
throw new Error(`Error mining: ${err}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Set the balance of an account
|
|
93
|
-
* @param account - The account to set the balance for
|
|
94
|
-
* @param balance - The balance to set
|
|
95
|
-
*/ async setBalance(account, balance) {
|
|
96
|
-
try {
|
|
97
|
-
await this.rpcCall('anvil_setBalance', [
|
|
98
|
-
account.toString(),
|
|
99
|
-
toHex(balance)
|
|
100
|
-
]);
|
|
101
|
-
} catch (err) {
|
|
102
|
-
throw new Error(`Error setting balance for ${account}: ${err}`);
|
|
103
|
-
}
|
|
104
|
-
this.logger.warn(`Set balance for ${account} to ${balance}`);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Set the interval between blocks (block time)
|
|
108
|
-
* @param interval - The interval to use between blocks
|
|
109
|
-
*/ async setBlockInterval(interval) {
|
|
110
|
-
try {
|
|
111
|
-
await this.rpcCall('anvil_setBlockTimestampInterval', [
|
|
112
|
-
interval
|
|
113
|
-
]);
|
|
114
|
-
} catch (err) {
|
|
115
|
-
throw new Error(`Error setting block interval: ${err}`);
|
|
116
|
-
}
|
|
117
|
-
this.logger.warn(`Set L1 block interval to ${interval}`);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Set the next block base fee per gas
|
|
121
|
-
* @param baseFee - The base fee to set
|
|
122
|
-
*/ async setNextBlockBaseFeePerGas(baseFee) {
|
|
123
|
-
try {
|
|
124
|
-
await this.rpcCall('anvil_setNextBlockBaseFeePerGas', [
|
|
125
|
-
baseFee.toString()
|
|
126
|
-
]);
|
|
127
|
-
} catch (err) {
|
|
128
|
-
throw new Error(`Error setting next block base fee per gas: ${err}`);
|
|
129
|
-
}
|
|
130
|
-
this.logger.warn(`Set L1 next block base fee per gas to ${baseFee}`);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Set the interval between blocks (block time)
|
|
134
|
-
* @param seconds - The interval to use between blocks
|
|
135
|
-
*/ async setIntervalMining(seconds) {
|
|
136
|
-
try {
|
|
137
|
-
await this.rpcCall('anvil_setIntervalMining', [
|
|
138
|
-
seconds
|
|
139
|
-
]);
|
|
140
|
-
} catch (err) {
|
|
141
|
-
throw new Error(`Error setting interval mining: ${err}`);
|
|
142
|
-
}
|
|
143
|
-
this.logger.warn(`Set L1 interval mining to ${seconds} seconds`);
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Set the automine status of the underlying anvil chain
|
|
147
|
-
* @param automine - The automine status to set
|
|
148
|
-
*/ async setAutomine(automine) {
|
|
149
|
-
try {
|
|
150
|
-
await this.rpcCall('anvil_setAutomine', [
|
|
151
|
-
automine
|
|
152
|
-
]);
|
|
153
|
-
} catch (err) {
|
|
154
|
-
throw new Error(`Error setting automine: ${err}`);
|
|
155
|
-
}
|
|
156
|
-
this.logger.warn(`Set L1 automine to ${automine}`);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Drop a transaction from the mempool
|
|
160
|
-
* @param txHash - The transaction hash
|
|
161
|
-
*/ async dropTransaction(txHash) {
|
|
162
|
-
try {
|
|
163
|
-
await this.rpcCall('anvil_dropTransaction', [
|
|
164
|
-
txHash
|
|
165
|
-
]);
|
|
166
|
-
} catch (err) {
|
|
167
|
-
throw new Error(`Error dropping transaction: ${err}`);
|
|
168
|
-
}
|
|
169
|
-
this.logger.warn(`Dropped transaction ${txHash}`);
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Set the next block timestamp
|
|
173
|
-
* @param timestamp - The timestamp to set the next block to
|
|
174
|
-
*/ async setNextBlockTimestamp(timestamp) {
|
|
175
|
-
try {
|
|
176
|
-
await this.rpcCall('evm_setNextBlockTimestamp', [
|
|
177
|
-
timestamp
|
|
178
|
-
]);
|
|
179
|
-
} catch (err) {
|
|
180
|
-
throw new Error(`Error setting next block timestamp: ${err.message}`);
|
|
181
|
-
}
|
|
182
|
-
this.logger.warn(`Set L1 next block timestamp to ${timestamp}`);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Set the next block timestamp and mines the block
|
|
186
|
-
* @param timestamp - The timestamp to set the next block to
|
|
187
|
-
*/ async warp(timestamp, silent = false) {
|
|
188
|
-
try {
|
|
189
|
-
await this.rpcCall('evm_setNextBlockTimestamp', [
|
|
190
|
-
Number(timestamp)
|
|
191
|
-
]);
|
|
192
|
-
} catch (err) {
|
|
193
|
-
throw new Error(`Error warping: ${err}`);
|
|
194
|
-
}
|
|
195
|
-
await this.doMine();
|
|
196
|
-
if (!silent) {
|
|
197
|
-
this.logger.warn(`Warped L1 timestamp to ${timestamp}`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Load the value at a storage slot of a contract address on eth
|
|
202
|
-
* @param contract - The contract address
|
|
203
|
-
* @param slot - The storage slot
|
|
204
|
-
* @returns - The value at the storage slot
|
|
205
|
-
*/ async load(contract, slot) {
|
|
206
|
-
const res = await this.rpcCall('eth_getStorageAt', [
|
|
207
|
-
contract.toString(),
|
|
208
|
-
toHex(slot),
|
|
209
|
-
'latest'
|
|
210
|
-
]);
|
|
211
|
-
return BigInt(res);
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Set the value at a storage slot of a contract address on eth
|
|
215
|
-
* @param contract - The contract address
|
|
216
|
-
* @param slot - The storage slot
|
|
217
|
-
* @param value - The value to set the storage slot to
|
|
218
|
-
*/ async store(contract, slot, value) {
|
|
219
|
-
// for the rpc call, we need to change value to be a 32 byte hex string.
|
|
220
|
-
try {
|
|
221
|
-
await this.rpcCall('hardhat_setStorageAt', [
|
|
222
|
-
contract.toString(),
|
|
223
|
-
toHex(slot),
|
|
224
|
-
toHex(value, true)
|
|
225
|
-
]);
|
|
226
|
-
} catch (err) {
|
|
227
|
-
throw new Error(`Error setting storage for contract ${contract} at ${slot}: ${err}`);
|
|
228
|
-
}
|
|
229
|
-
this.logger.warn(`Set L1 storage for contract ${contract} at ${slot} to ${value}`);
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Computes the slot value for a given map and key.
|
|
233
|
-
* @param baseSlot - The base slot of the map (specified in Aztec.nr contract)
|
|
234
|
-
* @param key - The key to lookup in the map
|
|
235
|
-
* @returns The storage slot of the value in the map
|
|
236
|
-
*/ keccak256(baseSlot, key) {
|
|
237
|
-
// abi encode (removing the 0x) - concat key and baseSlot (both padded to 32 bytes)
|
|
238
|
-
const abiEncoded = toHex(key, true).substring(2) + toHex(baseSlot, true).substring(2);
|
|
239
|
-
return toBigIntBE(keccak256(Buffer.from(abiEncoded, 'hex')));
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Send transactions impersonating an externally owned account or contract.
|
|
243
|
-
* @param who - The address to impersonate
|
|
244
|
-
*/ async startImpersonating(who) {
|
|
245
|
-
try {
|
|
246
|
-
await this.rpcCall('hardhat_impersonateAccount', [
|
|
247
|
-
who.toString()
|
|
248
|
-
]);
|
|
249
|
-
} catch (err) {
|
|
250
|
-
throw new Error(`Error impersonating ${who}: ${err}`);
|
|
251
|
-
}
|
|
252
|
-
this.logger.warn(`Impersonating ${who}`);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Stop impersonating an account that you are currently impersonating.
|
|
256
|
-
* @param who - The address to stop impersonating
|
|
257
|
-
*/ async stopImpersonating(who) {
|
|
258
|
-
try {
|
|
259
|
-
await this.rpcCall('hardhat_stopImpersonatingAccount', [
|
|
260
|
-
who.toString()
|
|
261
|
-
]);
|
|
262
|
-
} catch (err) {
|
|
263
|
-
throw new Error(`Error when stopping the impersonation of ${who}: ${err}`);
|
|
264
|
-
}
|
|
265
|
-
this.logger.warn(`Stopped impersonating ${who}`);
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Set the bytecode for a contract
|
|
269
|
-
* @param contract - The contract address
|
|
270
|
-
* @param bytecode - The bytecode to set
|
|
271
|
-
*/ async etch(contract, bytecode) {
|
|
272
|
-
try {
|
|
273
|
-
await this.rpcCall('hardhat_setCode', [
|
|
274
|
-
contract.toString(),
|
|
275
|
-
bytecode
|
|
276
|
-
]);
|
|
277
|
-
} catch (err) {
|
|
278
|
-
throw new Error(`Error setting bytecode for ${contract}: ${err}`);
|
|
279
|
-
}
|
|
280
|
-
this.logger.warn(`Set bytecode for ${contract} to ${bytecode}`);
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Get the bytecode for a contract
|
|
284
|
-
* @param contract - The contract address
|
|
285
|
-
* @returns The bytecode for the contract
|
|
286
|
-
*/ async getBytecode(contract) {
|
|
287
|
-
const res = await this.rpcCall('eth_getCode', [
|
|
288
|
-
contract.toString(),
|
|
289
|
-
'latest'
|
|
290
|
-
]);
|
|
291
|
-
return res;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Get the raw transaction object for a given transaction hash
|
|
295
|
-
* @param txHash - The transaction hash
|
|
296
|
-
* @returns The raw transaction
|
|
297
|
-
*/ async getRawTransaction(txHash) {
|
|
298
|
-
const res = await this.rpcCall('debug_getRawTransaction', [
|
|
299
|
-
txHash
|
|
300
|
-
]);
|
|
301
|
-
return res;
|
|
302
|
-
}
|
|
303
|
-
}
|
package/dest/l1_tx_utils.d.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
2
|
-
import { type Logger } from '@aztec/foundation/log';
|
|
3
|
-
import { type Abi, type Account, type Address, type BlockOverrides, type ContractFunctionExecutionError, type Hex, type StateOverride, type TransactionReceipt } from 'viem';
|
|
4
|
-
import type { ViemPublicClient, ViemWalletClient } from './types.js';
|
|
5
|
-
export interface L1TxUtilsConfig {
|
|
6
|
-
/**
|
|
7
|
-
* How much to increase calculated gas limit.
|
|
8
|
-
*/
|
|
9
|
-
gasLimitBufferPercentage?: number;
|
|
10
|
-
/**
|
|
11
|
-
* Maximum gas price in gwei
|
|
12
|
-
*/
|
|
13
|
-
maxGwei?: bigint;
|
|
14
|
-
/**
|
|
15
|
-
* Maximum blob fee per gas in gwei
|
|
16
|
-
*/
|
|
17
|
-
maxBlobGwei?: bigint;
|
|
18
|
-
/**
|
|
19
|
-
* Priority fee bump percentage
|
|
20
|
-
*/
|
|
21
|
-
priorityFeeBumpPercentage?: number;
|
|
22
|
-
/**
|
|
23
|
-
* How much to increase priority fee by each attempt (percentage)
|
|
24
|
-
*/
|
|
25
|
-
priorityFeeRetryBumpPercentage?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Fixed priority fee per gas in Gwei. Overrides any priority fee bump percentage config
|
|
28
|
-
*/
|
|
29
|
-
fixedPriorityFeePerGas?: number;
|
|
30
|
-
/**
|
|
31
|
-
* Maximum number of speed-up attempts
|
|
32
|
-
*/
|
|
33
|
-
maxAttempts?: number;
|
|
34
|
-
/**
|
|
35
|
-
* How often to check tx status
|
|
36
|
-
*/
|
|
37
|
-
checkIntervalMs?: number;
|
|
38
|
-
/**
|
|
39
|
-
* How long before considering tx stalled
|
|
40
|
-
*/
|
|
41
|
-
stallTimeMs?: number;
|
|
42
|
-
/**
|
|
43
|
-
* How long to wait for a tx to be mined before giving up
|
|
44
|
-
*/
|
|
45
|
-
txTimeoutMs?: number;
|
|
46
|
-
/**
|
|
47
|
-
* How many attempts will be done to get a tx after it was sent?
|
|
48
|
-
* First attempt is done at 1s, second at 2s, third at 3s, etc.
|
|
49
|
-
*/
|
|
50
|
-
txPropagationMaxQueryAttempts?: number;
|
|
51
|
-
}
|
|
52
|
-
export declare const l1TxUtilsConfigMappings: ConfigMappingsType<L1TxUtilsConfig>;
|
|
53
|
-
export declare const defaultL1TxUtilsConfig: L1TxUtilsConfig;
|
|
54
|
-
export interface L1TxRequest {
|
|
55
|
-
to: Address | null;
|
|
56
|
-
data?: Hex;
|
|
57
|
-
value?: bigint;
|
|
58
|
-
}
|
|
59
|
-
export type L1GasConfig = Partial<L1TxUtilsConfig> & {
|
|
60
|
-
gasLimit?: bigint;
|
|
61
|
-
txTimeoutAt?: Date;
|
|
62
|
-
};
|
|
63
|
-
export interface L1BlobInputs {
|
|
64
|
-
blobs: Uint8Array[];
|
|
65
|
-
kzg: any;
|
|
66
|
-
maxFeePerBlobGas?: bigint;
|
|
67
|
-
}
|
|
68
|
-
export interface GasPrice {
|
|
69
|
-
maxFeePerGas: bigint;
|
|
70
|
-
maxPriorityFeePerGas: bigint;
|
|
71
|
-
maxFeePerBlobGas?: bigint;
|
|
72
|
-
}
|
|
73
|
-
export type TransactionStats = {
|
|
74
|
-
/** Address of the sender. */
|
|
75
|
-
sender: string;
|
|
76
|
-
/** Hash of the transaction. */
|
|
77
|
-
transactionHash: string;
|
|
78
|
-
/** Size in bytes of the tx calldata */
|
|
79
|
-
calldataSize: number;
|
|
80
|
-
/** Gas required to pay for the calldata inclusion (depends on size and number of zeros) */
|
|
81
|
-
calldataGas: number;
|
|
82
|
-
};
|
|
83
|
-
export declare class L1TxUtils {
|
|
84
|
-
publicClient: ViemPublicClient;
|
|
85
|
-
walletClient: ViemWalletClient;
|
|
86
|
-
protected logger: Logger;
|
|
87
|
-
private debugMaxGasLimit;
|
|
88
|
-
readonly config: L1TxUtilsConfig;
|
|
89
|
-
private interrupted;
|
|
90
|
-
constructor(publicClient: ViemPublicClient, walletClient: ViemWalletClient, logger?: Logger, config?: Partial<L1TxUtilsConfig>, debugMaxGasLimit?: boolean);
|
|
91
|
-
interrupt(): void;
|
|
92
|
-
restart(): void;
|
|
93
|
-
getSenderAddress(): `0x${string}`;
|
|
94
|
-
getSenderBalance(): Promise<bigint>;
|
|
95
|
-
getBlock(): Promise<{
|
|
96
|
-
number: bigint;
|
|
97
|
-
hash: `0x${string}`;
|
|
98
|
-
nonce: `0x${string}`;
|
|
99
|
-
logsBloom: `0x${string}`;
|
|
100
|
-
baseFeePerGas: bigint | null;
|
|
101
|
-
blobGasUsed: bigint;
|
|
102
|
-
difficulty: bigint;
|
|
103
|
-
excessBlobGas: bigint;
|
|
104
|
-
extraData: `0x${string}`;
|
|
105
|
-
gasLimit: bigint;
|
|
106
|
-
gasUsed: bigint;
|
|
107
|
-
miner: `0x${string}`;
|
|
108
|
-
mixHash: `0x${string}`;
|
|
109
|
-
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
110
|
-
parentHash: `0x${string}`;
|
|
111
|
-
receiptsRoot: `0x${string}`;
|
|
112
|
-
sealFields: `0x${string}`[];
|
|
113
|
-
sha3Uncles: `0x${string}`;
|
|
114
|
-
size: bigint;
|
|
115
|
-
stateRoot: `0x${string}`;
|
|
116
|
-
timestamp: bigint;
|
|
117
|
-
totalDifficulty: bigint | null;
|
|
118
|
-
transactionsRoot: `0x${string}`;
|
|
119
|
-
uncles: `0x${string}`[];
|
|
120
|
-
withdrawals?: import("viem").Withdrawal[] | undefined;
|
|
121
|
-
withdrawalsRoot?: `0x${string}` | undefined;
|
|
122
|
-
transactions: `0x${string}`[];
|
|
123
|
-
}>;
|
|
124
|
-
getBlockNumber(): Promise<bigint>;
|
|
125
|
-
/**
|
|
126
|
-
* Sends a transaction with gas estimation and pricing
|
|
127
|
-
* @param request - The transaction request (to, data, value)
|
|
128
|
-
* @param gasConfig - Optional gas configuration
|
|
129
|
-
* @returns The transaction hash and parameters used
|
|
130
|
-
*/
|
|
131
|
-
sendTransaction(request: L1TxRequest, _gasConfig?: L1GasConfig, blobInputs?: L1BlobInputs): Promise<{
|
|
132
|
-
txHash: Hex;
|
|
133
|
-
gasLimit: bigint;
|
|
134
|
-
gasPrice: GasPrice;
|
|
135
|
-
}>;
|
|
136
|
-
/**
|
|
137
|
-
* Monitors a transaction until completion, handling speed-ups if needed
|
|
138
|
-
* @param request - Original transaction request (needed for speed-ups)
|
|
139
|
-
* @param initialTxHash - Hash of the initial transaction
|
|
140
|
-
* @param params - Parameters used in the initial transaction
|
|
141
|
-
* @param gasConfig - Optional gas configuration
|
|
142
|
-
*/
|
|
143
|
-
monitorTransaction(request: L1TxRequest, initialTxHash: Hex, params: {
|
|
144
|
-
gasLimit: bigint;
|
|
145
|
-
}, _gasConfig?: Partial<L1TxUtilsConfig> & {
|
|
146
|
-
txTimeoutAt?: Date;
|
|
147
|
-
}, _blobInputs?: L1BlobInputs, isCancelTx?: boolean): Promise<TransactionReceipt>;
|
|
148
|
-
/**
|
|
149
|
-
* Sends a transaction and monitors it until completion
|
|
150
|
-
* @param request - The transaction request (to, data, value)
|
|
151
|
-
* @param gasConfig - Optional gas configuration
|
|
152
|
-
* @returns The receipt of the successful transaction
|
|
153
|
-
*/
|
|
154
|
-
sendAndMonitorTransaction(request: L1TxRequest, gasConfig?: L1GasConfig, blobInputs?: L1BlobInputs): Promise<{
|
|
155
|
-
receipt: TransactionReceipt;
|
|
156
|
-
gasPrice: GasPrice;
|
|
157
|
-
}>;
|
|
158
|
-
/**
|
|
159
|
-
* Gets the current gas price with bounds checking
|
|
160
|
-
*/
|
|
161
|
-
getGasPrice(_gasConfig?: L1TxUtilsConfig, isBlobTx?: boolean, attempt?: number, previousGasPrice?: typeof attempt extends 0 ? never : GasPrice): Promise<GasPrice>;
|
|
162
|
-
/**
|
|
163
|
-
* Estimates gas and adds buffer
|
|
164
|
-
*/
|
|
165
|
-
estimateGas(account: Account | Hex, request: L1TxRequest, _gasConfig?: L1TxUtilsConfig, _blobInputs?: L1BlobInputs): Promise<bigint>;
|
|
166
|
-
getTransactionStats(txHash: string): Promise<TransactionStats | undefined>;
|
|
167
|
-
tryGetErrorFromRevertedTx(data: Hex, args: {
|
|
168
|
-
args: readonly any[];
|
|
169
|
-
functionName: string;
|
|
170
|
-
abi: Abi;
|
|
171
|
-
address: Hex;
|
|
172
|
-
}, blobInputs: (L1BlobInputs & {
|
|
173
|
-
maxFeePerBlobGas: bigint;
|
|
174
|
-
}) | undefined, stateOverride?: StateOverride): Promise<string | undefined>;
|
|
175
|
-
simulateGasUsed(request: L1TxRequest & {
|
|
176
|
-
gas?: bigint;
|
|
177
|
-
}, blockOverrides?: BlockOverrides<bigint, number>, stateOverrides?: StateOverride, _gasConfig?: L1TxUtilsConfig & {
|
|
178
|
-
fallbackGasEstimate?: bigint;
|
|
179
|
-
}): Promise<bigint>;
|
|
180
|
-
bumpGasLimit(gasLimit: bigint, _gasConfig?: L1TxUtilsConfig): bigint;
|
|
181
|
-
/**
|
|
182
|
-
* Attempts to cancel a transaction by sending a 0-value tx to self with same nonce but higher gas prices
|
|
183
|
-
* @param nonce - The nonce of the transaction to cancel
|
|
184
|
-
* @param previousGasPrice - The gas price of the previous transaction
|
|
185
|
-
* @param attempts - The number of attempts to cancel the transaction
|
|
186
|
-
* @returns The hash of the cancellation transaction
|
|
187
|
-
*/
|
|
188
|
-
protected attemptTxCancellation(nonce: number, isBlobTx?: boolean, previousGasPrice?: GasPrice, attempts?: number): Promise<`0x${string}`>;
|
|
189
|
-
}
|
|
190
|
-
export declare function tryGetCustomErrorNameContractFunction(err: ContractFunctionExecutionError): string;
|
|
191
|
-
export declare function getCalldataGasUsage(data: Uint8Array): number;
|
|
192
|
-
//# sourceMappingURL=l1_tx_utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"l1_tx_utils.d.ts","sourceRoot":"","sources":["../src/l1_tx_utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,OAAO,EAEZ,KAAK,cAAc,EACnB,KAAK,8BAA8B,EAEnC,KAAK,GAAG,EAGR,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAIxB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAuBrE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM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