mm-eth 0.5.0__py3-none-any.whl → 0.5.1__py3-none-any.whl

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.
@@ -31,7 +31,7 @@ class Config(BaseConfig):
31
31
  max_fee: Annotated[str, AfterValidator(Validators.valid_eth_expression("base_fee"))]
32
32
  priority_fee: Annotated[str, AfterValidator(Validators.valid_eth_expression())]
33
33
  max_fee_limit: Annotated[str | None, AfterValidator(Validators.valid_eth_expression())] = None
34
- value: Annotated[str, AfterValidator(Validators.valid_eth_or_token_expression("balance"))]
34
+ default_value: Annotated[str | None, AfterValidator(Validators.valid_eth_or_token_expression("balance"))] = None
35
35
  value_min_limit: Annotated[str | None, AfterValidator(Validators.valid_eth_or_token_expression())] = None
36
36
  gas: Annotated[str, AfterValidator(Validators.valid_eth_expression("estimate"))]
37
37
  delay: Annotated[str | None, AfterValidator(Validators.valid_calc_decimal_value())] = None # in seconds
@@ -51,18 +51,20 @@ class Config(BaseConfig):
51
51
  raise ValueError("private keys are not set for all addresses")
52
52
 
53
53
  for transfer in self.transfers: # If value is not set for a transfer, then set it to the global value of the config.
54
- if not transfer.value:
55
- transfer.value = self.value
54
+ if not transfer.value and self.default_value:
55
+ transfer.value = self.default_value
56
56
  for transfer in self.transfers: # Check all transfers have a value.
57
57
  if not transfer.value:
58
58
  raise ValueError(f"{transfer.log_prefix}: value is not set")
59
59
 
60
60
  if self.token:
61
- Validators.valid_token_expression("balance")(self.value)
61
+ if self.default_value:
62
+ Validators.valid_token_expression("balance")(self.default_value)
62
63
  if self.value_min_limit:
63
64
  Validators.valid_token_expression()(self.value_min_limit)
64
65
  else:
65
- Validators.valid_eth_expression("balance")(self.value)
66
+ if self.default_value:
67
+ Validators.valid_eth_expression("balance")(self.default_value)
66
68
  if self.value_min_limit:
67
69
  Validators.valid_eth_expression()(self.value_min_limit)
68
70
 
@@ -1,8 +1,10 @@
1
+ # from_address to_address value -- is a format for each transfer, value is optional
2
+ # if value is not set, default_value will be used
3
+ # value is an expression that can contain variable 'balance' and 'random' function
1
4
  transfers = """
2
- # from_address to_address value
3
5
  0x10fd602Bff689e64D4720D1DCCCD3494f1f16623 0x58487485c3858109f5A37e42546FE87473f79a4b 0.1t # comments are allowed here
4
6
  0x97C77B548aE0d4925F5C201220fC6d8996424309 0x7EdF3b8579c21A8820b4C0B8352541c1CE04045f 0.2balance-random(0.1t,0.5t)
5
- 0x10ecB8d838746643E613f6B5218C8e342593225c 0xE19242B72a4833eD86F1b2015d4E59052A2b278b # if the value is not set, config.value will be used
7
+ 0x10ecB8d838746643E613f6B5218C8e342593225c 0xE19242B72a4833eD86F1b2015d4E59052A2b278b
6
8
  file: /path/to/other_transfers.txt # transfers from this file will be added
7
9
  """
8
10
 
@@ -22,9 +24,10 @@ priority_fee = "1gwei+random(1,12)"
22
24
 
23
25
  gas = "estimate+random(100,200)-19" # supported var_name=estimate
24
26
 
25
- value = "0.5balance-random(1.5t,3t)+11t" # supported var_name=balance. For ERC20 token use 't' suffix.
27
+ # default_value is used if transfer.value is not set in transfers. It's optional.
28
+ default_value = "0.5balance-random(1.5t,3t)+11t" # supported var_name=balance. For ERC20 token use 't' suffix.
26
29
 
