yeref 0.24.15__py3-none-any.whl → 0.24.16__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.
yeref/yeref.py CHANGED
@@ -7612,7 +7612,7 @@ async def get_smc_info(address, KEYS_JSON, is_test_only=False):
7612
7612
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
7613
7613
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
7614
7614
  if provider == "tonapi":
7615
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
7615
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
7616
7616
  if key:
7617
7617
  items.append([
7618
7618
  'tonapi',
@@ -7706,7 +7706,7 @@ async def get_wallet_address(address, master, KEYS_JSON, is_test_only=False, is_
7706
7706
  for provider, keys in data["ton"].items():
7707
7707
  for it in keys:
7708
7708
  if provider == "tonapi":
7709
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
7709
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
7710
7710
  if key:
7711
7711
  items.append([
7712
7712
  'tonapi',
@@ -7816,7 +7816,7 @@ async def get_nft_data(address, KEYS_JSON, is_test_only=False, help_link=None):
7816
7816
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
7817
7817
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
7818
7818
  if provider == "tonapi":
7819
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
7819
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
7820
7820
  if key:
7821
7821
  items.append([
7822
7822
  'tonapi',
@@ -7987,7 +7987,7 @@ async def get_collection_data(address, KEYS_JSON, is_test_only=False):
7987
7987
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
7988
7988
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
7989
7989
  if provider == "tonapi":
7990
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
7990
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
7991
7991
  if key:
7992
7992
  items.append([
7993
7993
  'tonapi',
@@ -8115,7 +8115,7 @@ async def get_nft_in_account(address, collection, KEYS_JSON, is_test_only=False,
8115
8115
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
8116
8116
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
8117
8117
  if provider == "tonapi":
8118
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
8118
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
8119
8119
  if key:
8120
8120
  items.append([
8121
8121
  'tonapi',
@@ -8187,7 +8187,7 @@ async def get_any_activity(address, KEYS_JSON, is_test_only=False):
8187
8187
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
8188
8188
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
8189
8189
  if provider == "tonapi":
8190
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
8190
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
8191
8191
  if key:
8192
8192
  items.append([
8193
8193
  'tonapi',
@@ -8266,7 +8266,7 @@ async def get_any_nfts(address, KEYS_JSON, is_test_only=False):
8266
8266
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
8267
8267
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
8268
8268
  if provider == "tonapi":
8269
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
8269
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
8270
8270
  if key:
8271
8271
  items.append([
8272
8272
  'tonapi',
@@ -8344,7 +8344,7 @@ async def get_any_jettons(address, KEYS_JSON, is_test_only=False):
8344
8344
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
8345
8345
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
8346
8346
  if provider == "tonapi":
8347
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
8347
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
8348
8348
  if key:
8349
8349
  items.append([
8350
8350
  'tonapi',
@@ -8432,17 +8432,18 @@ async def calculate_wallet_address(owner, master, KEYS_JSON, is_test_only=False)
8432
8432
  items = []
8433
8433
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
8434
8434
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
8435
- if provider == "tonapi": continue
8436
- # key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
8437
- # if key:
8438
- # items.append([
8439
- # 'tonapi',
8440
- # f'https://{pfx_testnet}tonapi.io/v2/accounts/{owner}/jettons/{master}',
8441
- # {
8442
- # 'accept': 'application/json',
8443
- # 'Authorization': f'Bearer {key}'
8444
- # }
8445
- # ])
8435
+ if provider == "tonapi": # continue
8436
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
8437
+
8438
+ if key:
8439
+ items.append([
8440
+ 'tonapi',
8441
+ f'https://{pfx_testnet}tonapi.io/v2/accounts/{owner}/jettons/{master}',
8442
+ {
8443
+ 'accept': 'application/json',
8444
+ 'Authorization': f'Bearer {key}'
8445
+ }
8446
+ ])
8446
8447
  elif provider == "toncenter":
8447
8448
  key = next((it['testnet'] if is_test_only else it['mainnet'] for it in keys if (is_test_only and 'testnet' in it) or (not is_test_only and 'mainnet' in it)), None)
8448
8449
  if key:
@@ -8507,7 +8508,7 @@ async def get_method_data(address, KEYS_JSON, is_test_only=False, method_name='g
8507
8508
  for provider, keys in data["ton"].items(): # provider = "tonapi" или "toncenter"
8508
8509
  for it in keys: # it = {"all": "..."} или {"testnet": "..."}
8509
8510
  if provider == "tonapi":
8510
- key = it.get('testnet') if is_test_only and 'testnet' in it else it.get('all')
8511
+ key = random.choice([it['all'] for it in keys if 'all' in it]) if keys else None
8511
8512
  if key:
8512
8513
  items.append([
8513
8514
  'tonapi',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.24.15
3
+ Version: 0.24.16
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
@@ -0,0 +1,8 @@
1
+ yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
+ yeref/l_.py,sha256=7SgEs9hcn0b-AKW3BeE6DTY1Mo-ZtNCTPAKVv7RE5PM,1178681
3
+ yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
+ yeref/yeref.py,sha256=i2U5z5pJgEIJwKRSaJH_a1lmoikTJAxv9rgexIKEoD0,1012332
5
+ yeref-0.24.16.dist-info/METADATA,sha256=kJ8wAuW9LQe5g9caVrsus_UV-3esh-M91JpyJqPkd8I,119
6
+ yeref-0.24.16.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
7
+ yeref-0.24.16.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
+ yeref-0.24.16.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
- yeref/l_.py,sha256=7SgEs9hcn0b-AKW3BeE6DTY1Mo-ZtNCTPAKVv7RE5PM,1178681
3
- yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
- yeref/yeref.py,sha256=1rpCFJhTKNSfjDd8jCwuSvvbiOK1dZ94IRZEZ4Vcr8k,1012306
5
- yeref-0.24.15.dist-info/METADATA,sha256=DKy1eBT51Eb0B4_L0NBqkdj6E1htYCqLAHMITm5mIEI,119
6
- yeref-0.24.15.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
7
- yeref-0.24.15.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
- yeref-0.24.15.dist-info/RECORD,,