Skip to content

Commit

Permalink
Update jito_jsonrpc_sdk.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr0id authored Sep 2, 2024
1 parent 0635e43 commit 223c7b5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions sdk/jito_jsonrpc_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,17 @@ def send_bundle(self, params=None):
return self.__send_request(endpoint="/bundles?uuid=" + self.uuid_var, method="sendBundle", params=params)

# Transaction Endpoint
def send_txn(self, params=None):
if self.uuid_var == None:
return self.__send_request(endpoint="/transactions",method="sendTransaction", params=params)
else:
return self.__send_request(endpoint="/transactions?uuid=" + self.uuid_var, method="sendTransaction", params=params)
def send_txn(self, params=None, bundleOnly=False):
ep = "/transactions"
query_params = []

if bundleOnly:
query_params.append("bundleOnly=true")

if self.uuid_var is not None:
query_params.append(f"uuid={self.uuid_var}")

if query_params:
ep += "?" + "&".join(query_params)

return self.__send_request(endpoint=ep, method="sendTransaction", params=params)

0 comments on commit 223c7b5

Please sign in to comment.