abstract-solana 0.0.1.2__py3-none-any.whl → 0.0.1.4__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.
Potentially problematic release.
This version of abstract-solana might be problematic. Click here for more details.
- abstract_solana/abstract_rpcs/__init__.py +2 -0
- abstract_solana/abstract_rpcs/get_api_gui.py +217 -0
- abstract_solana/abstract_rpcs/get_body.py +8 -7
- abstract_solana/abstract_rpcs/solana_rpc_client.py +76 -0
- {abstract_solana-0.0.1.2.dist-info → abstract_solana-0.0.1.4.dist-info}/METADATA +1 -1
- {abstract_solana-0.0.1.2.dist-info → abstract_solana-0.0.1.4.dist-info}/RECORD +8 -6
- {abstract_solana-0.0.1.2.dist-info → abstract_solana-0.0.1.4.dist-info}/WHEEL +0 -0
- {abstract_solana-0.0.1.2.dist-info → abstract_solana-0.0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import PySimpleGUI as sg
|
|
2
|
+
from .body_get import Client
|
|
3
|
+
from abstract_gui import *
|
|
4
|
+
import inspect
|
|
5
|
+
|
|
6
|
+
# Example of getting the expected args dynamically from a function
|
|
7
|
+
def get_dict_from_vars(values, function):
|
|
8
|
+
# Get the signature of the function
|
|
9
|
+
sig = inspect.signature(function)
|
|
10
|
+
|
|
11
|
+
# Filter out the values that match the expected function parameters
|
|
12
|
+
filtered_values = {key: values[key] for key in sig.parameters if key in values}
|
|
13
|
+
|
|
14
|
+
return filtered_values
|
|
15
|
+
client = Client()
|
|
16
|
+
def get_sample_var(var):
|
|
17
|
+
signatures = ["5EzaJ7GrBUqT9gAGqNR1vNcduhpgc5agiLXWMW9hcmo4Lzbyqy66VFqa26uY81BkqWLtrpWr4NqkKvfRL5qzAfAt","2LLrwwzk3E8yb7JPwp8E15ZvYwnKHVHs1K9CNs6rzDiDUsCCU6U15UjAfMijur2bVK7Q7tvMC6p1J1xe3xjx8Gnn"]
|
|
18
|
+
pubkey = "BJ8aUaWmAbbUdFFYhFbmhNPrH4NncWj7ACZD5E4bpump"
|
|
19
|
+
mint = "HpfiQovafVvvKPgFMbYhbrY2LX9GeuTTR4saN25Xpump"
|
|
20
|
+
account="GBzQG2iFrPwXjGtCnwNt9S5eHd8xAR8jUMt3QDJpnjud"
|
|
21
|
+
delegate="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
22
|
+
signer = "HMU77m6WSL9Xew9YvVCgz1hLuhzamz74eD9avi4XPdr"
|
|
23
|
+
slot = 287731841
|
|
24
|
+
owner = "AfQ1oaudsGjvznX4JNEw671hi57JfWo4CWqhtkdgoVHU"
|
|
25
|
+
return {
|
|
26
|
+
'tx':"01b3795ccfaac3eee838bb05c3b8284122c18acedcd645c914fe8e178c3b62640d8616d061cc818b26cab8ecf3855ecc",
|
|
27
|
+
'mint':mint,
|
|
28
|
+
'pubkeys': [pubkey, pubkey],
|
|
29
|
+
'limit': 100,
|
|
30
|
+
'recent_blockhash': "HZ5VGgojr2ZS3sFc7QUaiLGdzLmEGP7nHu5ZRhhoFjg4",
|
|
31
|
+
'pubkey': pubkey,
|
|
32
|
+
'start_slot': 287731841,
|
|
33
|
+
'filters': [{'dataSize': 165}],
|
|
34
|
+
'sig_verify': True,
|
|
35
|
+
'Transaction': None, # Placeholder if not using a specific transaction object yet
|
|
36
|
+
'commitment': 'confirmed',
|
|
37
|
+
'until': None, # Can be user-input for upper range of transaction signature
|
|
38
|
+
'before': None, # Can be user-input for lower range of transaction signature
|
|
39
|
+
'*signers': [], # List of required signers
|
|
40
|
+
'delegate': delegate,
|
|
41
|
+
'opts': {'skipPreflight': True, 'preflightCommitment': 'confirmed'},
|
|
42
|
+
'message': None, # Message to be signed, if applicable
|
|
43
|
+
'sleep_seconds': 2,
|
|
44
|
+
'epoch': None, # Epoch can be retrieved or user-specified
|
|
45
|
+
'lamports': 0, # Number of lamports for sending transactions
|
|
46
|
+
'VersionedTransaction': None, # Placeholder if using versioned transactions
|
|
47
|
+
'signature': signatures[0],
|
|
48
|
+
'search_transaction_history': True,
|
|
49
|
+
'last_valid_block_height': 5000000,
|
|
50
|
+
'txn': None, # Placeholder for raw transaction data
|
|
51
|
+
'filter_opt': {'mint': mint}, # Optional filter for mint
|
|
52
|
+
'tx_sig': signatures[0],
|
|
53
|
+
'encoding': "jsonParsed",
|
|
54
|
+
'end_slot': slot,
|
|
55
|
+
'account': account,
|
|
56
|
+
'usize': 1024,
|
|
57
|
+
'conf_comm': None, # Placeholder for confirmation commitment
|
|
58
|
+
'data_slice': {'offset': 0, 'bytes': 'base58_encoded_value'},
|
|
59
|
+
'max_supported_transaction_version': 0,
|
|
60
|
+
'owner': owner,
|
|
61
|
+
'types.MemcmpOpts': 0,#{'offset': 0, 'bytes': 'base58_encoded_value'},
|
|
62
|
+
'before': None,
|
|
63
|
+
'signatures': [signatures[0], signatures[1]],
|
|
64
|
+
'slot': slot,
|
|
65
|
+
'signers':[signer,signer],
|
|
66
|
+
'signer':signer,
|
|
67
|
+
"preflight_commitment":True,
|
|
68
|
+
}.get(var)
|
|
69
|
+
def convert_to_lower(strings):
|
|
70
|
+
nustring = ''
|
|
71
|
+
for char in str(strings):
|
|
72
|
+
if char in list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
|
|
73
|
+
char = f"_{char.lower()}"
|
|
74
|
+
nustring+=char
|
|
75
|
+
return nustring
|
|
76
|
+
def get_cal_function(strings):
|
|
77
|
+
return ''.join([f"{string[1][0].upper()}{string[1][1:].lower()}" if string[1] and string[0] > 0 else string[1] for string in enumerate(strings.split('_'))])
|
|
78
|
+
def get_functions_js():
|
|
79
|
+
return {'get_balance': ['pubkey', 'commitment'], 'get_account_info': ['pubkey', 'commitment', 'encoding', 'data_slice'], 'get_account_info_json_parsed': ['pubkey', 'commitment'], 'get_block_commitment': ['slot'], 'get_block_time': ['slot'], 'get_cluster_nodes': [], 'get_block': ['slot', 'encoding', 'max_supported_transaction_version', 'None'], 'get_recent_performance_samples': ['limit'], 'get_block_height': ['commitment'], 'get_blocks': ['start_slot', 'end_slot'], 'get_signatures_for_address': ['account', 'before', 'until', 'limit', 'commitment'], 'get_transaction': ['signature', 'encoding', 'commitment', 'max_supported_transaction_version'], 'get_epoch_info': ['commitment'], 'get_epoch_schedule': [], 'get_fee_for_message': ['message', 'commitment'], 'get_first_available_block': [], 'get_genesis_hash': [], 'get_identity': [], 'get_inflation_governor': ['commitment'], 'get_inflation_rate': [], 'get_inflation_reward': ['pubkeys', 'epoch', 'commitment'], 'get_largest_accounts': ['filter_opt', 'commitment'], 'get_leader_schedule': ['epoch', 'commitment'], 'get_minimum_balance_for_rent_exemption': ['usize', 'commitment'], 'get_multiple_accounts': ['pubkeys', 'commitment', 'encoding', 'data_slice'], 'get_multiple_accounts_json_parsed': ['pubkeys', 'commitment'], 'get_program_accounts': ['pubkey', 'commitment', 'encoding', 'data_slice', 'filters', 'types.MemcmpOpts'], 'get_program_accounts_json_parsed': ['pubkey', 'commitment', 'filters', 'types.MemcmpOpts'], 'get_latest_blockhash': ['commitment'], 'get_signature_statuses': ['signatures', 'search_transaction_history'], 'get_slot': ['commitment'], 'get_slot_leader': ['commitment'], 'get_stake_activation': ['pubkey', 'epoch', 'commitment'], 'get_supply': ['commitment'], 'get_token_account_balance': ['pubkey', 'commitment'], 'get_token_accounts_by_delegate': ['delegate', 'opts', 'commitment'], 'get_token_accounts_by_delegate_json_parsed': ['delegate', 'opts', 'commitment'], 'get_token_accounts_by_owner': ['owner', 'opts', 'commitment'], 'get_token_accounts_by_owner_json_parsed': ['owner', 'opts', 'commitment'], 'get_token_largest_accounts': ['pubkey', 'commitment'], 'get_token_supply': ['pubkey', 'commitment'], 'get_transaction_count': ['commitment'], 'get_minimum_ledger_slot': [], 'get_version': [], 'get_vote_accounts': ['commitment'], 'request_airdrop': ['pubkey', 'lamports', 'commitment'], 'send_raw_transaction': ['txn', 'opts'], 'send_transaction': ['txn', 'Transaction', '*signers', 'opts', 'recent_blockhash'], 'simulate_transaction': ['txn', 'VersionedTransaction', 'sig_verify', 'commitment'], 'validator_exit': [], '__post_send_with_confirm': ['resp', 'conf_comm', 'last_valid_block_height'], 'confirm_transaction': ['tx_sig', 'commitment', 'sleep_seconds', 'last_valid_block_height']}
|
|
80
|
+
def get_functions_list():
|
|
81
|
+
return list(get_functions_js().keys())
|
|
82
|
+
def get_list_vars():
|
|
83
|
+
return list(get_functions_js().values())
|
|
84
|
+
def get_all_vars():
|
|
85
|
+
total_ls = []
|
|
86
|
+
for obj in get_list_vars():
|
|
87
|
+
total_ls+=obj
|
|
88
|
+
return total_ls
|
|
89
|
+
|
|
90
|
+
def get_vars(function):
|
|
91
|
+
return get_functions_js().get(function)
|
|
92
|
+
|
|
93
|
+
def get_longest(list_obj):
|
|
94
|
+
list_obj = [len(string) for string in list_obj]
|
|
95
|
+
list_obj.sort()
|
|
96
|
+
return list_obj[-1]
|
|
97
|
+
|
|
98
|
+
def get_var_inputs():
|
|
99
|
+
inputs=[]
|
|
100
|
+
for i in range(get_longest(get_list_vars())):
|
|
101
|
+
inputs.append([make_component('Input','',size=(get_longest(get_all_vars()),1),key=f'var_{i}'),make_component('Input','',size=(get_longest(get_all_vars()),1),key=f'input_{i}')])
|
|
102
|
+
return [inputs]
|
|
103
|
+
def clear_inputs(window):
|
|
104
|
+
for i in range(get_longest(get_list_vars())):
|
|
105
|
+
print(i)
|
|
106
|
+
window[f'var_{i}'].update(value='')
|
|
107
|
+
window[f'input_{i}'].update(value='')
|
|
108
|
+
def get_dict_from_vars(values, function):
|
|
109
|
+
# Get the signature of the function
|
|
110
|
+
sig = inspect.signature(function)
|
|
111
|
+
# Filter out the values that match the expected function parameters
|
|
112
|
+
filtered_values = {key: get_sample_var(key) for key in list(sig.parameters.keys()) if key in values}
|
|
113
|
+
|
|
114
|
+
return filtered_values
|
|
115
|
+
def get_result(function,values):
|
|
116
|
+
try:
|
|
117
|
+
result = function(**values)
|
|
118
|
+
except:
|
|
119
|
+
result = {}
|
|
120
|
+
return result
|
|
121
|
+
def get_function(lowered):
|
|
122
|
+
try:
|
|
123
|
+
function = getattr(client, lowered)
|
|
124
|
+
except:
|
|
125
|
+
function =None
|
|
126
|
+
return function
|
|
127
|
+
def second_window():
|
|
128
|
+
sg.theme('DarkGrey14')
|
|
129
|
+
menu_def = [['&File', ['&Open Ctrl-O', '&Save Ctrl-S', '&Properties', 'E&xit']],
|
|
130
|
+
['&Edit', ['&Paste', ['Special', 'Normal', ], 'Undo', 'Options::this_is_a_menu_key'], ],
|
|
131
|
+
['&Toolbar', ['---', 'Command &1', 'Command &2','---', 'Command &3', 'Command &4']],
|
|
132
|
+
['&NetworkTools', ['---','RPC',['Add RPC', 'Choose RPC','get Manual RPC'], 'Choose RPC &2','---', 'Command &3', 'Command &4']],
|
|
133
|
+
['APIs',['chainScan'],
|
|
134
|
+
['&Help', ['&About...']]]]
|
|
135
|
+
right_click_menu = ['Unused', ['Right', '!&Click', '&Menu', 'E&xit', 'Properties']]
|
|
136
|
+
layout = [[sg.Menu(menu_def, tearoff=True, font='_ 12', key='-MENUBAR-')],
|
|
137
|
+
[sg.Text('Right click me for a right click menu example')],
|
|
138
|
+
[sg.ButtonMenu('ButtonMenu', right_click_menu, key='-BMENU-', text_color='red', disabled_text_color='green'),
|
|
139
|
+
sg.Button('Plain Button')],
|
|
140
|
+
make_component('Frame','url',[[sg.Input('https://solcatcher.io', size=(40, 1), key='url')]]),
|
|
141
|
+
make_component('combo', get_functions_list(), size=(get_longest(get_functions_list()), 1), key='body_functions',enable_events=True),
|
|
142
|
+
make_component('combo', [get_cal_function(string) for string in get_functions_list()],
|
|
143
|
+
size=(get_longest(get_functions_list()), 1), key='call_functions',enable_events=True)],get_var_inputs(),[sg.Multiline(size=(88, 20), font='Courier 10', key='output')]
|
|
144
|
+
results={}
|
|
145
|
+
for lowered in get_functions_list():
|
|
146
|
+
|
|
147
|
+
if lowered:
|
|
148
|
+
function = get_function(lowered)
|
|
149
|
+
if function:
|
|
150
|
+
sig = inspect.signature(function)
|
|
151
|
+
dictsa = {}
|
|
152
|
+
revsa = {}
|
|
153
|
+
for i,var in enumerate(list(sig.parameters.keys())):
|
|
154
|
+
dictsa[var]=get_sample_var(var)
|
|
155
|
+
revsa[get_sample_var(var)]:var
|
|
156
|
+
# Get function by its name dynamically
|
|
157
|
+
|
|
158
|
+
try:
|
|
159
|
+
print(revsa)
|
|
160
|
+
# Pass filtered arguments
|
|
161
|
+
result = get_result(function,dictsa)
|
|
162
|
+
params =result.get('params',[])
|
|
163
|
+
|
|
164
|
+
for i,param in enumerate(params):
|
|
165
|
+
if isinstance(param,dict):
|
|
166
|
+
for key,value in param.items():
|
|
167
|
+
param[key]=key
|
|
168
|
+
params[i]= param
|
|
169
|
+
else:
|
|
170
|
+
for key,value in dictsa.items():
|
|
171
|
+
if value == param:
|
|
172
|
+
param = key
|
|
173
|
+
params[i] = key
|
|
174
|
+
break
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
print(params)
|
|
179
|
+
except TypeError as e:
|
|
180
|
+
print(f"Error calling function: {e}")
|
|
181
|
+
result = {}
|
|
182
|
+
results[lowered] = result
|
|
183
|
+
print(results)
|
|
184
|
+
window = sg.Window('Script launcher', layout)
|
|
185
|
+
results = {}
|
|
186
|
+
while True:
|
|
187
|
+
event, values = window.read()
|
|
188
|
+
if event == 'EXIT' or event == sg.WIN_CLOSED:
|
|
189
|
+
break # exit button clicked
|
|
190
|
+
if event in ['body_functions', 'call_functions']:
|
|
191
|
+
clear_inputs(window)
|
|
192
|
+
lowered = convert_to_lower(values['body_functions'])
|
|
193
|
+
window['body_functions'].update(value=lowered)
|
|
194
|
+
window['call_functions'].update(value=get_sample_var(lowered))
|
|
195
|
+
if lowered:
|
|
196
|
+
function = getattr(client, lowered)
|
|
197
|
+
sig = inspect.signature(function)
|
|
198
|
+
dictsa = {}
|
|
199
|
+
for i,var in enumerate(list(sig.parameters.keys())):
|
|
200
|
+
window[f'var_{i}'].update(value=var)
|
|
201
|
+
window[f'input_{i}'].update(value=get_sample_var(var))
|
|
202
|
+
dictsa[var]=get_sample_var(var)
|
|
203
|
+
# Get function by its name dynamically
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
try:
|
|
207
|
+
filtered_values = get_dict_from_vars(values, function)
|
|
208
|
+
print(filtered_values)
|
|
209
|
+
# Pass filtered arguments
|
|
210
|
+
result = get_result(function,dictsa)
|
|
211
|
+
print(result)
|
|
212
|
+
except TypeError as e:
|
|
213
|
+
print(f"Error calling function: {e}")
|
|
214
|
+
result = {}
|
|
215
|
+
results[lowered] = results
|
|
216
|
+
|
|
217
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from time import sleep, time
|
|
3
3
|
from typing import Dict, List, Optional, Sequence, Union
|
|
4
|
-
from
|
|
4
|
+
from abstract_solana.abstract_utils.pubkey_utils import get_pubkey,get_sigkey
|
|
5
5
|
from solders.hash import Hash as Blockhash
|
|
6
6
|
from solders.keypair import Keypair
|
|
7
7
|
from solders.message import VersionedMessage
|
|
@@ -404,7 +404,7 @@ class Client(_ClientCore): # pylint: disable=too-many-public-methods
|
|
|
404
404
|
>>> solana_client.get_epoch_schedule().value.slots_per_epoch # doctest: +SKIP
|
|
405
405
|
8192
|
|
406
406
|
"""
|
|
407
|
-
return
|
|
407
|
+
return {}
|
|
408
408
|
|
|
409
409
|
def get_fee_for_message(
|
|
410
410
|
self, message: VersionedMessage, commitment: Optional[Commitment] = "finalized"
|
|
@@ -438,7 +438,7 @@ class Client(_ClientCore): # pylint: disable=too-many-public-methods
|
|
|
438
438
|
>>> solana_client.get_first_available_block().value # doctest: +SKIP
|
|
439
439
|
1
|
|
440
440
|
"""
|
|
441
|
-
return
|
|
441
|
+
return {}
|
|
442
442
|
|
|
443
443
|
def get_genesis_hash(self) -> GetGenesisHashResp:
|
|
444
444
|
"""Returns the genesis hash.
|
|
@@ -450,7 +450,7 @@ class Client(_ClientCore): # pylint: disable=too-many-public-methods
|
|
|
450
450
|
EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG,
|
|
451
451
|
)))
|
|
452
452
|
"""
|
|
453
|
-
return
|
|
453
|
+
return {}
|
|
454
454
|
|
|
455
455
|
def get_identity(self) -> GetIdentityResp:
|
|
456
456
|
"""Returns the identity pubkey for the current node.
|
|
@@ -462,7 +462,7 @@ class Client(_ClientCore): # pylint: disable=too-many-public-methods
|
|
|
462
462
|
2LVtX3Wq5bhqAYYaUYBRknWaYrsfYiXLQBHTxtHWD2mv,
|
|
463
463
|
)))
|
|
464
464
|
"""
|
|
465
|
-
return
|
|
465
|
+
return {}
|
|
466
466
|
|
|
467
467
|
def get_inflation_governor(self, commitment: Optional[Commitment] = "finalized") -> GetInflationGovernorResp:
|
|
468
468
|
"""Returns the current inflation governor.
|
|
@@ -924,7 +924,7 @@ class Client(_ClientCore): # pylint: disable=too-many-public-methods
|
|
|
924
924
|
>>> solana_client.get_minimum_ledger_slot().value # doctest: +SKIP
|
|
925
925
|
1234
|
|
926
926
|
"""
|
|
927
|
-
return
|
|
927
|
+
return {}
|
|
928
928
|
|
|
929
929
|
def get_version(self) -> GetVersionResp:
|
|
930
930
|
"""Returns the current solana versions running on the node.
|
|
@@ -934,7 +934,7 @@ class Client(_ClientCore): # pylint: disable=too-many-public-methods
|
|
|
934
934
|
>>> solana_client.get_version().value.solana_core # doctest: +SKIP
|
|
935
935
|
'1.13.2'
|
|
936
936
|
"""
|
|
937
|
-
return
|
|
937
|
+
return {}
|
|
938
938
|
|
|
939
939
|
def get_vote_accounts(self, commitment: Optional[Commitment] = "finalized") -> GetVoteAccountsResp:
|
|
940
940
|
"""Returns the account info and associated stake for all the voting accounts in the current bank.
|
|
@@ -1175,3 +1175,4 @@ class Client(_ClientCore): # pylint: disable=too-many-public-methods
|
|
|
1175
1175
|
else:
|
|
1176
1176
|
raise UnconfirmedTxError(f"Unable to confirm transaction {tx_sig}")
|
|
1177
1177
|
return body
|
|
1178
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from solana.rpc.core import _ClientCore
|
|
2
|
+
from typing import Dict, List, Optional, Sequence, Union
|
|
3
|
+
from solana.rpc.commitment import Commitment, Finalized
|
|
4
|
+
from abstract_solana.abstract_utils.pubkey_utils import get_pubkey,get_sigkey
|
|
5
|
+
import inspect,asyncio,json,requests
|
|
6
|
+
from abstract_apis import get_url,make_endpoint,get_headers,asyncPostRequest,get_async_response,get_headers
|
|
7
|
+
from abstract_utilities import is_number
|
|
8
|
+
def convert_to_lower(string_obj):
|
|
9
|
+
return ''.join(f"_{char.lower()}" if char.isupper() else char for char in str(string_obj))
|
|
10
|
+
def convert_to_upper(string_obj):
|
|
11
|
+
words = string_obj.split('_')
|
|
12
|
+
return words[0] + ''.join(word.capitalize() for word in words[1:])
|
|
13
|
+
def convert_to_body(string_obj):
|
|
14
|
+
return f"_{convert_to_lower(string_obj)}_body"
|
|
15
|
+
class Client(_ClientCore):
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
endpoint: Optional[str] = None,
|
|
19
|
+
commitment: Optional[Commitment] = "confirmed",
|
|
20
|
+
timeout: float = 10,
|
|
21
|
+
extra_headers: Optional[Dict[str, str]] = None,
|
|
22
|
+
):
|
|
23
|
+
"""Init API client."""
|
|
24
|
+
super().__init__(commitment)
|
|
25
|
+
client = Client()
|
|
26
|
+
def get_function(function_string):
|
|
27
|
+
try:
|
|
28
|
+
function = getattr(client, function_string)
|
|
29
|
+
except:
|
|
30
|
+
function =None
|
|
31
|
+
return function
|
|
32
|
+
def call_function(function,*args,**kwargs):
|
|
33
|
+
result = None
|
|
34
|
+
if function:
|
|
35
|
+
try:
|
|
36
|
+
result = function(*args,**kwargs)
|
|
37
|
+
except TypeError as e:
|
|
38
|
+
print(f"Error calling function: {e}")
|
|
39
|
+
result = None
|
|
40
|
+
return result
|
|
41
|
+
def convert_value(key,value):
|
|
42
|
+
pubkeys = ['pubkeys','pubkey','mint','owner','delegate']
|
|
43
|
+
if key in pubkeys:
|
|
44
|
+
if isinstance(value,list):
|
|
45
|
+
value = [get_pubkey(pubkey) for pubkey in value]
|
|
46
|
+
else:
|
|
47
|
+
value = get_pubkey(value)
|
|
48
|
+
return value
|
|
49
|
+
signatures = ['until','before','tx_sig','signature','before','signatures']
|
|
50
|
+
if key in signatures:
|
|
51
|
+
if isinstance(value,list):
|
|
52
|
+
value = [get_sigkey(signature) for signature in value]
|
|
53
|
+
else:
|
|
54
|
+
value = get_sigkey(value)
|
|
55
|
+
return value
|
|
56
|
+
return value
|
|
57
|
+
def get_conversions(variables,*args,**kwargs):
|
|
58
|
+
for i,arg in enumerate(args):
|
|
59
|
+
variable = variables[i]
|
|
60
|
+
kwargs[variable] = arg
|
|
61
|
+
for key,value in kwargs.items():
|
|
62
|
+
if key in variables:
|
|
63
|
+
kwargs[key] = convert_value(key,value)
|
|
64
|
+
return kwargs
|
|
65
|
+
def get_params(function):
|
|
66
|
+
sig = inspect.signature(function)
|
|
67
|
+
return list(sig.parameters.keys())
|
|
68
|
+
def get_rpc_dict(endpoint,*args,**kwargs):
|
|
69
|
+
body_call = convert_to_body(endpoint)
|
|
70
|
+
function = get_function(body_call)
|
|
71
|
+
variables = get_params(function)
|
|
72
|
+
kwargs = get_conversions(variables,*args,**kwargs)
|
|
73
|
+
kwargs = json.loads(str(call_function(function,**kwargs)))
|
|
74
|
+
if 'maxSupportedTransactionVersion' in kwargs.get('params',['',{}])[1] and not is_number(kwargs.get('params',['',{}])[1].get('maxSupportedTransactionVersion')):
|
|
75
|
+
kwargs['params'][1]['maxSupportedTransactionVersion'] = 0
|
|
76
|
+
return kwargs
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
abstract_solana/__init__.py,sha256=uEPtTF-WPCIwpwR8OgAI5prloYQpPbx-YExFgzZvFkQ,59
|
|
2
|
-
abstract_solana/abstract_rpcs/__init__.py,sha256=
|
|
2
|
+
abstract_solana/abstract_rpcs/__init__.py,sha256=esRi0CTqg6xvAb13TmfTWJSUR9zbFJlfic0vBZlQitw,135
|
|
3
3
|
abstract_solana/abstract_rpcs/db_templates.py,sha256=sjdHfHIq9bO6VuDm3hwzn46NUrXXrGnB0knYNeVU7k8,29839
|
|
4
|
-
abstract_solana/abstract_rpcs/
|
|
4
|
+
abstract_solana/abstract_rpcs/get_api_gui.py,sha256=xyfxZWdOdKADNcc3D8ityXMKx1wJ_HQcxxdh_54IN1A,12372
|
|
5
|
+
abstract_solana/abstract_rpcs/get_body.py,sha256=UV85217q7mIpYOhVZdnzfmgZxD3QM0w0J0oevXyYtdE,51272
|
|
6
|
+
abstract_solana/abstract_rpcs/solana_rpc_client.py,sha256=XeM2-pOievWh-JEyQRL_4tbcXMposAqtBos3KoNcJ-c,3006
|
|
5
7
|
abstract_solana/abstract_utils/__init__.py,sha256=HCbBVQ5BIFCVkFqqTMHp1Y__YQAO4HTq_KHVdMCe89U,296
|
|
6
8
|
abstract_solana/abstract_utils/account_key_utils.py,sha256=VMJd4GOTK1vn8UZsfXDnjxDOGoQWGY6fvflJqPZ7Xvs,877
|
|
7
9
|
abstract_solana/abstract_utils/constants.py,sha256=cSmCKzQiNZocX1YkKYrdY-O449aYhi7BT_j-45HZN-E,1418
|
|
@@ -17,7 +19,7 @@ abstract_solana/pump_functions/__init__.py,sha256=BiRxwJd1JWwEft63zqYwZ_Xs6UDp4h
|
|
|
17
19
|
abstract_solana/pump_functions/buy_sell_pump.py,sha256=gjv_1et20s1Li0ygcURofO29VPkO1v-a5G5Bo_sZs_c,7860
|
|
18
20
|
abstract_solana/pump_functions/pump_fun_keys.py,sha256=BeWbV9_wd-c6ydF33drW-gZBDPWolbsMZL4cNhP3eOU,8537
|
|
19
21
|
abstract_solana/pump_functions/token_utils.py,sha256=O-Fgj3L1NhND-k4INa3WvLAEXg2N9u1fVqyLFzn1PwM,2714
|
|
20
|
-
abstract_solana-0.0.1.
|
|
21
|
-
abstract_solana-0.0.1.
|
|
22
|
-
abstract_solana-0.0.1.
|
|
23
|
-
abstract_solana-0.0.1.
|
|
22
|
+
abstract_solana-0.0.1.4.dist-info/METADATA,sha256=hyEiYnXl4Lomyn-yUrzyS8yH_ze5DTRTL7cDyTXb5po,980
|
|
23
|
+
abstract_solana-0.0.1.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
24
|
+
abstract_solana-0.0.1.4.dist-info/top_level.txt,sha256=SsJYent8eZQ0FU2jmP8wTj7aFZFhNwxxP-5cCTQ2B-o,16
|
|
25
|
+
abstract_solana-0.0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|