tinybot-eth 0.4.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tinybot-eth
3
- Version: 0.4.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
@@ -178,14 +178,17 @@ tx_hash = bot.executor.execute(
178
178
  max_fee_gwei=100, # default: 100
179
179
  max_priority_fee_gwei=0, # default: 0
180
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)
181
182
  )
182
183
  ```
183
184
 
184
185
  - `executor.address` — signer address
185
186
  - `executor.balance` — signer ETH balance in wei
186
- - `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash immediately (fire and forget)
187
+ - `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash hex string
187
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`)
188
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
189
192
 
190
193
  ---
191
194
 
@@ -167,14 +167,17 @@ tx_hash = bot.executor.execute(
167
167
  max_fee_gwei=100, # default: 100
168
168
  max_priority_fee_gwei=0, # default: 0
169
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)
170
171
  )
171
172
  ```
172
173
 
173
174
  - `executor.address` — signer address
174
175
  - `executor.balance` — signer ETH balance in wei
175
- - `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash immediately (fire and forget)
176
+ - `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash hex string
176
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`)
177
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
178
181
 
179
182
  ---
180
183
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tinybot-eth"
3
- version = "0.4.0"
3
+ version = "0.5.0"
4
4
  description = "Minimal Python framework for building crypto bots"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -20,10 +20,11 @@ class Executor:
20
20
  self,
21
21
  call,
22
22
  gas_limit: int = 0,
23
- max_fee_gwei: int = 100,
24
- max_priority_fee_gwei: 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})
@@ -43,4 +44,6 @@ class Executor:
43
44
  )
44
45
  signed = self._w3.eth.account.sign_transaction(tx, self._account.key)
45
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)
46
49
  return tx_hash.hex()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tinybot-eth
3
- Version: 0.4.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
@@ -178,14 +178,17 @@ tx_hash = bot.executor.execute(
178
178
  max_fee_gwei=100, # default: 100
179
179
  max_priority_fee_gwei=0, # default: 0
180
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)
181
182
  )
182
183
  ```
183
184
 
184
185
  - `executor.address` — signer address
185
186
  - `executor.balance` — signer ETH balance in wei
186
- - `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash immediately (fire and forget)
187
+ - `executor.execute(call, ...)` — sign and broadcast a transaction, returns tx hash hex string
187
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`)
188
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
189
192
 
190
193
  ---
191
194
 
File without changes
File without changes
File without changes