27
- value_min_limit = "0.5t+random(1,2)-7"
30
+ value_min_limit = "0.5t+random(1,2)-7" # don't transfer if transfer.value is less than this
28
31
 
29
32
  delay = "random(1.123,10)+1" # secs, optional
30
33
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-eth
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: mm-crypto-utils>=0.2.3
6
6
  Requires-Dist: typer>=0.15.1
@@ -32,7 +32,7 @@ mm_eth/cli/cmd/node_cmd.py,sha256=Ae5yPxxnNiHw3tZcojS7KwNLM4gEfLhsTfhZp_86rqU,19
32
32
  mm_eth/cli/cmd/rpc_cmd.py,sha256=02q82YqgbPezfEBmV_QBCIeNReE7ktkPych8Xr9ann8,2186
33
33
  mm_eth/cli/cmd/solc_cmd.py,sha256=tBpeMdPfGs2iQIMaIJAAhMh1a3KyXHwyninfXPVpsgs,677
34
34
  mm_eth/cli/cmd/token_cmd.py,sha256=4y6ZQpLOJ33_iNuKpm9tZXh4RntWhmPUcizgaNNBzaw,1102
35
- mm_eth/cli/cmd/transfer_cmd.py,sha256=r8mZK9WyqXdR-Ce7Xb4hhOOHEKaJhPfbmYigC_4HzqU,13151
35
+ mm_eth/cli/cmd/transfer_cmd.py,sha256=5Twb94GSZ0NiOj1PgY_1TdIHDoGN3Eq6qACelnCQPWQ,13298
36
36
  mm_eth/cli/cmd/tx_cmd.py,sha256=PIenXYTT60Z2fqsivpzybCLI2Z_tlcz-asm3B0JLHgI,517
37
37
  mm_eth/cli/cmd/vault_cmd.py,sha256=MOM1CILIaaqown1I-Fgo22ckqIMLtFt8t2D3fWNp798,606
38
38
  mm_eth/cli/cmd/wallet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -40,8 +40,8 @@ mm_eth/cli/cmd/wallet/mnemonic_cmd.py,sha256=xE-5Ux9BdYsTZYBy0dMn9jupGhW4ced-AgY
40
40
  mm_eth/cli/cmd/wallet/private_key_cmd.py,sha256=Fv_2OLog1h32pIP7PJITwl_pHdy3BXvaDRcXZsxY1xo,241
41
41
  mm_eth/cli/examples/balances.toml,sha256=i_ALpiEcf8-0TFiUg1cgJhxxfHYeBl9x0b3tnUWjswU,421
42
42
  mm_eth/cli/examples/call_contract.toml,sha256=ZQWK-409V_vLIZ2bsRD5RCWPPzShPz2KJTTRQY4YaGw,248
43
- mm_eth/cli/examples/transfer.toml,sha256=OKpojNWV2DQ68hX8jQ84cAMevKmBt-l20ij3ROTO9G0,1463
44
- mm_eth-0.5.0.dist-info/METADATA,sha256=5vJwdr_CVo2u2CDobOUKNK2pnQi1sDksc2qQd9XBNaE,207
45
- mm_eth-0.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
- mm_eth-0.5.0.dist-info/entry_points.txt,sha256=aGhpsozl8NIrkuUcX5fSgURCcDhr3ShUdeTSIrJq4oc,46
47
- mm_eth-0.5.0.dist-info/RECORD,,
43
+ mm_eth/cli/examples/transfer.toml,sha256=jyfrLlVL3xxf_pWShkMT0N_N8MnLD36DbIcfU2G4-Yw,1738
44
+ mm_eth-0.5.1.dist-info/METADATA,sha256=zUVIU7_MwpgSao4s9BZrATHtaQqouhOL4m4vo5DLiNI,207
45
+ mm_eth-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
+ mm_eth-0.5.1.dist-info/entry_points.txt,sha256=aGhpsozl8NIrkuUcX5fSgURCcDhr3ShUdeTSIrJq4oc,46
47
+ mm_eth-0.5.1.dist-info/RECORD,,
File without changes