tinybot-eth 0.3.0__tar.gz → 0.4.0__tar.gz
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.
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/PKG-INFO +7 -4
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/README.md +6 -3
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/pyproject.toml +1 -1
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/executor.py +5 -2
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot_eth.egg-info/PKG-INFO +7 -4
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/setup.cfg +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/__init__.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/bot.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/multicall.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/state.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/tg.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/types.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot/utils.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot_eth.egg-info/SOURCES.txt +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot_eth.egg-info/dependency_links.txt +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot_eth.egg-info/requires.txt +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.4.0}/tinybot_eth.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tinybot-eth
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Minimal Python framework for building crypto bots
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -174,15 +174,18 @@ bot = TinyBot(rpc_url, name="my bot", private_key=os.environ["PRIVATE_KEY"])
|
|
|
174
174
|
|
|
175
175
|
tx_hash = bot.executor.execute(
|
|
176
176
|
contract.functions.tend(strategy_addr),
|
|
177
|
-
gas_limit=
|
|
178
|
-
max_fee_gwei=100,
|
|
179
|
-
max_priority_fee_gwei=
|
|
177
|
+
gas_limit=0, # default: 0 — auto-estimates with 1.5x buffer
|
|
178
|
+
max_fee_gwei=100, # default: 100
|
|
179
|
+
max_priority_fee_gwei=0, # default: 0
|
|
180
|
+
simulate=True, # default: True — dry-run via eth_call before sending
|
|
180
181
|
)
|
|
181
182
|
```
|
|
182
183
|
|
|
183
184
|
- `executor.address` — signer address
|
|
184
185
|
- `executor.balance` — signer ETH balance in wei
|
|
185
186
|
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash immediately (fire and forget)
|
|
187
|
+
- `gas_limit=0` (default) — auto-estimates gas with 1.5x buffer; pass a value to override
|
|
188
|
+
- `simulate=True` (default) — runs `call.call()` first; reverts raise before the tx is sent
|
|
186
189
|
|
|
187
190
|
---
|
|
188
191
|
|
|
@@ -163,15 +163,18 @@ bot = TinyBot(rpc_url, name="my bot", private_key=os.environ["PRIVATE_KEY"])
|
|
|
163
163
|
|
|
164
164
|
tx_hash = bot.executor.execute(
|
|
165
165
|
contract.functions.tend(strategy_addr),
|
|
166
|
-
gas_limit=
|
|
167
|
-
max_fee_gwei=100,
|
|
168
|
-
max_priority_fee_gwei=
|
|
166
|
+
gas_limit=0, # default: 0 — auto-estimates with 1.5x buffer
|
|
167
|
+
max_fee_gwei=100, # default: 100
|
|
168
|
+
max_priority_fee_gwei=0, # default: 0
|
|
169
|
+
simulate=True, # default: True — dry-run via eth_call before sending
|
|
169
170
|
)
|
|
170
171
|
```
|
|
171
172
|
|
|
172
173
|
- `executor.address` — signer address
|
|
173
174
|
- `executor.balance` — signer ETH balance in wei
|
|
174
175
|
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash immediately (fire and forget)
|
|
176
|
+
- `gas_limit=0` (default) — auto-estimates gas with 1.5x buffer; pass a value to override
|
|
177
|
+
- `simulate=True` (default) — runs `call.call()` first; reverts raise before the tx is sent
|
|
175
178
|
|
|
176
179
|
---
|
|
177
180
|
|
|
@@ -19,15 +19,18 @@ class Executor:
|
|
|
19
19
|
def execute(
|
|
20
20
|
self,
|
|
21
21
|
call,
|
|
22
|
-
gas_limit: int =
|
|
22
|
+
gas_limit: int = 0,
|
|
23
23
|
max_fee_gwei: int = 100,
|
|
24
|
-
max_priority_fee_gwei: int =
|
|
24
|
+
max_priority_fee_gwei: int = 0,
|
|
25
25
|
value: int = 0,
|
|
26
26
|
simulate: bool = True,
|
|
27
27
|
) -> str:
|
|
28
28
|
if simulate:
|
|
29
29
|
call.call({"from": self._account.address, "value": value})
|
|
30
30
|
|
|
31
|
+
if gas_limit == 0:
|
|
32
|
+
gas_limit = int(call.estimate_gas({"from": self._account.address, "value": value}) * 1.5)
|
|
33
|
+
|
|
31
34
|
tx = call.build_transaction(
|
|
32
35
|
{
|
|
33
36
|
"from": self._account.address,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tinybot-eth
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Minimal Python framework for building crypto bots
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -174,15 +174,18 @@ bot = TinyBot(rpc_url, name="my bot", private_key=os.environ["PRIVATE_KEY"])
|
|
|
174
174
|
|
|
175
175
|
tx_hash = bot.executor.execute(
|
|
176
176
|
contract.functions.tend(strategy_addr),
|
|
177
|
-
gas_limit=
|
|
178
|
-
max_fee_gwei=100,
|
|
179
|
-
max_priority_fee_gwei=
|
|
177
|
+
gas_limit=0, # default: 0 — auto-estimates with 1.5x buffer
|
|
178
|
+
max_fee_gwei=100, # default: 100
|
|
179
|
+
max_priority_fee_gwei=0, # default: 0
|
|
180
|
+
simulate=True, # default: True — dry-run via eth_call before sending
|
|
180
181
|
)
|
|
181
182
|
```
|
|
182
183
|
|
|
183
184
|
- `executor.address` — signer address
|
|
184
185
|
- `executor.balance` — signer ETH balance in wei
|
|
185
186
|
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash immediately (fire and forget)
|
|
187
|
+
- `gas_limit=0` (default) — auto-estimates gas with 1.5x buffer; pass a value to override
|
|
188
|
+
- `simulate=True` (default) — runs `call.call()` first; reverts raise before the tx is sent
|
|
186
189
|
|
|
187
190
|
---
|
|
188
191
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|