Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
.. image:: https://readthedocs.org/projects/xrpl-websocket/badge/?version=latest :target: https://xrpl-websocket.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://badge.fury.io/py/xrpl-websocket.svg :target: https://badge.fury.io/py/xrpl-websocket
================
Websocket client for rippled with reconnecting feature, support both python 2 and 3
Via pip:
.. code-block:: bash
pip install xrpl_websocket
Simple example to send a payload and wait for response
.. code:: python
import json
from xrpl_websocket import Client
if __name__ == "__main__":
# create instance
client = Client()
# connect to the websocket
client.connect(nowait=False)
# send server info command
resp = client.send(command='server_info')
print("Server Info:")
print(json.dumps(resp, indent = 4))
# close the connection
client.disconnect()
You can also write your own class for the connection, if you want to handle the nitty-gritty details yourself.
.. code:: python
class Example(Client):
def __init__(self):
super(self.__class__, self).__init__(
log_level=logging.ERROR,
server="wss://xrpl.ws"
)
# connect to the websocket
self.connect()
def on_transaction(self, data):
print(json.dumps(data, indent = 4))
def on_ledger(self,data):
print('on_ledger')
def on_open(self, connection):
print("Connection is open")
print("Subscribe to ledger transactions")
self.subscribe_transactions()
def on_close(self):
print("on_close")
def subscribe_transactions(self):
self.send({
'command': 'subscribe',
'streams': ['transactions']
})
FAQs
XRL Websocket Client
We found that xrpl-websocket demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.