tinybot-eth 0.3.0__tar.gz → 0.5.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.5.0}/PKG-INFO +11 -5
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/README.md +10 -4
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/pyproject.toml +1 -1
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/executor.py +9 -3
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot_eth.egg-info/PKG-INFO +11 -5
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/setup.cfg +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/__init__.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/bot.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/multicall.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/state.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/tg.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/types.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot/utils.py +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot_eth.egg-info/SOURCES.txt +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot_eth.egg-info/dependency_links.txt +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.0}/tinybot_eth.egg-info/requires.txt +0 -0
- {tinybot_eth-0.3.0 → tinybot_eth-0.5.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.5.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,21 @@ 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
|
|
181
|
+
wait=120, # default: 120 — seconds to wait for mining (0 = fire and forget)
|
|
180
182
|
)
|
|
181
183
|
```
|
|
182
184
|
|
|
183
185
|
- `executor.address` — signer address
|
|
184
186
|
- `executor.balance` — signer ETH balance in wei
|
|
185
|
-
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash
|
|
187
|
+
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash hex string
|
|
188
|
+
- `gas_limit=0` (default) — auto-estimates gas with 1.5x buffer; pass a value to override
|
|
189
|
+
- `max_fee_gwei` / `max_priority_fee_gwei` — accept floats (e.g. `0.1`)
|
|
190
|
+
- `simulate=True` (default) — runs `call.call()` first; reverts raise before the tx is sent
|
|
191
|
+
- `wait=120` (default) — wait up to N seconds for the tx to be mined; `0` for fire and forget
|
|
186
192
|
|
|
187
193
|
---
|
|
188
194
|
|
|
@@ -163,15 +163,21 @@ 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
|
|
170
|
+
wait=120, # default: 120 — seconds to wait for mining (0 = fire and forget)
|
|
169
171
|
)
|
|
170
172
|
```
|
|
171
173
|
|
|
172
174
|
- `executor.address` — signer address
|
|
173
175
|
- `executor.balance` — signer ETH balance in wei
|
|
174
|
-
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash
|
|
176
|
+
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash hex string
|
|
177
|
+
- `gas_limit=0` (default) — auto-estimates gas with 1.5x buffer; pass a value to override
|
|
178
|
+
- `max_fee_gwei` / `max_priority_fee_gwei` — accept floats (e.g. `0.1`)
|
|
179
|
+
- `simulate=True` (default) — runs `call.call()` first; reverts raise before the tx is sent
|
|
180
|
+
- `wait=120` (default) — wait up to N seconds for the tx to be mined; `0` for fire and forget
|
|
175
181
|
|
|
176
182
|
---
|
|
177
183
|
|
|
@@ -19,15 +19,19 @@ class Executor:
|
|
|
19
19
|
def execute(
|
|
20
20
|
self,
|
|
21
21
|
call,
|
|
22
|
-
gas_limit: int =
|
|
23
|
-
max_fee_gwei:
|
|
24
|
-
max_priority_fee_gwei:
|
|
22
|
+
gas_limit: int = 0,
|
|
23
|
+
max_fee_gwei: float = 100,
|
|
24
|
+
max_priority_fee_gwei: float = 0,
|
|
25
25
|
value: int = 0,
|
|
26
26
|
simulate: bool = True,
|
|
27
|
+
wait: int = 120,
|
|
27
28
|
) -> str:
|
|
28
29
|
if simulate:
|
|
29
30
|
call.call({"from": self._account.address, "value": value})
|
|
30
31
|
|
|
32
|
+
if gas_limit == 0:
|
|
33
|
+
gas_limit = int(call.estimate_gas({"from": self._account.address, "value": value}) * 1.5)
|
|
34
|
+
|
|
31
35
|
tx = call.build_transaction(
|
|
32
36
|
{
|
|
33
37
|
"from": self._account.address,
|
|
@@ -40,4 +44,6 @@ class Executor:
|
|
|
40
44
|
)
|
|
41
45
|
signed = self._w3.eth.account.sign_transaction(tx, self._account.key)
|
|
42
46
|
tx_hash = self._w3.eth.send_raw_transaction(signed.raw_transaction)
|
|
47
|
+
if wait > 0:
|
|
48
|
+
self._w3.eth.wait_for_transaction_receipt(tx_hash, timeout=wait)
|
|
43
49
|
return tx_hash.hex()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tinybot-eth
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.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,21 @@ 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
|
|
181
|
+
wait=120, # default: 120 — seconds to wait for mining (0 = fire and forget)
|
|
180
182
|
)
|
|
181
183
|
```
|
|
182
184
|
|
|
183
185
|
- `executor.address` — signer address
|
|
184
186
|
- `executor.balance` — signer ETH balance in wei
|
|
185
|
-
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash
|
|
187
|
+
- `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash hex string
|
|
188
|
+
- `gas_limit=0` (default) — auto-estimates gas with 1.5x buffer; pass a value to override
|
|
189
|
+
- `max_fee_gwei` / `max_priority_fee_gwei` — accept floats (e.g. `0.1`)
|
|
190
|
+
- `simulate=True` (default) — runs `call.call()` first; reverts raise before the tx is sent
|
|
191
|
+
- `wait=120` (default) — wait up to N seconds for the tx to be mined; `0` for fire and forget
|
|
186
192
|
|
|
187
193
|
---
|
|
188
194
|
|
|
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
|